LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 09-13-2006, 04:29 PM   #1
tonypm
LQ Newbie
 
Registered: Sep 2006
Posts: 8

Rep: Reputation: 1
fc 4 on hda, and new fc5 on hdb


Hi, I want to do a clean install of fc5 on a new drive (slave on IDE0). I already have FC4 on hda (Master IDE0).

I would like to be able to boot either by using the bios boot option.

After I have got FC5 fully configured and set up, I aim to transfer user files to the new drive and stop using the old one. This seemed to me to be the cleanest way to build FC5 over a period of time without completely taking the working FC4 down.

Q1. Is this a reasonable approach - it seems like a clean approach to my thinking.

Q2. Can I make FC5 install the boot loader as a separate boot system without it trying to chain from hda/FC4.

Q3. will I be able to mount FC4 filesystem from FC5 once I am ready to transfer files. From something I read about increased security, it seems this may be difficult.

Problems so far.

1. I installed FC5 to my new drive, whilst hda was attached. Afterwards FC5 would not boot. Presumably the boot loader was set up incorrectly because the FC4 was seen as the primary boot?

2. I took power off the master drive and re-installed FC5 onto the slave. This now booted ok. But when I put the master drive back on, the FC5 installaation started to boot, but actually ended up loading the FC4 filesystem, (with errors).


Any advice or pointers to info would be gratefully received. I have looked at other posts about upgrading from one release to another and they are none too conclusive. For me creating a new clean system is ideal since there is clutter on the old system that I want to dispense with. Also I would like to have the flexibility of not having to finish building the FC5 system all in one hit.

Thanks - Tony
 
Old 09-13-2006, 05:34 PM   #2
hollywoodb
Member
 
Registered: Aug 2003
Location: Minnesota, U.S.A.
Distribution: Debian, openSUSE
Posts: 400

Rep: Reputation: 30
Quote:
Originally Posted by tonypm
1. I installed FC5 to my new drive, whilst hda was attached. Afterwards FC5 would not boot. Presumably the boot loader was set up incorrectly because the FC4 was seen as the primary boot?
Depends on how you installed the bootloader (GRUB). You could (and probably should) have installed GRUB to the MBR. The FC5 installer should have automatically found your FC4 install and added it to the boot menu. If you didn't install GRUB to the MBR, and GRUB was installed to the MBR when FC4 was installed, you will still load GRUB with the FC4 original configuration (as in not being aware of FC5).

Quote:
Originally Posted by tonypm
2. I took power off the master drive and re-installed FC5 onto the slave. This now booted ok. But when I put the master drive back on, the FC5 installaation started to boot, but actually ended up loading the FC4 filesystem, (with errors).
This is probably because of the way GRUB "sees" drives. It works like this:
1st partition on 1st HD on 1st IDE channel : (hd0,0)
2nd partition on 1st HD on 1st IDE channel : (hd0,1)
1st partition on 2nd HD on 1st IDE channel : (hd1,0)
2nd partition on 2nd HD on 1st IDE channel : (hd1,1)
1st partition on 1st HD on 2nd IDE channel : (hd2,0)
and so on and so forth.

This can be messed up by removing/adding drives without modifying GRUB's config. Here's what you can do:

You could reinstall FC5 to /dev/hdb, making sure that the partitioning is correct and that you install bootloader to MBR during install process, OR:

1) Leave both Master and Slave on 1st IDE channel plugged in. (/dev/hda and /dev/hdb, or (hd0,0) and (hd1,0))

2a) If you can boot your FC4 install, great. If not, you'll need a livecd/rescuecd for this step:

2b) Mount FC5 partition and open /mountpoint/boot/grub/grub.conf on your FC5 parition with a text editor (as root). (assuming /dev/hdb1, or (hd1,0) in this case). (Where 'mountpoint' is wherever you choose to mount FC5).

2c) look in /boot/ on FC5 partition. Should be a initrd-<vers> and vmlinuz-<vers>, where <vers> is the version and should match for vmlinuz and initrd.

3) In /boot/grub/grub.conf, all the (hdX,X) should match (hd1,0) assuming FC5 /boot/ is on /dev/hdb1. Same for the 'splashimage' line. Also, make sure is the same for the 'root', 'kernel', and 'initrd' lines. Is is possible that 'kernel' and 'initrd' won't have a (hdX,X), that should be fine, don't need to add it.

4) The 'kernel' line should near the end have something like "root=LABEL=/1" or "root=/dev/hdb1". Either is fine. The important thing is that if it does have a /dev/ value that it points to your FC5 filesystem /dev/ node.

5) Once you're positive that everything is correct, save grub.conf. If you're not sure, don't continue with the next steps.

6) Now its time to make sure that GRUB is installed correctly. To do so we want to be within the FC5 environment via chroot. So, if you mounted the FC5 filesystem to /mnt/FC5 for example:

chroot /mnt/FC5 /bin/bash

as root, substituting /mnt/FC5 for wherever FC5 partition is mounted.

7) If everything has gone correctly, you're now in FC5 environment. You can verify with 'cat /etc/fedora-release' It should tell you which version of Fedora you are chrooted (or not chrooted if it didn't work) into.

8) Again, if you're positive that grub.conf is correct (and if you're chrooted it is now in /boot/grub/grub.conf, since you're inside the mountpoint via chroot)... Run 'grub'.

9) Step 1 is to tell grub which partition /boot/ (and grub.conf) are on, so if its /dev/hdb1, enter: root (hd1,0). Before you enter that command you can try 'find /boot/grub/stage1' which should find locations of /boot/grub.

10) Now is the big final step 'setup (hd0,0)' will install GRUB to the MBR of the first device, which is what you're BIOS boots first, which is where we want it.

11) Type 'exit' to exit chroot, unmount FC5 partition. Reboot and all should be well. You can additionally add your FC4 lines to FC5's /boot/grub/grub.conf by simply copying the layout of the entries in FC4's /boot/grub/grub.conf for the FC4 kernels (the 'title','root','kernel','initrd' lines for the top-most entry should be enough)

12) If something goes wrong you can use a livecd/rescuecd to fix grub.conf on FC5 partition. Additionally, from the GRUB bootup menu, you can press 'e' to do a one-time edit of a boot entry or 'c' to enter a new boot entry.


I know it seems like a lot of steps, but it really isn't too difficult, good luck.
 
Old 09-20-2006, 05:53 PM   #3
tonypm
LQ Newbie
 
Registered: Sep 2006
Posts: 8

Original Poster
Rep: Reputation: 1
hoolywoodb,

thanks for a very comprehensive answer. I am working on it and trying out your suggestions. It all depends on exactly what I am trying to end up with. My aim is to have FC5 bootable on hdb and FC4 bootable on hda. I can boot them separately from the BIOS menu, so I am not worried about reflecting them in each other's grub conf.

I am still trying to get the steps that you advise clear in my mind, but I think the end result of what you propose is to get the grub boot info set up on the FC5 installation (modified by your steps) applied to the hda FC4 boot partition. Do I have that correct?

I will work at this again tomorrow, but there are a couple of things I do not currently understand. I am trying to get a better understanding of how grub works.

1. If I install FC5 onto hdb with the power off hda, the configuration that grub sets up uses hd0,0. And will boot fine, I would have thought it ought to have set up as hd1,0 since it knows this is hdb when it installs.

2. If I change the hd0,0 to hd1,0 and try to reboot, I get Error 15 missing file on boot up.

3. When I mount FC5 onto the FC4 system, I can only seem to mount the FC5 boot partition. Presumably the rest is on the second partition. How does that get mounted?

I think I am misunderstanding something fundamental.

I will be trying again and will post back here if I succeed in completing your proposed steps. I am a bit nervous to be doing anything on the working FC4 drive at the moment. I will play around with a non-production system first to make sure I am clear about what I am doing.

Thanks for your help.

Last edited by tonypm; 09-21-2006 at 01:47 AM.
 
Old 09-20-2006, 09:44 PM   #4
hollywoodb
Member
 
Registered: Aug 2003
Location: Minnesota, U.S.A.
Distribution: Debian, openSUSE
Posts: 400

Rep: Reputation: 30
Quote:
Originally Posted by tonypm
I am still trying to get the steps that you advise clear in my mind, but I think the end result of what you propose is to get the grub boot info set up on the FC5 installation (modified by your steps) applied to the hda FC4 boot partition. Do I have that correct?
My method has grub loading from the FC5 partition, but you will end up with FC4 available from the boot menu.

Quote:
Originally Posted by tonypm
1. If I install FC5 onto hdb with the power off hda, the configuration that grub sets up uses hd0,0. And will boot fine, I would have thought it ought to have set up as hd1,0 since it knows this is hdb when it installs.
But the way grub works is it just bases off the drives it sees. It doesn't actually understand /dev/hdb and /dev/hda from the bootloader perspective. The kernel knows this, and having /dev/* on the kernel line is fine, but when grub got installed it installed to what it knew as the first found disk, hence (hd0,0). When you plug in both disks grub comes across /dev/hda first, and thinks it is correct with (hd0,0), what it doesn't know is that what it thinks is (hd0,0) is actually (hd1,0)

Quote:
Originally Posted by tonypm
2. If I change the hd0,0 to hd1,0 and try to reboot, I get Error 15 missing file on boot up.
Could be a couple of things... if FC4 is on /dev/hda, and has grub installed on /dev/hda, that grub is going to load instead of the grub that is installed on /dev/hdb, since the BIOS will see/boot /dev/hda first if it is bootable and enabled.
Quote:
Originally Posted by tonypm
3. When I mount FC5 onto the FC4 system, I can only seem to mount the FC5 boot partition. Presumably the rest is on the second partition. How does that get mounted?
If you have seperate boot partitions you may have to modify the steps I posted above, every system is different. Try looking at your partitions with either cfdisk or parted. Running parted you'll get a little (parted) shell. help will list commands, the two most useful ones here are 'select', as in 'select /dev/hdb' and 'print all'.

You don't need to have the /boot partition mounted to mount the main FC5 filesystem under FC4... either cfdisk or parted should list your partitions so you can check them out.

Grub can be tricky & a bit confusing to work with, but its a good thing to learn. Just in case you can always make a backup of a working grub.conf and if things fail you can just use a rescue/livecd to mount the partition copy the backup back.
 
Old 09-21-2006, 06:34 AM   #5
decrepit
Member
 
Registered: May 2006
Distribution: Ubuntu10.04, < fedora12
Posts: 347

Rep: Reputation: 34
I guess it's too late now, but I had a similar problem to this, it's something to do with the way Fedora sets up this line in /boot/grub/grub.conf

kernel /vmlinuz-2.6.17-1.2142_FC4 ro root=LABEL=/ rhgb quiet

if you change root=LABEL=/ to the actual partion that FC5's / is on it will boot FC5 instead of FC4.
you can also the add FC5 to FC4 grub. And FC4 to FC5 grub. I like the idea of what you tried to do, it's the way I aproach multiple HD's I like each one to be able to boot itself. Then if the main drtive goes down, you can always boot the other/s by changing bios. But once that's set up, it's much easier to change OS with grub.
 
  


Reply

Tags
mount


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
hda hdb hdc aydindemirci Linux - Newbie 7 02-16-2006 02:55 AM
hda or hdb mislabeling =dn Linux - Hardware 4 01-16-2006 09:26 AM
Can I swap hda and hdb? snatale1 Linux - Hardware 1 03-10-2004 02:23 AM
cfdisk hdb instead of hda deceasedcomrade Slackware 1 11-20-2003 10:22 PM
moving hdb to hda linux inside Linux - Software 2 08-13-2003 05:57 PM


All times are GMT -5. The time now is 10:54 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration