dd

dd: How to calculate optimal blocksize? [closed]

ⅰ亾dé卋堺 提交于 2019-12-02 13:54:55
How do you calculate the optimal blocksize when running a dd ? I've researched it a bit and I've not found anything suggesting how this would be accomplished. I am under the impression that a larger blocksize would result in a quicker dd ... is this true? I'm about to dd two identical 500gb Hitachi HDDs that run at 7200rpm on a box running an Intel Core i3 with 4GB DDR3 1333mhz RAM, so I'm trying to figure out what blocksize to use. (I'm going to be booting Ubuntu 10.10 x86 from a flash drive, and running it from that.) The optimal block size depends on various factors, including the operating

Error while creating a bootable floppy that contains a bootloader and a kernel

∥☆過路亽.° 提交于 2019-12-02 11:47:30
问题 I'm trying to create a bootable floppy drive for my boot.bin and kernel.bin files. My boot.asm code is: bits 16 section .text start: JMP MAIN WAIT_FOR_KEY: MOV AH, 00H INT 16H RET CLEAR: MOV AH, 0H ;CHANGING THE VIDEO MODE TO CLEAR THE SCREEN MOV AL, 03H ;VIDEO MODE COD INT 10H RET LOG_TO_HTS: PUSH BX PUSH AX MOV BX, AX MOV DX, 0 DIV WORD[ALL_SECTORS] ADD DL, 01H MOV CL, DL MOV AX, BX MOV DX, 0 DIV WORD [ALL_SECTORS] MOV DX, 0 DIV WORD[FACES] MOV DH, DL MOV CH, AL POP AX POP BX MOV DL, BYTE

Error while creating a bootable floppy that contains a bootloader and a kernel

北城余情 提交于 2019-12-02 04:23:06
I'm trying to create a bootable floppy drive for my boot.bin and kernel.bin files. My boot.asm code is: bits 16 section .text start: JMP MAIN WAIT_FOR_KEY: MOV AH, 00H INT 16H RET CLEAR: MOV AH, 0H ;CHANGING THE VIDEO MODE TO CLEAR THE SCREEN MOV AL, 03H ;VIDEO MODE COD INT 10H RET LOG_TO_HTS: PUSH BX PUSH AX MOV BX, AX MOV DX, 0 DIV WORD[ALL_SECTORS] ADD DL, 01H MOV CL, DL MOV AX, BX MOV DX, 0 DIV WORD [ALL_SECTORS] MOV DX, 0 DIV WORD[FACES] MOV DH, DL MOV CH, AL POP AX POP BX MOV DL, BYTE [BOOT_DEVICE] RET ECHO: ;-=-=-=PRINTING FUNCTION =-=-=-; LODSB ;MOV ONE CHAR FROM SI TO AL AND DELETE IT

Using grep to search for hex strings in a file

我与影子孤独终老i 提交于 2019-11-28 04:58:57
I have been trying all day to get this to work. Does anyone know how to get grep, or something of the like, to retrieve offsets of hex strings in a file? I have a bunch of hexdumps that I need to check for strings and then run again and check if the value has changed. I have tried hexdump and dd, but the problem is because it's a stream, I lose my offset for the files. Someone must have had this problem and a workaround. What can I do? To clarify, I have a series of dumped memory regions from GDB. I am trying to narrow down a number by searching out all the places the number is stored, then

How to overwrite some bytes of a binary file with dd?

橙三吉。 提交于 2019-11-27 20:05:53
I have a binary file and i want to replace the value A2 at address DEADBEEF with some other value, say A1 . How can I do this with dd ? If there are other tools that can do this, please suggest. But I plan to do this on iPhone so I can only work with most basic Unix tools. Chris Jester-Young printf '\xa1' | dd conv=notrunc of=somefile bs=1 seek=$((0xdeadbeef)) 来源: https://stackoverflow.com/questions/7290816/how-to-overwrite-some-bytes-of-a-binary-file-with-dd

Why is dd with the 'direct' (O_DIRECT) flag so dramatically faster? [closed]

假如想象 提交于 2019-11-27 05:52:18
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I have a server with a RAID50 configuration of 24 drives (two groups of 12), and if I run: dd if=/dev/zero of=ddfile2 bs=1M count=1953 oflag=direct I get: 2047868928 bytes (2.0 GB) copied, 0.805075 s, 2.5 GB/s But if I run: dd if=/dev/zero of=ddfile2 bs=1M count=1953 I get: 2047868928 bytes (2.0 GB) copied, 2

Creating a bootable ISO image with custom bootloader

风格不统一 提交于 2019-11-27 02:49:18
问题 I am trying to convert a bootloader I wrote in Assembly Language to an ISO image file. The following is the code from MikeOS bootloader. Here is my bootloader code: BITS 16 start: mov ax, 07C0h ; Set up 4K stack space after this bootloader add ax, 288 ; (4096 + 512) / 16 bytes per paragraph mov ss, ax mov sp, 4096 mov ax, 07C0h ; Set data segment to where we're loaded mov ds, ax mov si, text_string ; Put string position into SI call print_string ; Call our string-printing routine jmp $ ; Jump

How to overwrite some bytes of a binary file with dd?

和自甴很熟 提交于 2019-11-26 20:09:22
问题 I have a binary file and i want to replace the value A2 at address DEADBEEF with some other value, say A1 . How can I do this with dd ? If there are other tools that can do this, please suggest. But I plan to do this on iPhone so I can only work with most basic Unix tools. 回答1: printf '\xa1' | dd conv=notrunc of=somefile bs=1 seek=$((0xdeadbeef)) 来源: https://stackoverflow.com/questions/7290816/how-to-overwrite-some-bytes-of-a-binary-file-with-dd

How do I push a subprocess.call() output to terminal and file?

孤人 提交于 2019-11-26 14:55:43
问题 I have subprocess.call(["ddrescue", in_file_path, out_file_path], stdout=drclog) . I'd like this to display the ddrescue in the terminal as it's running and write the output to the file drclog. I've tried using subprocess.call(["ddrescue", in_file_path, out_file_path], stdout=drclog, shell=True) , but that gives me an input error into ddrescue. 回答1: If ddrescue doesn't change its output if its stdout/stderr are redirected to a pipe then you could use tee utility, to display output on the