LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 06-03-2005, 10:41 PM   #1
max321
LQ Newbie
 
Registered: Jun 2005
Location: Canada
Posts: 3

Rep: Reputation: 0
Need help on mirror HDD


Hello

The first time I have touched Linux Fedora Core 3 was about 3 weeks ago.
I do have over 15 years experience with Gates Windows,
but this is something elseand looks extremely good, stable and promising.
I have install FC3 ( 2.6.9…. ) form the CD’s and installed it successfully.
Obviously I had some problems and I was looking for some help on the net.
I have found this guy Stanton Finley…great written instruction for NB.
Following his instructions I have upgrade my original version to current 2.6.11-1.27
Downloading took about 40 min, installations took 2 H and 45 minutes.
All has been install with no problems and runs just fine.

My first question to you all with an experience….

At this moment all works perfect. The Internet, Mail, Skype…etc.
I must do some extra work to make CD play music, to DVD play movies. That is OK.
My burning question is: How do I make back up ( mirror ) my existing HDD.

I know, the deeper I go, …most likely I will screw things up.
In Gates Windows I used Max 3 disk for making mirror HDD.
All was done in just a matter of minutes.
Transfer one HDD disk to another was done with no pain.
My main concern is:
I have new install Linux, working perfectly.
I want to keep it as it is ….and transfer ALL to another HDD as a backup.
How do I do it. ??

Your input in the matter will be grate appreciated, as I learn to do things in Linux.
So far…..so good.

Thank you.
 
Old 06-03-2005, 11:40 PM   #2
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
'dd' is your friend. Another solution is to use 'tar' but then you would need to install the bootloader (grub, lilo) into the MBR. Googling those commands will help you. Let us know if run into any problems.

-twantrd
 
Old 06-03-2005, 11:57 PM   #3
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
I suggest you use rsync. While most folks think of rsync for a remote copy over a network, it's very efficient and particularly useful for mirroring. For example, if your backup HD is mounted at /mnt/backup, you would (as root):

rsync -avx --partial / /mnt/backup

There are many additional options you may find useful like '--bwlimit' to prevent the backup from monopolizing the drive so you can do useful stuff at the same time, and '--progress' to monitor the transfers (issue the command 'man rsync' for details). The backup can be interrupted and restarted at your discretion. It will pickup from where it left off until it runs to completion.

The nice thing is that once you have a backup, you can reissue the same command, and only the changes will be copied (a true mirror). Rsync is very fast, because it only copies changes. If you have a 2GB file that has a 2 byte change between backups, that's all that gets copied -- in seconds.

The program is included with Fedora, but it may not have been installed. If not, simply run (as root):

yum -y install rsync
 
Old 06-04-2005, 12:38 AM   #4
max321
LQ Newbie
 
Registered: Jun 2005
Location: Canada
Posts: 3

Original Poster
Rep: Reputation: 0
Hey and hello to twantrd & macemomenta

Thanks for your replay.
Let me rephrase all my frustrations:
I have the main HDD where all Linux staff is installed as a “ Master “.
Now, I just hooked up parallel as a “ Slave “ another ..empty HDD. ( to copy to )
What is the procedure:
Do I let the system to boot up normal way in Linux to find that HDD ….
Or,…. there is another way.
Please do understand me, I do not want to screw up my original HDD while practicing.
I have 2 extra spare HDD to play with, but only one ..the original HDD.

Thanks..
 
Old 06-04-2005, 12:56 AM   #5
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Ideally, there should only be a single drive on an IDE cable, to avoid contention. If you can arrange it that way, it would be better.

The system will find the drive(s) automatically when you boot. The naming is:

/dev/hda Master on first IDE connector
/dev/hdb Slave on first IDE connector
/dev/hdc Master on second IDE connector
/dev/hdd Slave on second IDE connector

Let's say your primary drive is /dev/hda, and your secondary drive is /dev/hdb. The first thing you need to do is partition and format the new drive (as root):

fdisk /dev/hdb
- create a partition, which will show up as /dev/hdb1

mke2fs -j /dev/hdb1
- Formats the partition as EXT3

When you reboot, FC3 should automatically find the new drive and add it to the /etc/fstab. It will probably put it at /media/something. If not, you can manually add a line to /etc/fstab to mount it automatically at boot:

For example, create the mount point /media/backup:

mkdir /media/backup

Add this to /etc/fstab:

/dev/hdb1 /media/backup ext3 defaults,auto 1 3

The drive will be mounted at the next boot, or you can do it manually:

mount /media/backup

You can now mirror your primary drive with the previous rsync command:

rsync -avx --partial / /media/backup

Last edited by macemoneta; 06-04-2005 at 01:01 AM.
 
Old 06-04-2005, 01:12 AM   #6
max321
LQ Newbie
 
Registered: Jun 2005
Location: Canada
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks again.

It is getting late in my Toronto time.
I will continue, and I will write all about this “ new “ experience. “ tomorrow.
Doing so, ( Gates is out of my mind for a while).
Linux, This is good, and thank you for all your help.
 
Old 06-04-2005, 01:50 AM   #7
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
There is another packaged option and that is PartImage which is very like Ghost and DriveImage. One of the advantages of P/Image is that it compresses the image. I use it for this purpose. The documentation isn't great and it does take a bit of reading to get to grips with.
 
Old 06-04-2005, 02:45 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Here's a vote for rsynch.
I don't use it personally, but certainly looks like the best solution here - especially for a new user.

For true mirroring, all solutions are fine - but how many people try to dd to smaller drive(s) and then ask questions here about that lost capacity ???.
The imaging solutions introduce complications (at recovery time) the OP could probably do without.
 
Old 06-05-2005, 05:30 PM   #9
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
About the rsync solution, would that copy over the bootblock as well?

-twantrd
 
Old 06-05-2005, 07:37 PM   #10
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
No, rsync copies only the files. If you want to copy the master boot record, then the trick is to make it a file:

dd if=/dev/hda of=/root/hda.mbr bs=512 count=1

That is, of course, assuming that /dev/hda is your boot drive (replace with whatever drive you are booting). Now that it is a file, rsync will copy it as well. You can put it back with:

dd if=/root/hda.mbr of=/dev/hda bs=512 count=1

I've actually used the rsync backup to recover many times - I usually wipe the HD when a new release comes out, then restore the files I need with rsync. That way I know I always have the latest clean installation. One rsync command puts back the entire '/home' hierarchy, I restore the /etc/passwd related files, and I'm back in business.
 
Old 07-30-2006, 03:38 PM   #11
d_GeNeRiT
LQ Newbie
 
Registered: May 2004
Location: Miami, FL
Distribution: Fedora Core 5
Posts: 28

Rep: Reputation: 15
Quote:
Originally Posted by macemoneta
No, rsync copies only the files. If you want to copy the master boot record, then the trick is to make it a file:

dd if=/dev/hda of=/root/hda.mbr bs=512 count=1

That is, of course, assuming that /dev/hda is your boot drive (replace with whatever drive you are booting). Now that it is a file, rsync will copy it as well. You can put it back with:

dd if=/root/hda.mbr of=/dev/hda bs=512 count=1

I've actually used the rsync backup to recover many times - I usually wipe the HD when a new release comes out, then restore the files I need with rsync. That way I know I always have the latest clean installation. One rsync command puts back the entire '/home' hierarchy, I restore the /etc/passwd related files, and I'm back in business.
Please outline the steps that would be needed to restore this backup? I have followed your instructions and saved the backup copy to my second hdd.

Assuming my primary hdd died how would I restore my system using these files?

I am a noobie
 
Old 07-30-2006, 08:19 PM   #12
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Well, in your quote of the text from my post is the command to restore the master boot record, which you would do after formatting and partitioning the drive.

Then reverse the source and destination on the rsync command(s), and all your files are back.
 
Old 07-30-2006, 09:45 PM   #13
d_GeNeRiT
LQ Newbie
 
Registered: May 2004
Location: Miami, FL
Distribution: Fedora Core 5
Posts: 28

Rep: Reputation: 15
Quote:
Originally Posted by macemoneta
Well, in your quote of the text from my post is the command to restore the master boot record, which you would do after formatting and partitioning the drive.

Then reverse the source and destination on the rsync command(s), and all your files are back.
So assuming I am just going to re-install my same exact OS (Fedora Core 5) then I would not need the FC5 installation CDs at all, right? What can I use to partition and format the drive that gets corrupted and how will I know the proper sizes for swap file, LVM etc?

Will the information from "df-h" be the answer?

I gotta be honest with you, I dont understand what Logical Volume is AT ALL. Thats one of the things I have never understood about linux.
 
Old 07-31-2006, 05:04 AM   #14
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
The answer to the questions depends on what you've chosen to backup.

If you've backed up everything, including the OS, then you need to have prepared with a backup copy of the partition map, and a bootable Linux CD (the rescue CD as a minimum). You would boot the CD, which gives you access to the partition tool (fdisk) and the format for the filesystem you have installed (for example, mke2fs for ext3). You will need to become familiar with the operation of each tool. Odds are you don't need LVM2 unless you are in a commercial environment, so you can skip that (Google will help you understand the functionality, if you are interested).

If you back up only the necessary data, the restore procedure is to re-install the system, apply maintenance, reconfigure any services, then restore the data. The advantage of this method is that it works for upgrades too (Fedora Core 6, 7, 8, ...).
 
  


Reply



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
Trying to add a third hard drive (hdd) and get Unable to open /dev/hdd MikeyCarter Linux - Hardware 4 12-26-2005 10:27 PM
Linux Raid 1 Mirror bad on SCSI HDD. Howto fix? blkcamarozr28 Linux - Enterprise 1 10-17-2005 07:19 PM
how to make mirror image of one hdd to 2 hdd raj_1 General 1 12-02-2004 06:19 PM
How to make mirror image of linux partion to one1 HDD TO 2 HDD raj_1 Linux - General 2 11-04-2004 01:45 AM
How to format & mount 2nd hdd after FedCor1 has been installed on 1st hdd? clay394 Fedora 1 05-18-2004 01:50 PM

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

All times are GMT -5. The time now is 04:36 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
Open Source Consulting | Domain Registration