LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-21-2006, 02:41 PM   #1
stevebrooks452
LQ Newbie
 
Registered: Mar 2006
Posts: 3

Rep: Reputation: 0
boot problem with cloned hard drives


Hi Everyone,

(My first post)

I am running a NIS/NFS file server for a small maths dept. The OS (FC4) and all the users home areas are on the same 120G sata HD "sda" on different partitions. I made an exact clone of the first hard drive (sda) onto a new drive (sdb) and it worked fine. That is I can now boot from either drive sda or sdb when only that drive is plugged into the port "SATA1" on the motherboard and the second port "SATA2" is not connected. My plan was to run the system from the main drive "sda" and simply mount the partition with the users home areas from the second drive "sda2" and "rsync" the changes every night.

The problem is when I try to boot with both dives connected the system actually seems to try to boot from both drives. I had assumed that making only the "sda" drive bootable in the BIOS would prevent this from happening. Do I need to work out how to configure GRUB to only boot from the drive "sda"?

Any help would be much appreciated.

Thanks,

Steve
 
Old 03-21-2006, 03:28 PM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Red Hat / Fedora makes use of partition labels, not a good idea with cloned drives on the same system. Both drives have the exact same named partition label(s) and confusion happens, you need to change these labels on one of the hard drives, read; man e2label
 
Old 03-21-2006, 03:43 PM   #3
stevebrooks452
LQ Newbie
 
Registered: Mar 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Lenard - thanks for your replay I will try this tomorrow.

Steve
 
Old 03-22-2006, 06:22 AM   #4
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Forgot to tell you that you can just not use them at all. This requires editing both /boot/grub/grub.conf and /etc/fstab, examples below;

First grub;

Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,2)
#          kernel /vmlinuz-version ro root=/dev/hda5
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=15
splashimage=(hd0,2)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.16)
        root (hd0,2)
        kernel /vmlinuz-2.6.16 ro root=LABEL=/ quiet vga=791 npapic
Grub is nice an offers a clue in the top comment section, following the clue the kernel line changes from;

kernel /vmlinuz-2.6.16 ro root=LABEL=/ quiet vga=791 npapic

to;

kernel /vmlinuz-2.6.16 ro root=/dev/hda5 quiet vga=791 npapic

Editing /etc/fstab is a bit harder, you have to know or find out which partition label is which actual device/partition. You already had one given to you from grub.conf and many times you have clues in the file. Just taking the root partition as an example (the easy one of course);

Code:
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/                 /                       ext3    defaults        1 1
is changed to;

Code:
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/hda5                 /                       ext3    defaults        1 1
It is not hard but does take a small bit of effort, no more effort then to change the labels with e2label or tune2fs -L (another way to edit the labels).

For LVM volumes see;
http://www.redhat.com/docs/manuals/e...orage-lvm.html
 
Old 03-23-2006, 03:07 AM   #5
stevebrooks452
LQ Newbie
 
Registered: Mar 2006
Posts: 3

Original Poster
Rep: Reputation: 0
It seems to work really well!

Lenard,

Thanks for the help, changing the labels with "e2label" and changing the "grub.conf" and "fstab" did the trick. I can now mount the requred partitions from the seconary drive "sdb" and "rsync" appropriately to keep the required partitions cloned.

I guess this is really just a poor mans solution to RAID1 - however it has the advantage of avoiding third party raid drivers that I have found not reliable enough yet.

Thanks Again

steve
 
  


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
2 hard drives, XP on my main sata drives, 10.2 on my IDE LILO doesnt show on boot up Dachy Slackware 14 01-03-2008 07:01 AM
Dual Boot two hard-drives orozcom1 Linux - Hardware 2 08-13-2004 09:17 AM
Upgrading hard drives on Software raid 1 boot drives. linuxboy123 Linux - General 0 12-11-2003 03:28 PM
How to boot with 2 hard drives scorpion777 Mandriva 4 09-24-2003 05:06 PM
2 hard drives dual boot almost there Kdiver58 Linux - Newbie 12 02-03-2003 01:49 PM

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

All times are GMT -5. The time now is 10:46 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