First you'd need to determine which partition you're running Linux from. One way to do that is to run (from the terminal):
Here's some example output from one of my machines:
Code:
# sudo df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 8151384 7043488 693824 92% /
/dev/sda1 101089 15088 80782 16% /boot
/dev/sdc1 20635700 6573884 14061816 32% /mnt/data
varrun 1553404 332 1553072 1% /var/run
varlock 1553404 0 1553404 0% /var/lock
udev 1553404 48 1553356 1% /dev
devshm 1553404 0 1553404 0% /dev/shm
tmpfs 1553404 38176 1515228 3% /lib/modules/2.6.24-19-generic/volatile
The /dev/sd* (or if you are running IDE drives, /dev/hd*) partitions are the ones you're going to want to back up. The others you can ignore.
The next step would be to get those filesystems mounted read-only so nothing's changing while you're backing up. You can probably do that by booting the Ubuntu livecd (I don't think it automounts your partitions. It if does, unmount them). Then plug in a really big drive and Ubuntu should mount it somewhere under /media (when I plug in my My Book, it gets automatically mounted at "/media/My Book"). What you would then do (from the terminal), with the above partition setup, is:
Code:
# sudo dd if=/dev/sda1 of="/media/My Book/sda1.image" bs=1024
# sudo dd if=/dev/sda2 of="/media/My Book/sda2.image" bs=1024
# sudo dd if=/dev/sdc1 of="/media/My Book/sdc1.image" bs=1024
You can then test these backups by doing:
Code:
# sudo mkdir -p /mnt/backup_test
# sudo mount -o loop,ro "/media/My Book/sda1.image" /mnt/backup_test
(at this point you can navigate to /mnt/backup_test and make sure everything's there)
# sudo umount /mnt/backup_test
To restore these partitions, you would boot off the livecd, put in your big drive, and do:
Code:
# sudo dd of=/dev/sda1 if="/media/My Book/sda1.image" bs=1024
# sudo dd of=/dev/sda2 if="/media/My Book/sda2.image" bs=1024
# sudo dd of=/dev/sdc1 if="/media/My Book/sdc1.image" bs=1024
Note the switched 'of' (output file) and 'if' (input file). This will overwrite the current data on your drive, so be careful!
Also note that all this is off the top of my head so if any of this stuff errors out you should not ignore the error. This is dangerous stuff here.
Lastly, there are better ways to do this. Check out partimage; you can install it through the package manager. It looks like it will create smaller backups by not backing up unallocated space, too. There's probably plenty of other stuff out there like that as well.
Good luck!
Bookmarks