subscribe
subscribe
I remember seeing somewhere in the thread how to make a log based off this backup script. can someone link me? my backups started failing for no reason....
This thread is awesome! I use this information to routinely tar my Ubuntu partition, and copy it to other partitions to allow multi-boot, etc.
This is what I do:
To copy Ubuntu installation:
1. Boot from live CD (or boot into another Linux partition if avail)
2. Let's say that the installation we want to copy is mounted at /media/disk-1, and we want to store the archive in the volume /media/DATA... first cd /media/disk-1, then type:
sudo tar cvpzf /media/DATA/ubuntu_backup.tgz *
To unzip Ubuntu archive:
1. Boot in Live CD mode or else in a second Linux partition
2. Let's say that the target volume is mounted at /media/disk-1, and the archive is stored in the volume /media/DATA... first cd /media/disk-1, then type type:
sudo tar xvpfz /media/DATA/ubuntu_backup.tgz
3. ***BEFORE*** rebooting the computer, if the target partition was reformatted before the restore, then it is necessary to change the UUID of the formatted partition back to that of the original installation. Do the following:
a) find out the UUID of the target drive by opening the file "/etc/fstab".
e.g., # /dev/hda1
UUID=558a338f-ebc1-4050-82f2-086da21170af / ext3 ...
b) change the UUID of the target partition back to what the fstab file expects:
sudo tune2fs /dev/hda1 -U 558a338f-ebc1-4050-82f2-086da21170af
c) now you can reboot the computer
4. If the target partition is different than the original backup partition, and if the target partition holds the active grub application for the disk, then (before reboot) edit menu.lst and fstab and modify the UUID's for each partition as required in each file (the command "blkid" prints the UUID's of each partition on the computer):
/boot/grub/menu.lst
/etc/fstab
Then reboot the computer.
I bumped this old thread earlier. I'm a 3 week Linux newbie and I'm just wondering if anyone is using this script that lunde wrote. If I had a test machine I would try it but I don't and its a pretty old thread so I'm not sure if it will work with Hardy 8.04.
http://ubuntuforums.org/showthread.php?t=47999
Thanks for this little piece of information!
I just did some restoring on live system, and I think it's not necessary/wise to copy PID files from /var/run when performing restore to live system... Nothing disasterous, but nasty shutdown error list, though
This is the command I use for creating a recovery partition
tar -c --exclude='/media/*' --exclude='/dev/*' --exclude='/home/*' --exclude='/proc/*' --exclude='/sys/*' --exclude='/tmp/*' --exclude='/var/run/*' --exclude='/var/lock/*' --exclude='/lib/modules/*/volatile/*' / | tar -xv --atime-preserve -C /media/sda10
/media/sda10 is another partition, which has a valid mounted filesystem. Best part is you can modify your lilo.conf or menu.lst and boot into it! I make these after virgin installs to preserve the base system in case I hose the configuration at some point...
If you wanted to just create a backup file then this will work:
tar -vcf backup.tar --exclude='/backup.tar' --exclude='/media/*' --exclude='/dev/*' --exclude='/home/*' --exclude='/proc/*' --exclude='/sys/*' --exclude='/tmp/*' --exclude='/var/run/*' --exclude='/var/lock/*' --exclude='/lib/modules/*/volatile/*' /
It's important that the exclude's be in single quotes, where there is a *. without the quotes, the * isn't treated as a literal *, instead it will be expanded to a list of filenames.
I've been tearing my hair out trying to use crontab for my backups. Removing the verbose switch fixed it!
Thanks
I've not finished reading this thread, but we may be forgetting the old trusty filesystem backup option in webmin.
Years ago, I needed to move the current servers to servers with scsi drives. After much reading and thought, I used webmin filesystem backup to get only these directorys, as home is/can be needed or not when you may be restoring to another machine.. It'd be good to clean out the apt cache before your backups.. (Of course, webmin gives you that option to..)
/etc
/var
/usr
/root
/sbin
Then installed debian on the new servers, installed webmin and restored. This worked like a charm and the servers still run today..
The beauty is, webmin does the ssh connection and scheduling for you. All with a gui you can get to from anywhere.. Nice tool!
I'm about to try it with Hardy. We'll see..
Maybe I nissed this but how do I restore just 1 particular file or directory? Say I only want to restore /home/blah/blahblah. How do I modify my command line?
Maybe I nissed this but how do I restore just 1 particular file or directory? Say I only want to restore /home/blah/blahblah. How do I modify my command line?
Bookmarks