LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Copy mbr of usb flash drive using dd. (https://www.linuxquestions.org/questions/linux-newbie-8/copy-mbr-of-usb-flash-drive-using-dd-861312/)

sr_25 02-07-2011 10:58 PM

Copy mbr of usb flash drive using dd.
 
I have 2 different usb flash drives. I use both Puppy linux and TRK on a regular basis. Both usb flash drives used to work correctly I had Puppy 5.11 installed on a SanDisk Cruzer mini 512mb usb flash drive, and TRK installed on a Toshiba 8gb usb flash both of these installations worked correctly. But I wanted to swap the installations :). So now TRK is currently working on the SanDisk but I can not get Puppy to boot on the 8gb Toshiba drive.

I had a thought that I would just copy the boot sector of the working dive to the usb flash drive but this didn't work. Here is what I did:
Code:

dd if=/dev/sdc of=/mnt/sdb5/MbrUSB.image bs=446 count=1
dd if=/mnt/sdb5/MbrUSB.image of=/dev/sdd1 bs=446 count=1

This however did not work it still will not boot. Does anyone have any idea how I can fix this?

RockDoctor 02-08-2011 06:05 AM

If all else fails, I suppose you could reformat the 8GB drive, install Puppy, then copy your pup_save file to the 8GB drive.

Charles4809 02-08-2011 03:58 PM

You did:

Code:

dd if=/dev/sdc of=/mnt/sdb5/MbrUSB.image bs=446 count=1
dd if=/mnt/sdb5/MbrUSB.image of=/dev/sdd1 bs=446 count=1

This means that you copied content of the MBR of sdc to the first partition of sdd

instead of copying to sdd1 you should have copied to sdd (without the partitionnumber)

It is possible that you have corrupted data on sdd1 by now!

sumeet inani 02-09-2011 04:16 AM

CORRECTION
MBR is of 512 bytes .
Boot code at beginning is 446 bytes followed by 64 byte partition table & 2 byte signature.

You are right , Charles4809 .
446 bytes have been written in beginning of first partition because /dev/sd#n means then nth partition of device number # , where # & n are numbers starting from 0 & 1 respectively.

JZL240I-U 02-22-2011 08:16 AM

There is also http://unetbootin.sourceforge.net/


All times are GMT -5. The time now is 06:18 PM.