New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

system backup tutorial review

Got problems with your B2 or B3? Share and get helped!
Post Reply
zander
Posts: 141
Joined: 01 Jan 2009, 23:16
Location: las vegas, nv, usa
Contact:

system backup tutorial review

Post by zander »

hi,

i am proceeding with system back up of my bubba2. i propose to submit this method of system backup to the "how to" section but first wanted to run it past the masses to see if it is sound.

well its almost a complete backup but i exclude some directories for convenience because i don't think they are necessary. and i only back up the main storage because i got the external bubba storage for this purpose.

the process is to use tar and gzip or tar and bzip2 which takes longer but gets higher compression.

my bubba 2 has a 1tb primary storage and a 1tb bubba external esata.

first i become root and then navigate to the external drive.

once i am on the external drive in the place i want the archive to be created i type

Code: Select all

 tar cvpzf backup.tgz  --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys --exclude=/home/storage/extern --exclude=/home/lost+found / 
what that does is launch tar with the cvpzf options. c, create archive, v verify, p preserve permissions, z gzip the result, f name the tar file backup.tgz.

--exclude directs tar to exclude the directories /proc, /lost+found, /mnt, /sys, /home/storage/extern (because we only want to back up the system and main storage), /home/lost+found.

and then the final / tells tar to start the tar at the root of the file system.

or one can install bzip2 for higher compression and then one would enter...

Code: Select all

 tar cvpjf backup.tar.bz2 --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys --exclude=/home/storage/extern --exclude=/home/lost+found / 
with the z option replaced with j to choose bzip2 for file compression.

so when i want to restore the system i type... (if i used gzip)

Code: Select all

tar xvpfz backup.tgz -C /  
or if i used bzip2

Code: Select all

 tar xvpfj backup.tar.bz2 -C / 
if one used bzip2. and then remember to create the directories you excluded with mkdir

Code: Select all

mkdir /proc, mkdir /lost+found, mkdir /sys, mkdir /mnt, mkdir /home/lost+found 
so how does that look?

i have a backup running now with bzip2 i expect it will take +24hrs to complete because my itunes library is 35gb. i expect i will get comments on this before the backup finishes running.

tell me what you think.

keep up the good work!
~alonzo...
mcg
Posts: 36
Joined: 13 Nov 2009, 22:34

Re: system backup tutorial review

Post by mcg »

Looks like a good setup, Zander. I personally use rsync and I don't bother compressing, which has the advantage that the backup can serve as a hot spare when needed. (I don't use RAID, because I want the backup drive to age more slowly.) But of course your approach could save some extra space that you can use for other things.

How much space do you think you're saving using compression? I wouldn't think that your music or photos would compress very much, since they're already compressed, but the system files, applications, and so forth ought to respond well to it.
zander
Posts: 141
Joined: 01 Jan 2009, 23:16
Location: las vegas, nv, usa
Contact:

Re: system backup tutorial review

Post by zander »

hi mcg,

tar files are much larger than the original files it was run on. subsequently some form of compressions is always desirable when using tar. i ran two successful test backups using gzip. one of / excluding /home and one of /home excluding /home/extern and /home/lost+found.

the largest of the two was the backup of /home excluding /home/extern and /home/lost+found (which used gzip). i don't recall the exact size of the result but it could have been moved to another drive or location if one is available either via usb or ftp for storage off the bubba entirely.

i have not tried to restore with this method yet. honestly i am frightened to try unless i have too. :?

i will look into the rsync method of backup. its good to have more than one way to do something and perhaps the rsync method is better.

i should get some metrics on all these methods for us. i think i can write a shell script for the tar method to get time and space dimensions on tar gzip vs. tar bzip2. i have been wanting to do this since i started tinkering with this back up stuff.
~alonzo...
RandomUsername
Posts: 904
Joined: 09 Oct 2009, 18:49

Re: system backup tutorial review

Post by RandomUsername »

I've wrote some scripts for backups up with rsync. They're pretty simple but they cover the important things for me - keeping older versions and deleted files (i.e. not just mirroring which is what rsync would do by default) and encrypted backups for offsite storage. I've also adapted them to backup my client PCs (all Ubuntu) to my Bubba.

I'll post them here when I get a few minutes if anyone's interested.
zander
Posts: 141
Joined: 01 Jan 2009, 23:16
Location: las vegas, nv, usa
Contact:

Re: system backup tutorial review

Post by zander »

ty RandomUser,

i am interested. it would be wonderful if you could post them.

i have not written bash scripts before.

i have have misplaced my bash script writing tutorial book. but i will find it in a day or two.


well i just found bash script writing book and i hope to get started soon. :)
~alonzo...
RandomUsername
Posts: 904
Joined: 09 Oct 2009, 18:49

Re: system backup tutorial review

Post by RandomUsername »

Long post (longer than I intended) here: http://forum.excito.net/viewtopic.php?f=11&t=2227
Post Reply