LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Creating a hdd image with DD (https://www.linuxquestions.org/questions/linux-general-1/creating-a-hdd-image-with-dd-550550/)

AwW41 05-01-2007 11:54 PM

Creating a hdd image with DD
 
Hi all Linux gurus,

I have a Windows machine that will soon be upgraded to Kubuntu 7. But before I proceed I decided to make an image of the harddrive (20 Gigabytes) and put it in an external drive (160 Gigabytes) using dd.

So I booted Helix LiveCD, mounted /dev/sda1, and typed the following:

dd if=/dev/hda1 of=/media/usbdrive/client_hdd.img conv=noerror

Everything started good and the copying began, however it ended with this: "File size limit exceeded". What gives?? The external drive has 145G of space available! The image file ended up at 4.0G, but should be 20G.

Could it be a single-file limitation of the file system? It is an off-the-shelf external hdd probably formatted with ntfs or fat32.

Any ideas will be GREATLY appreciated!

Thank you.

AwW41 05-02-2007 12:49 AM

O.K.,

In a sudden flash of the obvious, I realized that this may work:

1. create a 20G partition in sda1
2. mount as sda2
3. dd if=hda of=sda2
4. presto, no image needed.

Any input will be greatly appreciated...

syg00 05-02-2007 01:16 AM

post #1: looks like a FAT32 limitation (4 Gig filesize) - NTFS doesn't (shouldn't) suffer from this.
post #2: that (concept) will copy the MBR - including partition table. I doubt that's what you want. Try "if=/dev/hda1 of=/dev/sda2" - make it a bit larger too, for safety.

pixellany 05-02-2007 01:17 AM

I don't think using dd that way is going to work. dd does a literal copy from device to device. If you have the entire hard drive as the source device, then it will be copying the mbr and other stuff in the first 63 sectors into a partition---which of course makes no sense.

I think your issue could have been related to the target disk being formatted NTFS. Why not create an EXT3 partition on that disk and the dd to an image file per your original plan?

You can also use a really dumb, brute force solution and dd the whole drive to the external drive. This will wipe out whatever is on the drive, and it will require some fiddling to get the rest of the drive to be useable.
dd if=/dev/hda of=/dev/XXX, where XXX is the device name of the external drive

AwW41 05-02-2007 09:25 AM

Thank you all for the replies,

Syg00: Yes, what I meant was hda1 and sda1, I just got lazy in my own reply.

Pixellany: The main idea is to have a perfect copy of the hdd in case my client decides to revert back to Windows, in which case I can restore the machine back to its original state. I doubt that this will happen, but I would like to have a perfec image of the hdd just in case.

AwW41 05-02-2007 10:52 AM

With regard to the 4G limitations of the file system, I found the following link diggin deep in LinuxQuestions:

http://www.williamaford.com/CloningaHDD.php

And here's the beaut...

<quote>

dd conv=noerror if=/dev/hda | split -b 100000000 - /mnt/space/LTRecover.img

So, this command ran for about 4 hours and moved 30 gigs to the partition space on DADSBOX.

I then swapped the hard drive, reloaded Knoppix, opened a console window, changed to root, created the mount point, mounted space on DADSBOX, and imaged the entire thing back to the new hard drive, reassembling the files as I went:

cat /mnt/space/LTRecover.img.* | dd of=/dev/hda

</quote>


All times are GMT -5. The time now is 09:56 AM.