-   Linux - Newbie (
-   -   Creating/restoring drive image on USB drive (

OneSeventeen 07-05-2005 02:00 PM

Creating/restoring drive image on USB drive
I've got a couple of rather large USB drives lying around, and I'd like to make disk images of my laptop's hard drive every now and again, just in case.

I will be dual booting windows and linux (linux primary, windows for photoshop CS 2), and would like everything in the image, from the partition table to the boot loader to the files themselves.

The goal is, if I wanted to, I could write zeros to the drive a few times, boot using a CD (or the usb hard drive, if that would work) then typing a quick command to install one of the images from my usb drive to my laptop's hard drive.

Once it's done, I'd want to restart, boot from the laptop's hard drive, and have it look as though I never did anything.

Does this make sense? Is it possible? (I'm sure it is, but most imaging software I've used doesn't do well with dual booting, and requires an imaging server)

david_ross 07-05-2005 02:48 PM

dd would make an exact replica but you may want to use partimage which can create images without duplicating unused space. You can also do a network backup/restore.

fouldsy 07-05-2005 02:54 PM

I'd agree with the comment on partimage - I've used it for a couple of years to maintain backups of entire hard drives and it works flawlessly, and doesn't necessarily require any command line stuff to handle as it's ran from a nice menu system. Very quick too, and compresses the image if you tell it to, saving space on your external USB drive.

OneSeventeen 07-05-2005 03:00 PM

Unfortunately the partimage page is down currently, is it possible to boot partimage from a CD and store the image to USB then?

Once again, I'm trying to get away from anything that requires a network connection.

Can I boot into linux to create/restore images? or do I need to do all this imaging magic when the hard drive is not in use?

david_ross 07-05-2005 03:09 PM

The sourceforge page will let you download it:

You can do it from a cd. I think it is on knoppix and probably a few other live cds.

The network bit is optional. A local backup/restore is much faster.

It would be better doing it when the partitions are not in use.

fouldsy 07-05-2005 03:12 PM

I don't think it is actually possible to backup a hard drive that is currently mounted, i.e. you would have to use a Live CD, or I have a small install of Debian on a little partition on the drive I backup, meaning I boot into this basic system, run partimage to create the backup, the boot back into my normal working system.

OneSeventeen 07-05-2005 04:40 PM

Well, I just booted knoppix and ran partimage.
It showed all of my hard drives, including the USB drive. Unfortunately, they were all of type "[unknown]" and therefore could not be imaged.

I'm using a copy of Knoppix 3.6 I had lying around with Partition Image 0.6.4 on it, and none of the drives are mounted. Any ideas?

fouldsy 07-06-2005 04:56 AM

Could you possibly try a more recent version of Knoppix? It seems a pretty old version, but I still don't see why partimage couldn't understand the filetypes. What filesystem have you used for your drives?

cs-cam 07-06-2005 05:07 AM

dd will create an exact replica which isn't necessarily the best idea in the world. I'm pretty sure cat doesn't but I may be wrong, this is what I use to image DVDs

cat /dev/cdroms/cdrom0 > file.iso
# so in theory...
cat /dev/sda1 > usb_stick.img

The simple linux commands are the best :)

oneandoneis2 07-06-2005 05:08 AM

You could dd it and then gzip it to cure all the wasted space :)

All times are GMT -5. The time now is 08:14 PM.