You are not logged in.

#1 2023-06-18 19:15:29

dalu
Member
Registered: 2014-04-16
Posts: 98

[S] Grub on LVM rootfs /boot/ not found

I created

fdisk -l /dev/sdb
Disk /dev/sdb: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: Samsung SSD 840 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: FB0982C4-B0A9-4D48-9057-FEBCAE80D721

Device       Start       End   Sectors   Size Type
/dev/sdb1     2048    264191    262144   128M EFI System
/dev/sdb2   264192   1312767   1048576   512M Linux filesystem
/dev/sdb3  1312768 500117503 498804736 237.8G Linux LVM

sdb2 = boot

I am trying to move the system from a 128GB ssd to a 256GB SSD, only I'm using LVM2 on the new SSD, which will then be extended with the old SSD.

The Grub part

menuentry 'Arch Linux (rolling) (on /dev/mapper/vgroot-lvol0)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-595db493-5d23-4fc3-8417-ca84368059a3' {
        insmod part_gpt
        insmod lvm
        insmod xfs
        set root='lvmid/OTzoII-V94C-B7vk-tWoW-252A-PH7c-wvngKP/7CKv6y-yb8J-8Omw-x7eo-gwDs-TBsR-RcCi42'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='lvmid/OTzoII-V94C-B7vk-tWoW-252A-PH7c-wvngKP/7CKv6y-yb8J-8Omw-x7eo-gwDs-TBsR-RcCi42'  595db493-5d23-4fc3-8417-ca84368059a3
        else
          search --no-floppy --fs-uuid --set=root 595db493-5d23-4fc3-8417-ca84368059a3
        fi
        linux /boot/vmlinuz-linux root=UUID=fc3db734-b626-4b13-b09e-234d4d8d9272 rw nvidia-drm.modeset=1
        initrd /boot/intel-ucode.img /boot/initramfs-linux.img
}

/etc/fstab

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sda2
#UUID=fc3db734-b626-4b13-b09e-234d4d8d9272      /               xfs             rw,relatime,attr2,inode64,noquota,discard       0 1
# /dev/sdb3 lvm
UUID=595db493-5d23-4fc3-8417-ca84368059a3       /               xfs             rw,relatime,attr2,inode64,noquota,discard       0 1
# /dev/sdb2
UUID=e4cb7ac4-cfcd-4099-8ce0-933db1611b6e       /boot/          ext4            defaults,noatime        0 1
# /dev/nvme0n1p1
UUID=1cb7413f-7823-4cd7-8699-9e1fceaaae67       /home           ext4            defaults,relatime                       0 1
# /dev/dm-0
UUID=0c58e64a-e4a6-4e1f-b4d2-342976be1524       /home/darko/Downloads   ext4    defaults,relatime,discard       0 1

The error message in Grub is, can't find /boot/vmlinuz

Arch on LVM Wiki says I need a separate boot partition.

What am I missing, why isn't /dev/sdb2 mounted as /boot?

Last edited by dalu (2023-06-18 20:11:45)

Offline

#2 2023-06-18 20:11:29

dalu
Member
Registered: 2014-04-16
Posts: 98

Re: [S] Grub on LVM rootfs /boot/ not found

I was missing an lvm entry in /etc/default/grub

GRUB_PRELOAD_MODULES="part_gpt part_msdos lvm"

I also had to chroot into the new rootfs and install grub again, because the old one was done from outside the new partition aka not chrooted

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUBNEWLVM

I don't dare to touch secure boot, this is good enough

Offline

Board footer

Powered by FluxBB