LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-14-2007, 06:39 PM   #1
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,059
Blog Entries: 2

Rep: Reputation: 227Reputation: 227Reputation: 227
Best way to back up system?


I'm looking for a easy way to back up my system. Right now it only takes up about 4GB out of 12GB I have given for that partition, so it will fit on a DVD. I tried using rsync, but that seems to ignore files such as Character Device and Block Device files.

I'm looking for something I can use if my whole partition or hard drive crashes, or something if only a few important files were to become corrupt or lost.

What I have available is:
- Another Linux distro (Sidux) installed on a separate partition that i planned on using for backup/repair of my primary Linux distro (Debian).
- Blank DVDs
- Another networked computer with partitions to backup data

My hard drive is partitioned like this:
http://www.replica9000.bizland.com/l...snapshot39.png
 
Old 12-14-2007, 07:33 PM   #2
chadl
Member
 
Registered: Sep 2005
Location: US
Distribution: Gentoo AMD64 Testing
Posts: 129

Rep: Reputation: 16
When I want to be able to get the partition back to exactly the state I had it in before, I like dd.

Something like dd if=/dev/sda2 | gzip > /path/to/image.gz will make a compressed image of the partition, that dd can copy back to the partition again later if necessary, and the partition will be exactly the same.

Using LVM to take a snapshot of the partition can make the backup process work in the background, without having to worry about the partition changing while it is being backed up.
 
Old 12-16-2007, 01:45 AM   #3
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,059

Original Poster
Blog Entries: 2

Rep: Reputation: 227Reputation: 227Reputation: 227
So if I use one of these two options will I get a 12GB file even though 8GB of the partition is un-used space?
 
Old 12-16-2007, 04:55 PM   #4
chadl
Member
 
Registered: Sep 2005
Location: US
Distribution: Gentoo AMD64 Testing
Posts: 129

Rep: Reputation: 16
That's the point of stuffing it through gzip. The output of dd will be the exact data in the partition, but gzip will compress that down, in my experience quite a bit, although the actual savings will vary depending on what is in the partition, and what is on the empty portions.
Running it through bzip2 can get even better compression ratios, but it tends to eat huge amounts of CPU time when it encounters large blocks of identical symbols (for example, parts of a partition that are null).

There are many other file-based backup systems for Linux, such as Amanda, that can do most everything if using dd is not the right solution. Every situation has a different ideal backup solution, depending on how it will be used.
 
Old 12-16-2007, 06:35 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,229

Rep: Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964Reputation: 2964
I take the opposite view. Only my data is important, not the system.

I backup what is valuable to me - if it all goes to hell I'll rebuild the system, then restore.
Takes less time/space for the backup, and when I do have to rebuild, it'll probably run better anyway ... Clean out the accumulated cruft.
 
Old 12-16-2007, 06:47 PM   #6
chilebiker
Member
 
Registered: Jun 2006
Location: Lake District, Chile
Distribution: Arch
Posts: 50

Rep: Reputation: 17
I agree with syg00, my data is more important than the system. I backup my /home and /data partitions daily with rsync and cron on a external usb-hd. Every month or so I burn a DVD which is stored on another place.
 
Old 12-17-2007, 12:09 AM   #7
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,059

Original Poster
Blog Entries: 2

Rep: Reputation: 227Reputation: 227Reputation: 227
I have a separate partition which is mounted under my home directory. That partition has my personal stuff like my music, videos, iso images, etc.. That data I already rsync that to another machine. But I would like to back up the OS itself incase it's an issue like a partition failure or something and not if the system just becomes unstable over time like winxp.
 
Old 12-17-2007, 11:32 AM   #8
kromberg
Member
 
Registered: Feb 2007
Location: Colorado
Distribution: FC6, FC7 x86_64
Posts: 218

Rep: Reputation: 30
Like syg00 I only save/backup my important data: /home, /root, /usr/local, and var.

Keith
 
Old 12-17-2007, 12:13 PM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
You wouldn't backup the /dev/, /proc/, /sys/, or /tmp directories. The devices in /dev/ are created when the system boots. /proc and /sys are psuedo filesystems. The files don't exist until you request them. /proc/self would backup the entire memoryspace, something you don't want to do.

IMHO, using dd to backup a partition may be useful after an initial installation.
Compressing the output of dd works if you zero out the freespace first. Otherwise it may not compress well because the filesystem contains the bit patterns from deleted files, or from a previous installation.

If you want to backup to dvd, look at the dar program. Some distro's have a kdar (kde) program that allows you to graphically set up the backups, and if you want, export a bash script that you can run from cron automatically. You could backup to a remote drive or a local drive, and have the backup saved in slices.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Back to PS3 system nwl1515 Linux - Newbie 2 10-16-2007 02:59 PM
Help with a System Update and Back up of data wadesmart Ubuntu 5 06-27-2006 05:50 PM
How can I back up my system? Jongi Ubuntu 4 04-28-2006 03:14 AM
complete system back-up netsurf SUSE / openSUSE 1 06-03-2005 06:59 AM
system back-up powadha Linux - Software 1 12-26-2003 11:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration