Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Partly Solved] grub boot - fail to find root fs by UUID
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
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1557
Location: Adelaide/Australia

PostPosted: Fri Apr 07, 2017 4:21 am    Post subject: [Partly Solved] grub boot - fail to find root fs by UUID Reply with quote

My system boots just fine if I have root=/dev/sdb4 on the vmlinuz lines but if I have my UUID or PARTUUID, it fails to find them

Once the kernel is up and running, all the filesystems mount using UUID, LABEL or PARTUUID just fine, it's only during boot.

Suggestions welcomed.

This is my physical config
Code:
# lsblk --output NAME,SIZE,RO,TYPE,MOUNTPOINT,PARTLABEL,UUID,PARTUUID
NAME     SIZE RO TYPE MOUNTPOINT   PARTLABEL            UUID                                 PARTUUID
sdb    465.8G  0 disk                                                                       
├─sdb4 433.8G  0 part /            rootfs               7ee60652-08bf-4713-be21-e1da784ae165 3f1c359a-94b5-4cd8-9fa6-4994740586ee
├─sdb2   256M  0 part /boot        boot                 8712ef66-e2b9-46ca-aa4c-f7e0e31ab981 2261b5e6-9d10-4f04-9e41-ebb23130413a
├─sdb3  31.8G  0 part [SWAP]       swap                 ce41e34e-986a-40ca-8cb2-efcbb17fa7f8 19765bb2-b6c6-4ebe-8022-00cbe2e3bef3
└─sdb1     4M  0 part              efi                                                       4a088fd5-9ede-466a-8a62-4f0d5e34b0d8
sr0     1024M  0 rom                                                                         
sdc      5.5T  0 disk                                                                       
├─sdc2   4.5T  0 part /mnt/e_drive Basic data partition 561C1EA31C1E7DE5                     8e2074e1-d0cc-48f5-af53-aedf25d28a17
└─sdc1     1T  0 part /data        Basic data partition f19f512a-c9c7-478a-9da3-8a3b67bec275 1a1b88b2-1499-44fd-884d-6db8ff8b0041
sda    465.8G  0 disk                                                                       
├─sda2 465.3G  0 part /mnt/c_drive                      D8D453DAD453BA08                     5ae35627-02
└─sda1   500M  0 part                                   1806505F06504044                     5ae35627-01

/etc/fstab is as follows
Code:

UUID=7ee60652-08bf-4713-be21-e1da784ae165   /      btrfs      rw,noatime               1 0
UUID=7ee60652-08bf-4713-be21-e1da784ae165   /home      btrfs      defaults,autodefrag,noatime,subvol=home           1 0
UUID=7ee60652-08bf-4713-be21-e1da784ae165   /var      btrfs      defaults,autodefrag,noatime,subvol=var           1 0
UUID=8712ef66-e2b9-46ca-aa4c-f7e0e31ab981   /boot      ext2      noauto,noatime,defaults            1 0
UUID=ce41e34e-986a-40ca-8cb2-efcbb17fa7f8   none      swap      sw                  0 0
/dev/cdrom               /mnt/cdrom   auto      auto,users,ro               0 0
tmpfs                  /tmp      tmpfs      rw,nosuid,noatime,nodev,size=12G,mode=1777   0 0
PARTUUID=5ae35627-02              /mnt/c_drive    ntfs-3g         defaults,gid=ntfs,umask=0,umask=002,nls=utf8,silent,exec,ro     0 0
PARTUUID=8e2074e1-d0cc-48f5-af53-aedf25d28a17   /mnt/e_drive    ntfs-3g         defaults,gid=ntfs,umask=0,umask=002,nls=utf8,silent,exec        0 0
PARTUUID=1a1b88b2-1499-44fd-884d-6db8ff8b0041   /data      xfs      defaults,noatime            0 0

grub.cfg entry as generated by 'grub-mkconfig -o /boot/grub/grub.cfg' (does not boot)
Code:
   menuentry 'Gentoo GNU/Linux, with Linux 4.9.16-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.16-gentoo-advanced-7ee60652-08bf-4713-be21-e1da784ae165' {
      load_video
      if [ "x$grub_platform" = xefi ]; then
         set gfxpayload=keep
      fi
      insmod gzio
      insmod part_gpt
      insmod ext2
      set root='hd1,gpt2'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  8712ef66-e2b9-46ca-aa4c-f7e0e31ab981
      else
        search --no-floppy --fs-uuid --set=root 8712ef66-e2b9-46ca-aa4c-f7e0e31ab981
      fi
      echo   'Loading Linux 4.9.16-gentoo ...'
      linux   /vmlinuz-4.9.16-gentoo root=UUID=7ee60652-08bf-4713-be21-e1da784ae165 ro video=uvesafb:1024x768-32,mtrr:3,ywrap
   }

grub.cfg entry as follows, with the root=/dev/sdb4 substituted (boots)
Code:
   menuentry 'Gentoo GNU/Linux, with Linux 4.9.16-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.16-gentoo-advanced-7ee60652-08bf-4713-be21-e1da784ae165' {
      load_video
      if [ "x$grub_platform" = xefi ]; then
         set gfxpayload=keep
      fi
      insmod gzio
      insmod part_gpt
      insmod ext2
      set root='hd1,gpt2'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  8712ef66-e2b9-46ca-aa4c-f7e0e31ab981
      else
        search --no-floppy --fs-uuid --set=root 8712ef66-e2b9-46ca-aa4c-f7e0e31ab981
      fi
      echo   'Loading Linux 4.9.16-gentoo ...'
      linux   /vmlinuz-4.9.16-gentoo root=/dev/sdb4 ro video=uvesafb:1024x768-32,mtrr:3,ywrap
   }

_________________
...Lyall


Last edited by lyallp on Fri Apr 07, 2017 9:17 am; edited 1 time in total
Back to top
View user's profile Send private message
massimo
Veteran
Veteran


Joined: 22 Jun 2003
Posts: 1226

PostPosted: Fri Apr 07, 2017 7:33 am    Post subject: Reply with quote

I suppose for this to work you have to use an initramfs.
_________________
Hello 911? How are you?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Apr 07, 2017 8:18 am    Post subject: Reply with quote

lyallp,

The UUID is a property of a filesystem. To use it to mount root, the userspace mount program is required in an initrd.
Likewise, LABEL is a filesystem property too.

The kernel understands PARTUUID and block device names with no userspace help.
_________________
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
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1557
Location: Adelaide/Australia

PostPosted: Fri Apr 07, 2017 8:51 am    Post subject: Reply with quote

Cool, verified that PARTUUID does indeed work, but how do I convince grub-mkconfig to auto-generate PARTUUID rather than UUID?

I can manually edit the grub.cfg after generating but it would be nice to be automatically done.

I am not particularly interested in setting up a ramdisk as my previous install was a lot more complicated (software raid, LVM) and this system is much simpler with no raid, no logical volumes, etc.
_________________
...Lyall
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