Tuesday, April 7, 2009

Duplicate bootable BartPE USB in Ubuntu

I created this nice bootable USB using BartPE and, since then, have deleted the source off of my hard disk. Desktop Support just asked if I could copy the contents of my USB to theirs so they can enjoy all of that BartPE goodness. Trouble was, you can't copy the files and expect the USB to be bootable. To add to the fun, my USB was a 1GB stick and theirs was a 2GB.

Easiest solution: dd.

  1. Plug both usb's in your computer. Allow them to mount.
  2. Ensure you know which one is which. I ran df -H and could tell the 1GB (source) was /dev/sdb1 and the 2GB (destination) was/dev/sdc1
  3. Dismount the disks (from command line, umount /dev/sdb1 && umount /dev/sdc1)
  4. Duplicate the disks block for block: dd if=/dev/sdb of=/dev/sdc
  5. **Important** After the dd command has completed, pull the usb sticks out and put the destination back in. This allows for the new fat table to be re-read.
  6. Using gparted (sudo apt-get install gparted) resize the 1GB partition to the full disk size.

No comments:

Post a Comment