Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bootloaders
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1498

PostPosted: Wed Jul 23, 2014 9:14 pm    Post subject: Bootloaders Reply with quote

Hi all,

The drive containing /boot and / is connected to SATA port 8 on my motherboard.

Currently ports 1, 2, 3, 7, and 8 are used. (1-3 are used in a btrfs RAID5, 7 is /var and /tmp, 8 is /boot and /)

It occurs to me that if I add some more drives there is a good chance the system will no longer boot because GRUB2 uses a similarly awful disk numbering system as Linux.

The BIOS is configured to boot from the disk in port 8. Is there a way to make sure GRUB2 also picks the right disk without fail?
Back to top
View user's profile Send private message
1clue
Veteran
Veteran


Joined: 05 Feb 2006
Posts: 1404

PostPosted: Wed Jul 23, 2014 9:20 pm    Post subject: Reply with quote

You can use UUIDs for your fstab.

Code:

PARTUUID=c6a94411-dea4-4e6-aa8a-a6262653d /boot      ext2   noauto,noatime   1 2   #/dev/sda2
PARTUUID=d8ad9cca-5d1b-485-8c00-2f3089e17  /         ext4   noatime      0 1   #/dev/sda3
UUID=b9e9d8da-0734-4bd2-bee5-008620e5        /home              ext4    defaults        1 1


Grub2 can understand PARTUUID which can be had from the blkid command and which you can get for any physical partition.

In my case /home is an lvm2 volume, which doesn't have PARTUUID.

As long as your system only has one bootable disk, you're pretty much guaranteed to boot it the way you want to this way.
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1498

PostPosted: Thu Jul 24, 2014 12:07 am    Post subject: Reply with quote

Sorry if I didn't make it clear; My query is with GRUB2 specifically; I'm currently using disk/by-path for the disks in fstab which sidesteps the naming ambiguity quite nicely.
Back to top
View user's profile Send private message
1clue
Veteran
Veteran


Joined: 05 Feb 2006
Posts: 1404

PostPosted: Thu Jul 24, 2014 1:22 am    Post subject: Reply with quote

I'm using grub2 but don't know that much about it. Here's an example of a portion of my file.

Code:

menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-85a849ee-f20a-4f76-b790-e6217f6deb91' {
        load_video
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
        else
          search --no-floppy --fs-uuid --set=root 93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
        fi
        echo    'Loading Linux 3.13.6-hardened-r3-kr1 ...'
        linux   /kernel-3.13.6-hardened-r3-kr1 root=/dev/sda3 ro 
}
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things 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