Find the answer to your Linux question:
Results 1 to 10 of 10
Like Tree1Likes
  • 1 Post By rcgreen
I have 2 usb drives one has backtracks a linux distro on it. Boots up fine when I select boot from usb drive in the bios. using df to list ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2011
    Posts
    96

    problem cloning drive?


    I have 2 usb drives one has backtracks a linux distro on it.
    Boots up fine when I select boot from usb drive in the bios.

    using df to list the device files and mountings
    I see /dev/sdc1 as the backtracks usb the other usb drive device file is /dev/sdh1

    I issued
    dd if=/dev/sdc1 of=/dev/sdh1

    when it finished I tried booting with the other usb drive which should be an exact bit for bit copy of the other bootable one.
    But it doesn't boot? Why?

    I have tried umount the devices before issueing dd command as well . Still doesn't work?

    Do I need an special switches for the dd command like a bs , notrunc , or noerrors ?

    Also I did dd if=/dev/sdc1 count=1 | md5sum
    and dd if=/dev/sdh1 | count=1 | md5sum
    This gave me the same md5 hash for the begining of both drives
    So how can it not be booting

  2. #2
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    This is just a guess but I think you may have forgotten to copy the MBR to the new drive. Does that sound about right? See this link for more info on using DD command.
    dd (Unix) - Wikipedia, the free encyclopedia
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  3. #3
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,410
    Right, but an copy will only work, if the new drive has exactly the same size and geometry.
    It is probably better to create a new bootloader in the mbr with the apropiate grub/lilo tools.
    You must always face the curtain with a bow.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Apr 2011
    Posts
    96
    Well it works fine if I use the same type of usb drive.
    I was successful in copying the bootable backtracks usb
    to the same type of usb then booting from it instead of the original.

    I had bought an extra sandisk usb the same type as the working backtracks linux usb. When I used the commands above it was successful and I could boot from that one as well.

    I am wondering why though the other usb thumb drive is not working with dd and is not booting correctly (just black screen and a cursor show)?
    This thumb drive is new, no disk errors (i checked), bios recognizes it but has a blank name for it.

  6. #5
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    Just a random thought here, and it may not be the case...
    If it's a different type of drive, have you verified that the UUID of the partitions is remaining the same?
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

  7. #6
    Just Joined!
    Join Date
    Apr 2011
    Posts
    96
    well, I am not sure what that info means? Care to explain why this would have any effect on things.

    Anyway
    using sudo blkid I have
    /dev/sdb1: UUID="B840-A4C8" TYPE="vfat"
    /dev/sdg1: UUID="B840-A4C8" TYPE="vfat"

    /dev/sdg1 is the thumb drive that is not bootable.
    /dev/sdb1 is the thumb drive that working with dd and boots fine

    when I use df , sfdisk or any other tool that displays drive geometry they all display identical for both thumb drives.


    /dev/sdb1 3904640 2029168 1875472 52% /cdrom
    /dev/sdg1 3904640 2029168 1875472 52% /media/B840-A4C8

    /dev/sdb1: 1017 cylinders, 124 heads, 62 sectors/track
    /dev/sdg1: 1017 cylinders, 124 heads, 62 sectors/track

    But I think these tools are just reading the partition table to get this info and since I used dd to bit for bit copy every possible tool is going to have the same results.

    Plus if it is a bit for bit copy then I cann't see it not being bootable if the bios at least identifies it as bootable and the sector sizes are the same?

  8. #7
    Just Joined!
    Join Date
    Apr 2011
    Posts
    96
    The only other thought is
    since the bootable one is mounted on /cdrom
    maybe the physical sector size of it is 2048bytes and the other thumb drive is the standard 512bytes
    But I am not sure since all the tools I know of return the exact same thing for both usb drives.

    Is their any usb thumb drives out their that have a sector size of 2048 bytes (same as a cd)? I have only ever seen 512 , or 4098 bytes.

  9. #8
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,134
    I issued
    dd if=/dev/sdc1 of=/dev/sdh1
    Try dd if=/dev/sdc of=/dev/sdh

    You want to clone the whole device, not just the partition.
    jayd512 likes this.

  10. #9
    Just Joined!
    Join Date
    Apr 2011
    Posts
    96
    Your my hero!

    That did it

    I know why the same model ones where working.
    Because I was only cloning the partition and not the mbr with it.
    The same model ones must have had the same partition table by default and same bootloader code to get to that partitions mbr code.
    Where as the other usb thumb drive that wasn't the same make or model didn't. So it probably had a default mbr code that just jmp in an infinite loop ( thats why I saw the black screen and couldn't boot into the cloned partition)

    Thought /dev/sdb1 , /dev/sdh1 ,...etc where device files for the whole device but learned that these where just the partitions of the device if I wanted to access the whole thing/copy whole think then I would need to leave off the numbers.

    Thank you very much

  11. #10
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    Good catch there, rcgreen!
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •