Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
persistent partition naming and grub legacy
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
yee
n00b
n00b


Joined: 16 Sep 2004
Posts: 39

PostPosted: Fri Nov 14, 2014 3:18 pm    Post subject: persistent partition naming and grub legacy Reply with quote

For a stanza :
>title linux
>root (hd1,0)
>kernel /boot/bzImage root=LABEL=root
>initrd /boot/initramfs.cpio.gz

Most documentation given persistent naming as root=LABEL=ROOT. This, however, does not provide a complete solution since

root (hd1,0) and its equivalent
(hd1,0)/boot/bzImage and (hd1,0)/boot/initramfs.cpio.gz is not persistent.

My problem is that I have multiple hard drives. One is PATA and 4 is SATA. When grub-install is used (after linux is completely booted), the PATA (hd0) is mapped to both /dev/hda and /dev/sde while the SATA (hd1) is mapped only to to /dev/sda. When boot is actually happening, the SATA becomes (hd3) and there is only one entry for the PATA (hd0)
This poses problems for boot files such as grub.conf, bzImage on the SATA [initially (hd1) during grub-install but shows up later as (hd3)].

There are multiple solutions (including getting rid of the PATA, changing the plug assignments of the SATA) but the solution I would like to explore is persistent partition naming in grub itself so that (hd1,0)/boot/bzImage doesn't become (hd3,0)/boot/bzImage. I am not overly worried about the PATA having both /dev/sde and /dev/hda (although I would like to get rid of this as well).

It is possible that my diagnostic capabilities came to the wrong conclusion. My google search capabilities failed to uncover any solutions.

Is my thought process even correct? If so, does grub legacy support persistent naming at this level? Do I have to move to grub 2? Do I have an error in choosing options in the kernel?

Conway Yee
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7133
Location: almost Mile High in the USA

PostPosted: Fri Nov 14, 2014 4:28 pm    Post subject: Reply with quote

The actual boot device doesn't matter as long as the kernel boots, it will do its own mapping.

Now the tough part is that BIOS has to tell Linux what disk it used to load it. That's not always available. The kernel option CONFIG_EDD tries to use BIOS to tell what disk was booted but I don't know how it's used (perhaps it's saved in dmesg?)

I sort of have a similar issue on my RAID5. Though it always boots on the same disk, if that disk dies the machine won't boot. So my solution to that problem is put a boot sector on all of my disks that are independently able to boot the system, and problem is solved...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Fri Nov 14, 2014 5:30 pm    Post subject: Re: persistent partition naming and grub legacy Reply with quote

yee wrote:
Most documentation given persistent naming as root=LABEL=ROOT. This, however, does not provide a complete solution

You can use PARTUUID, which is a kernel level id.
Back to top
View user's profile Send private message
yee
n00b
n00b


Joined: 16 Sep 2004
Posts: 39

PostPosted: Fri Nov 14, 2014 8:00 pm    Post subject: Reply with quote

eccerr0r wrote:
The actual boot device doesn't matter as long as the kernel boots, it will do its own mapping.

Though it always boots on the same disk, if that disk dies the machine won't boot. So my solution to that problem is put a boot sector on all of my disks that are independently able to boot the system, and problem is solved...


I see, the solution is to place a boot partition and grub on EVERY drive. Whichever drive is chosen by the bios as the boot drive is automatically (hd0). grub.conf will point to (hd0) regardless of what hard drive is used.

The downside of this solution is the need to rsync all boot partitions to keep kernels up to date.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43198
Location: 56N 3W

PostPosted: Fri Nov 14, 2014 10:06 pm    Post subject: Reply with quote

yee,

Thats called raid1.

For example I have a 5 disk server. The drives are partitoned identically and matching partitions are donated to raid sets.
/dev/sd[abcde]1 are /boot in raid1. The other raid sets are raid5.

grub is installed on two driwes, since if I lose more that two drives the raid5 is dead and the box won't boot anyway.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum