LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-23-2012, 04:18 PM   #1
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 297

Rep: Reputation: Disabled
Booting linux in a multi-disk environment - bootloaders


I am trying to run Linux in a multi-disk environment where disk drives are often either added or removed and where the linux root path may sometimes change when other drives are plugged in.

Say for example I install it with only one drive /dev/sda and partition it as follows:
/dev/sda1 - /boot
/dev/sda2 - swap
/dev/sda3 - / root
/dev/sda4 - /home
Now when I install a couple of new disk drives I find that the linux disk has become sdc:
/dev/sdc1 - /boot
/dev/sdc2 - swap
/dev/sdc3 - / root
/dev/sdc4 - /home
And linux will not boot until the other disks are removed.

This happens even thought the linux disk is first in the BIOS boot order, and regardless of whether the lilo bootloader is written to the MBR or to the superblock of linux root partition.

Is there some other way of booting linux which avoids this problem?
 
Old 02-23-2012, 04:34 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Use UUIDs instead of device descriptors, this should solve your problems. UUIDs are applied when formatting a device and never change (until the next re-format, of course).
You should be able to see the UUIDs for your device descriptors by running
Code:
ls -l /dev/disk/by-uuid

Last edited by TobiSGD; 02-23-2012 at 07:51 PM. Reason: fixed a sentence
 
Old 02-23-2012, 06:34 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,848

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
Nevermind - probably no boot-loader support for my suggestion.

Last edited by syg00; 02-23-2012 at 07:43 PM.
 
Old 02-24-2012, 03:48 PM   #4
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 297

Original Poster
Rep: Reputation: Disabled
Tried the uuid solution but still can't get it to boot with multiple disks in the system, errors with:
Code:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,3)
What about Grub does that allow booting in a multi-disk environment?
 
Old 02-24-2012, 07:51 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,848

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
The question is bad (all boot-loaders allow booting in a properly configured multi-disk environment), but grub2 - not classic grub - has the ability to use UUID natively (i.e. without the need for a patch or initrd/initramfs). Try that.

As an aside, current kernels also recognise UUID for partitions (not filesystems) - this means gpt formatted disks basically.
 
Old 02-25-2012, 06:47 AM   #6
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 297

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
The question is bad (all boot-loaders allow booting in a properly configured multi-disk environment), but grub2 - not classic grub - has the ability to use UUID natively (i.e. without the need for a patch or initrd/initramfs). Try that.

As an aside, current kernels also recognise UUID for partitions (not filesystems) - this means gpt formatted disks basically.
Ok lets say then trying to run linux in a variable multi-disk environment, that is where other disk drives may be inserted and/or removed.

Will try Grub2. Only thing I don't know is whether I still need to change the partition descriptors in fstab to uuid or not.

Edit
Just installed grub2, run sg2conf and wrote bootloader to MBR...
Still same problem:
Code:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,3)
This is with fstab entries using uuid. Any other suggestions what to try?

Last edited by Nick_C; 02-25-2012 at 07:10 AM.
 
Old 02-25-2012, 09:25 AM   #7
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 297

Original Poster
Rep: Reputation: Disabled
Is there anything special I need to do to get grub2 to use uuid? I have used sg2conf to configure grub.
 
Old 02-25-2012, 04:10 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,848

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
So we are to presume zenwalk ?.

grub2 should use UUID by default unless the option is disabled. So it depends on the (grub2) default/cfg file, and any wrapper(s) the distro choose to invoke. Perhaps try the grub-mkconfig shipped with the product.
 
Old 02-26-2012, 06:21 AM   #9
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 297

Original Poster
Rep: Reputation: Disabled
Discovered by trial and error that CentOS uses grub2 and their implementation actually uses uuids properly.

I have installed CentOS onto a single disk, then added another couple of disks on top and doesn't seem to matter which order the disks are in it boots up fine. I can just choose the bootable drive by reordering the drives in the BIOS disk boot order, same as we have always done with windows drives.

Frankly I am surprised, and perhaps just a little disapointed, to have encountered this problem with modern linux distros. Maybe just me but I would have assumed that something this basic would have been sorted out years ago.

Anyway for the moment CentOS seems to work. Also it has a 'Virtualization Host' installation package and allows exact package selection/deselection at install time.

Never heard of Zenwalk before perhaps I should try that out to compare it to CentOS. Can anyone suggest how they compare, Zenwalk vs CentOS.
 
Old 02-26-2012, 07:17 AM   #10
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 297

Original Poster
Rep: Reputation: Disabled
Been poking around the Zenwalk site tyrying to establish which version is most appropriate to provide the workstation virtualization host I am looking for. Then noticed mention of Zenserver has anyone used that before for virtualization?
 
Old 02-26-2012, 08:24 PM   #11
TKH
Member
 
Registered: Jul 2011
Location: Milky Way
Distribution: Ubuntu, LFS, Slackware, Fedora
Posts: 218

Rep: Reputation: 20
You might want to add the "rootdelay" parameter to the "linux" line. To use it, just type it after the "root" parameter. This parameter gives a several seconds delay (depending on the value that you give in), giving the time for your kernel to detect the hardware.
Syntax:
Code:
rootdelay=<seconds>
 
  


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
Found a work around for a multi-session CD/DVD not booting after first save to disk. heatray Puppy 1 09-26-2011 12:37 PM
YAST ruined hard disk partitions and bootloaders. Alkibiades SUSE / openSUSE 3 05-19-2006 11:12 AM
GRUB, Multi Linux/Multi Disk Boot gtnorton Linux - Software 1 03-16-2003 04:48 AM


All times are GMT -5. The time now is 08:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration