LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-05-2007, 11:23 PM   #1
thinksincode
LQ Newbie
 
Registered: Nov 2004
Location: Massachusetts, USA
Distribution: Fedora
Posts: 27

Rep: Reputation: 15
Advice for backup disk partitioning scheme?


Hi all!

I've got a Linux server running Fedora Core 6 with an internal 320GB hard disk, and an identical 320GB hard disk in an external USB enclosure. My plan is to do a daily backup/sync job using rsync. My question, though, is this: For the backup drive, should I create an identical partitioning scheme, or does it make sense to just have one big partition for backup purposes?

For reference, my main disk is partitioned like this:

/dev/hda1 ~100MB /boot
/dev/hda2 ~2GB Swap
/dev/hda3 LVM

and my LVM volumes are
/ 1GB
/var 8GB
/tmp 350MB
/usr 10GB
/home 3GB
/data ~250GB

My backup needs aren't too robust, so the idea is to basically have the entire contents of the drive mirrored once a day.

I'm still somewhat new at this (since I'm posting in the Newbie forum!) so any advice or criticism would be welcomed.

Thanks!!
 
Old 02-06-2007, 02:44 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Why not just make it a true mirror using mdadm? That way updates to the second drive occur at the same time as the first drive.
 
Old 02-06-2007, 02:46 PM   #3
thinksincode
LQ Newbie
 
Registered: Nov 2004
Location: Massachusetts, USA
Distribution: Fedora
Posts: 27

Original Poster
Rep: Reputation: 15
How complex is that to set up? I'm still fairly new to this.
 
Old 02-06-2007, 03:02 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Truthfully I've only done it at install time and not after the fact. It was fairly simple to do. The only gotcha I really know of is to insure you update grub after the setup so it knows how to boot the mirror drive when your primary goes down. (Even without the grub update the primary is fine.)

Typing "man mdadm" should give you an idea of what is needed.
 
Old 02-06-2007, 03:44 PM   #5
thinksincode
LQ Newbie
 
Registered: Nov 2004
Location: Massachusetts, USA
Distribution: Fedora
Posts: 27

Original Poster
Rep: Reputation: 15
Thanks, I will check that out. But, at the same time, if I end up still going with rsync, should I make the partition scheme the same, or use just one big partition on the backup drive?
 
Old 02-06-2007, 04:01 PM   #6
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Well if you're not trying to make it a bootable mirror there's no need to make it the same. You're essentially using it as if it were a tape. You might WANT to make it the same just so you know what partitions to rebuild on your first drive after you replace it in the crash.

You could then use rsync to do the copies once a day. rsync will let you just copy what has changed rather than having to recopy everything. It even has a flag to delete things from the target that aren't on the source so you can be sure garbage you delete from your first hard drive also gets deleted from the second rather than accumulating there.
 
Old 02-06-2007, 04:50 PM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I have not used rsync myself but believe it is the one you need as it only backups the changes.

My proposal would be

(1) Do a disk to disk mirror image once every month or two months by
Code:
dd if=/dev/hda of=/dev/hdb bs=32768
dd clones at about 50Mb/s so a 320Gb disk should take about 6400 seconds or 1.8 hours. The operation can be left unattended. I often use a Live CD like the latest Slax or Knoppix. You can do it within the source hard disk while it is being read. In your case you need the target disk hdb identical in size or larger than the source hda. Two identical disks (with exact number of sectors) are ideal.

(2) You do a daily rsync only with the /data partition and /home if it is needed. Don't use LVM myself but I believe it is just a routine mounting it with LVM own commands.

Last edited by saikee; 02-06-2007 at 04:52 PM.
 
Old 02-06-2007, 06:20 PM   #8
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
You really don't need to do the dd once every couple of months (or ever). While its true the first rsync would take a while because it copies everything all subsequent rsyncs would copy only the changes so will be much faster than the first run. The dd might be faster for the first copy than an rsync but since you have to do the rsync anyway why not do it from the get go? Since the files are always updated by rsync I don't see any need to do the dd after the first time.
 
Old 02-06-2007, 08:12 PM   #9
thinksincode
LQ Newbie
 
Registered: Nov 2004
Location: Massachusetts, USA
Distribution: Fedora
Posts: 27

Original Poster
Rep: Reputation: 15
Thanks for all the helpful replies! I don't want to back up just /home and /data, I want to back up everything (configuration stuff in /etc, stuff like that). But it looks like for an rsync backup I only need to really have one big partition, so I'll do that. Thanks again everyone!
 
Old 02-08-2007, 08:03 AM   #10
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
In deciding between backing up & mirroring, remember the differences: W/ a mirror both copies get corrupted at the same time, no history of changes, but great for protecting against hardware failure. W/ back ups, you get history & protection against software corruption, but the chance to lose info created between snapshots & no protection against hardware failure.

If you like rsync, check out rsnapshot -- it backs up only the changed files & keeps track of the history w/ a system of hard links.
 
Old 02-08-2007, 04:51 PM   #11
thinksincode
LQ Newbie
 
Registered: Nov 2004
Location: Massachusetts, USA
Distribution: Fedora
Posts: 27

Original Poster
Rep: Reputation: 15
You do make a good point. Most of this data will be under source control (Subversion), so data corruption isn't as much of an issue. I am more worried about a hard disk failing or something like that. So now after thinking this through, I tend to be leaning more towards mdadm/software RAID.
 
  


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
Partitioning Scheme introuble Debian 4 04-02-2006 10:37 AM
Need partitioning scheme advice Geocritter *BSD 5 12-29-2005 12:07 PM
Partitioning scheme? i.of.the.storm Linux - Newbie 9 08-28-2005 08:27 PM
disk to disk backup for debian/Mempis on bootable cd-- advice loninappleton Linux - Software 3 05-27-2005 01:00 AM
Advice on Partitioning Scheme? X_ArchAngel Slackware 12 06-30-2004 03:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:15 AM.

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
Open Source Consulting | Domain Registration