the bzip command I gave you will create a bit-for-bit copy of your hdd, minus the empty space, and compress it, so that it is a lot smaller than it is expanded on the hd.
Since the copy will contain the master boot record, in addition to all your data, you will not need to repartition to restore it.
It also works independently of the filesystem of the partition you are imaging. You could image a Mac hd with these commands on an x86 box, and restore it later, and it would work perfectly. So don't worry about killing some ntfs partitions, or other exotic filesystems. It's all good.
~J.P.
Quote (SaidinUnleashed @ Oct. 30 2005,22:56)
Easiest, most efficient way to image a drive in Linux.
This creates the image...
Code Sample
bzip2 -1c < /dev/hda > myhdimage.img.bz2
And this restores the image to the HD...
Code Sample
bzip2 -dc < myhdimage.img.bz2 > /dev/hda
Happy imaging.
~J.P.
Just a couple quick questions that I am not clear on when creating an image of your hard drive.
1) Does the image file need to be on another partition when you create it or will bzip know not to copy it?
2) Do you need to boot from another media (livecd, etc...) to perform this?
3) When you restore obviously you are booting from another media (livecd, etc...), but you can restore from a file on another media (i.e. another cd, usb drive, etc...), correct?thanks for your advice ~J.P.
unfortunately, as i said, i'm a big noob and i think i may have stuffed up, i just tried to make an image using the line
bzip2 -1c < /dev/hda > myhdimage.img.bz2
but i did it after booting up from my hd install not the live cd...
this is bad, no??so i stopped the above operation and deleted the 0 byte file that had been created, then rebooted with the live cd and tried to create the image file once more.
this time i got an error after a few moments... bzip2: I/O or other error, bailing out. Possible reason follows. bzip2: no space left on device Input file = (stdin), output file = (stdout)
what is this newbie doing wrong.... should i be doing this operation from the live cd, and if so can i specify to save the file i am creating to either the hd partition i am imaging or to my ext hdd directly?
sorry to be such a dill ~J.P.well i figure 2.5 hrs should have been enough time to bzip2 a 971MB partition, but it is still sitting there with 100% cpu usage and 50% swap used.