[GRLUG] duplicate usb drive

Al Tobey tobert at gmail.com
Wed Aug 30 14:38:14 EDT 2006


n 8/30/06, Bill Littlejohn <billl at mtd-inc.com> wrote:
>
>  I'm a little confused.
>  "You can correct the partition table with parted or fstab after it's
> done.".
>  What do you mean by "correct"?

If you want the partition table to match the drive size, just
rewriting it with fdisk can straighten it out.   Just don't worry
about it (as Michael Mol mentioned).

>  I've used guiparted in Knoppix but not much else. I usually use Partition
> Commander.
>  I'm also a little confused on the purpose of using fdisk and ntfsresize
> after transferring the image.

Don't sweat it.   It should boot without modifying it any further.
Using fdisk + ntfsresize lets you grow the partition to fill the whole
disk.   Not really necessary if you're just recovering data from it.

>
>  "
>  dd if=/dev/sda of=/dev/sdb bs=4000000
>  fdisk /dev/sdb
>  ...
>  ntfsresize /dev/sdb1
>  "
>  I know I'm being somewhat dense here - a little hand-holding would be
> appreciated.

No problem.
-Al Tobey

>  :)
>  Bill
>
>  Al Tobey wrote:
>  On 8/30/06, Bill Littlejohn <billl at mtd-inc.com> wrote:
>
>
>  OK. Short background.
> The integrated video card in my wifes winxp box is borked and the system
> won't boot anything.
> I want to duplicate the drive in order to boot the copy using LiveView
> in a VM for the purpose of recovering
> the damned DRM license keys for all her music.
>
> I have the 40GB source drive hooked up a usb-ide converter.
> I have a handy 75GB usb drive available to put the copy onto.
> My source drive shows as /dev/sda and the target as /dev/sdb under both
> Suse and Knoppix.
> No surprises there.
> The source drive has a single NTFS partition using 100%.
>
> So here is the problem,
> I need the result to be an exact copy (i.e. bootable), OR a single dd
> image would work for LiveView also, but needs to be readable from Win.
> I can't seem to use "dd if=/dev/sda of=/dev/sdb " because the drives are
> of differing geometry. (I tried anyway but got something like 116Kb/sec
> transfer and gave up :(
>
>  Try: dd if=/dev/sda of=/dev/sdb bs=4000000
>
> If your USB adapter is 1.0, it's not going to get faster. I get much
> better speeds than that on my USB2 adapter, though. Using the
> larger block size makes a big difference.
>
>
>
>  I can't use "dd if=/dev/sda1 of=/mnt/sdb1/winxp.img" because I need to
> format the target drive as FAT32 to be readable under Win and Linux and
> obviously you can't have a 37GB file on FAT32.
>
>  Just dd it over directly. You can correct the partition table with
> parted or fstab after it's done. I just did this the other day from
> a Linux rescue CD.
>
> dd if=/dev/sda of=/dev/sdb bs=4000000
> fdisk /dev/sdb
> ...
> ntfsresize /dev/sdb1
>
> With a little google searching, you can find how to merge the boot
> sector from the source drive onto the destination drive. Once you
> have that knowledge, you can just dd the partition after creating one
> of the same or slightly larger size on the dest drive.
>
> dd if=/dev/sda1 of=/dev/sdb1 bs=4000000
>
> To view your speed while dd is running, switch consoles and hit it with:
> kill -USR1 `ps -ef |awk '/dd if/{print $2}'`
> (kill -USR1 the pid of dd)
>
> -Al Tobey
>
>
>
>  So how does one make an exact copy of a drive to a non-identical drive?
>


More information about the grlug mailing list