将部分数据从MBR.bin写入USB中的扇区

时间:2022-10-06 00:12:11

DD is a tool for linux which can Write partial data from MBR.bin to a sector in USB (instead of writing a whole sector). Now I need to do such thing in windows. There is a DD for windows, but it seems it will write a whole sector!

DD是一个linux工具,它可以将MBR.bin中的部分数据写入USB中的扇区(而不是写入整个扇区)。现在我需要在windows中做这样的事情。有一个DD的Windows,但它似乎会写一个整个扇区!

I need to write first 440 bytes of a mbr file to a usb stick. the code in linux is:

我需要将一个mbr文件的前440字节写入usb棒。 linux中的代码是:

dd if=mbr.bin of=/dev/sd<X> bs=440 count=1

and in windows it will be:

在Windows中它将是:

dd bs=440 count=1 if=mbr.bin of=\\.\<x>:

where x is the volume letter. But in windows it will cause USB to be corrupted and usb need to be formatted. It seems it writes the whole data. How can I solve this problem?

其中x是体积字母。但在Windows中,它会导致USB损坏,并且需要格式化USB。它似乎写了整个数据。我怎么解决这个问题?

2 个解决方案

#1


Copy a complete block!

复制一个完整的块!

e.g. for a 512 byte blocksize (512-440=72)

例如对于512字节的块大小(512-440 = 72)

copy mbr.bin mbr.full
dd bs=1 if=\\.\<x>: skip=440 seek=440 of=mbr.full count=72
dd bs=512 if=mbr.full of=\\.\<x>: count=1

#2


Are you sure you pass the parameters correctly? Maybe the win version expects it to be /bs=440. Just a guess. Can't you anyway just truncate the file to 440 bytes?

您确定正确传递了参数吗?也许win版本期望它是/ bs = 440。只是一个猜测。不管你怎么能把文件截断为440字节?

#1


Copy a complete block!

复制一个完整的块!

e.g. for a 512 byte blocksize (512-440=72)

例如对于512字节的块大小(512-440 = 72)

copy mbr.bin mbr.full
dd bs=1 if=\\.\<x>: skip=440 seek=440 of=mbr.full count=72
dd bs=512 if=mbr.full of=\\.\<x>: count=1

#2


Are you sure you pass the parameters correctly? Maybe the win version expects it to be /bs=440. Just a guess. Can't you anyway just truncate the file to 440 bytes?

您确定正确传递了参数吗?也许win版本期望它是/ bs = 440。只是一个猜测。不管你怎么能把文件截断为440字节?