Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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:
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.
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.
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
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.
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.
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!
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.
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.