You are not logged in.

#1 2015-08-16 00:10:10

shing20
Member
Registered: 2015-08-15
Posts: 4

[SOLVED] Unable to find root partition at boot GRUB with LVM

hello i've been reading a lot of topics here of people having same problem that i have, but i can't solve it

i post here my configuration files:

  • /etc/fstab:

    # /dev/mapper/server-lvroot
    UUID=55463e03-43f5-44a7-a463-1710f99bb64d	/         	ext4      	rw,relatime,data=ordered	0 1
    
    # /dev/sda2
    UUID=392bce84-ffd4-4c07-bbf4-908d4510c207	/boot     	ext2      	rw,relatime,stripe=4	0 2
    
    # /dev/mapper/server-lvtmp
    UUID=f42ade34-d78a-439c-be9d-a46ffb997095	/tmp      	ext4      	rw,relatime,stripe=4,data=ordered	0 2
    
    # /dev/mapper/server-lvvar
    UUID=7f7de471-3485-4d3d-a0f9-81769ef7b791	/var      	ext4      	rw,relatime,data=ordered	0 2
    
    # /dev/mapper/server-lvvar--log
    UUID=ef134194-c88d-4e69-9e2b-e0cdd2030d8d	/var/log  	ext4      	rw,relatime,data=ordered	0 2
    
    # /dev/mapper/server-lvapache
    UUID=931f71ff-98ca-4bed-90ad-630c3e6df329	/var/http 	ext4      	rw,relatime,data=ordered	0 2
    
    # /dev/mapper/server-lvmysql
    UUID=6cbf4d2a-cbf0-4806-bf15-e4ad5663126e	/var/lib/mysql	ext4      	rw,relatime,data=ordered	0 2
    
    # /dev/mapper/server-lvtomcat--webapp
    UUID=8316c574-6670-4dd0-b358-02b2c83c8734	/var/lib/tomcat8	ext4      	rw,relatime,data=ordered	0 2
    
    # /dev/mapper/server-lvtomcat--data
    UUID=9883ee9a-93d8-4a8b-9e9d-35b26ddcb968	/var/tmp/tomcat8	ext4      	rw,relatime,data=ordered	0 2
    
    # /dev/mapper/server-lvhome
    UUID=2925d540-6cf1-4ef3-b336-847c2c47a1bc	/home     	ext4      	rw,relatime,data=ordered	0 2
    
    # /dev/mapper/server-lvswap
    UUID=ef61b5e0-bb72-4386-8cdb-8a091aaf42cc	none      	swap      	defaults  	0 0
  • /etc/default/grub:

    GRUB_DEFAULT=0
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="Arch"
    GRUB_CMDLINE_LINUX_DEFAULT="root=/dev/mapper/server-root quiet"
    GRUB_CMDLINE_LINUX=""
    
    # Preload both GPT and MBR modules so that they are not missed
    GRUB_PRELOAD_MODULES="lvm part_gpt part_msdos"
    
    # Uncomment to enable Hidden Menu, and optionally hide the timeout count
    #GRUB_HIDDEN_TIMEOUT=5
    #GRUB_HIDDEN_TIMEOUT_QUIET=true
    
    # Uncomment to use basic console
    GRUB_TERMINAL_INPUT=console
    
    # Uncomment to disable graphical terminal
    #GRUB_TERMINAL_OUTPUT=console
    
    # The resolution used on graphical terminal
    # note that you can use only modes which your graphic card supports via VBE
    # you can see them in real GRUB with the command `vbeinfo'
    GRUB_GFXMODE=auto
    
    # Uncomment to allow the kernel use the same resolution used by grub
    GRUB_GFXPAYLOAD_LINUX=keep
    
    # Uncomment if you want GRUB to pass to the Linux kernel the old parameter 
    # format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx" 
    #GRUB_DISABLE_LINUX_UUID=true
    
    # Uncomment to disable generation of recovery mode menu entries
    GRUB_DISABLE_RECOVERY=true
    
    # Uncomment and set to the desired menu colors.  Used by normal and wallpaper 
    # modes only.  Entries specified as foreground/background.
    #GRUB_COLOR_NORMAL="light-blue/black"
    #GRUB_COLOR_HIGHLIGHT="light-cyan/blue"
    
    # Uncomment one of them for the gfx desired, a image background or a gfxtheme
    #GRUB_BACKGROUND="/path/to/wallpaper"
    #GRUB_THEME="/path/to/gfxtheme"
    
    # Uncomment to get a beep at GRUB start
    #GRUB_INIT_TUNE="480 440 1"
    
    #GRUB_SAVEDEFAULT="true"
    GRUB_DISSABLE_SUBMENU=y
  • /boot/grub/grub.cfg:

    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #
    
    ### BEGIN /etc/grub.d/00_header ###
    insmod lvm
    insmod part_gpt
    insmod part_msdos
    if [ -s $prefix/grubenv ]; then
      load_env
    fi
    if [ "${next_entry}" ] ; then
       set default="${next_entry}"
       set next_entry=
       save_env next_entry
       set boot_once=true
    else
       set default="0"
    fi
    
    if [ x"${feature_menuentry_id}" = xy ]; then
      menuentry_id_option="--id"
    else
      menuentry_id_option=""
    fi
    
    export menuentry_id_option
    
    if [ "${prev_saved_entry}" ]; then
      set saved_entry="${prev_saved_entry}"
      save_env saved_entry
      set prev_saved_entry=
      save_env prev_saved_entry
      set boot_once=true
    fi
    
    function savedefault {
      if [ -z "${boot_once}" ]; then
        saved_entry="${chosen}"
        save_env saved_entry
      fi
    }
    
    function load_video {
      if [ x$feature_all_video_module = xy ]; then
        insmod all_video
      else
        insmod efi_gop
        insmod efi_uga
        insmod ieee1275_fb
        insmod vbe
        insmod vga
        insmod video_bochs
        insmod video_cirrus
      fi
    }
    
    if [ x$feature_default_font_path = xy ] ; then
       font=unicode
    else
    insmod part_gpt gpt 
    insmod lvm 
    insmod ext2
    set root='lvmid/LZVz8u-l5ue-u7Sf-3KeW-8eej-wzJM-Aj3wHV/7vHIJX-ZRFu-ulaD-DNkw-a22K-snb4-Rw5XRH'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint='lvmid/LZVz8u-l5ue-u7Sf-3KeW-8eej-wzJM-Aj3wHV/7vHIJX-ZRFu-ulaD-DNkw-a22K-snb4-Rw5XRH'  55463e03-43f5-44a7-a463-1710f99bb64d
    else
      search --no-floppy --fs-uuid --set=root 55463e03-43f5-44a7-a463-1710f99bb64d
    fi
        font="/usr/share/grub/unicode.pf2"
    fi
    
    if loadfont $font ; then
      set gfxmode=auto
      load_video
      insmod gfxterm
      set locale_dir=$prefix/locale
      set lang=en_US
      insmod gettext
    fi
    terminal_input console
    terminal_output gfxterm
    if [ x$feature_timeout_style = xy ] ; then
      set timeout_style=menu
      set timeout=5
    # Fallback normal timeout code in case the timeout_style feature is
    # unavailable.
    else
      set timeout=5
    fi
    ### END /etc/grub.d/00_header ###
    
    ### BEGIN /etc/grub.d/10_linux ###
    menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-55463e03-43f5-44a7-a463-1710f99bb64d' {
    	load_video
    	set gfxpayload=keep
    	insmod gzio
    	insmod part_gpt 
    	insmod lvm
    	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  392bce84-ffd4-4c07-bbf4-908d4510c207
    	else
    	  search --no-floppy --fs-uuid --set=root 392bce84-ffd4-4c07-bbf4-908d4510c207
    	fi
    	echo	'Loading Linux linux ...'
    	linux	/vmlinuz-linux root=UUID=55463e03-43f5-44a7-a463-1710f99bb64d rw root=/dev/mapper/server-root quiet
    	echo	'Loading initial ramdisk ...'
    	initrd	 /initramfs-linux.img
    }
    submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-55463e03-43f5-44a7-a463-1710f99bb64d' {
    	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-55463e03-43f5-44a7-a463-1710f99bb64d' {
    		load_video
    		set gfxpayload=keep
    		insmod gzio
    		insmod part_gpt 
    		insmod lvm
    		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  392bce84-ffd4-4c07-bbf4-908d4510c207
    		else
    		  search --no-floppy --fs-uuid --set=root 392bce84-ffd4-4c07-bbf4-908d4510c207
    		fi
    		echo	'Loading Linux linux ...'
    		linux	/vmlinuz-linux root=UUID=55463e03-43f5-44a7-a463-1710f99bb64d rw root=/dev/mapper/server-root quiet
    		echo	'Loading initial ramdisk ...'
    		initrd	 /initramfs-linux.img
    	}
    	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-55463e03-43f5-44a7-a463-1710f99bb64d' {
    		load_video
    		set gfxpayload=keep
    		insmod gzio
    		insmod part_gpt 
    		insmod lvm
    		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  392bce84-ffd4-4c07-bbf4-908d4510c207
    		else
    		  search --no-floppy --fs-uuid --set=root 392bce84-ffd4-4c07-bbf4-908d4510c207
    		fi
    		echo	'Loading Linux linux ...'
    		linux	/vmlinuz-linux root=UUID=55463e03-43f5-44a7-a463-1710f99bb64d rw root=/dev/mapper/server-root quiet
    		echo	'Loading initial ramdisk ...'
    		initrd	 /initramfs-linux-fallback.img
    	}
    }
    
    ### END /etc/grub.d/10_linux ###
    
    ### BEGIN /etc/grub.d/20_linux_xen ###
    ### END /etc/grub.d/20_linux_xen ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    ### END /etc/grub.d/30_os-prober ###
    
    ### BEGIN /etc/grub.d/40_custom ###
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    ### END /etc/grub.d/40_custom ###
    
    ### BEGIN /etc/grub.d/41_custom ###
    if [ -f  ${config_directory}/custom.cfg ]; then
      source ${config_directory}/custom.cfg
    elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###
    
    ### BEGIN /etc/grub.d/60_memtest86+ ###
    ### END /etc/grub.d/60_memtest86+ ###
  • partition scheme:

    NAME                        FSTYPE LABEL UUID MOUNTPOINT
    sda                                           
    |-sda1                                        
    |-sda2                                        /boot
    `-sda3                                        
      |-server-lvswap                             
      |-server-lvroot                             /
      |-server-lvtmp                              /tmp
      |-server-lvvar                              /var
      |-server-lvvar--log                         /var/log
      |-server-lvhome                             /var/log
      `-server-lvapache                           /var/http
    sdb                                           
    `-sdb1                                        
      |-server-lvmysql                            /var/lib/mysql
      |-server-lvtomcat--webapp                   /var/lib/tomcat8
      `-server-lvtomcat--data                     /var/tmp/tomcat8

Last edited by shing20 (2015-08-19 04:17:46)

Offline

#2 2015-08-16 00:27:10

Rethil
Member
Registered: 2014-08-21
Posts: 83

Re: [SOLVED] Unable to find root partition at boot GRUB with LVM

1. About separate /tmp partition, you might want to check
https://wiki.archlinux.org/index.php/Tmpfs

2. Try changing

GRUB_CMDLINE_LINUX_DEFAULT="root=/dev/mapper/server-root quiet"

to

GRUB_CMDLINE_LINUX_DEFAULT="root=UUID=55463e03-43f5-44a7-a463-1710f99bb64d quiet"

Offline

#3 2015-08-16 16:32:11

shing20
Member
Registered: 2015-08-15
Posts: 4

Re: [SOLVED] Unable to find root partition at boot GRUB with LVM

Rethil wrote:

1. About separate /tmp partition, you might want to check
https://wiki.archlinux.org/index.php/Tmpfs

2. Try changing

GRUB_CMDLINE_LINUX_DEFAULT="root=/dev/mapper/server-root quiet"

to

GRUB_CMDLINE_LINUX_DEFAULT="root=UUID=55463e03-43f5-44a7-a463-1710f99bb64d quiet"

Thanks, I tried it but didn't work, at boot say:

ERROR: device 'UUID=....' not found. skipping fsck
ERROR: Unable to find root device 'UUID=....' 

Offline

#4 2015-08-16 18:54:41

boban_dj
Member
Registered: 2015-03-17
Posts: 150

Re: [SOLVED] Unable to find root partition at boot GRUB with LVM

Why your fstab has:

# /dev/mapper/server-lvroot

and grub has :

GRUB_CMDLINE_LINUX_DEFAULT="root=/dev/mapper/server-root quiet"

server-lvroot <> server-root

Offline

#5 2015-08-17 05:05:55

shing20
Member
Registered: 2015-08-15
Posts: 4

Re: [SOLVED] Unable to find root partition at boot GRUB with LVM

boban_dj wrote:

Why your fstab has:

# /dev/mapper/server-lvroot

and grub has :

GRUB_CMDLINE_LINUX_DEFAULT="root=/dev/mapper/server-root quiet"

server-lvroot <> server-root

Yes, my mistake, i've corrected that but still having that problem

Thanks!

BTW: when i run grub-mkconfig -o /boot/grub/grub.cfg it gives me an error that say something like squashfs: SQUASHFS error; can't find a SQUASHFS superblock on sda1
EXT4-fs (sda1)....

Last edited by shing20 (2015-08-17 05:11:04)

Offline

#6 2015-08-17 12:19:08

boban_dj
Member
Registered: 2015-03-17
Posts: 150

Re: [SOLVED] Unable to find root partition at boot GRUB with LVM

Hi,
did you set in

 /etc/lvm/lvm.conf

to

use_lvmetad=1

then run

mkinitcpio -p linux

and mkconfig grub again.

What is you mkinitcpio.conf?
I have in MODULES=dm_mod and also in HOOKS= lvm2 (between block and filesystems)

In my

GRUB_CMDLINE_LINUX="root=/dev/mapper/VolGroup00-lvolroot"

where

tree /dev/mapper
/dev/mapper/
├── control
├── VolGroup00-lvolboot -> ../dm-0
├── VolGroup00-lvolhome -> ../dm-3
├── VolGroup00-lvolroot -> ../dm-2
└── VolGroup00-lvolswap -> ../dm-1

After I enable

systemctl enable lvm2-lvmetad.service

Let me know if this works, cause I tried it on Vbox

Last edited by boban_dj (2015-08-17 12:20:59)

Offline

#7 2015-08-17 17:18:40

shing20
Member
Registered: 2015-08-15
Posts: 4

Re: [SOLVED] Unable to find root partition at boot GRUB with LVM

boban_dj wrote:

Hi,
did you set in

 /etc/lvm/lvm.conf

to

use_lvmetad=1

then run

mkinitcpio -p linux

and mkconfig grub again.

What is you mkinitcpio.conf?
I have in MODULES=dm_mod and also in HOOKS= lvm2 (between block and filesystems)

In my

GRUB_CMDLINE_LINUX="root=/dev/mapper/VolGroup00-lvolroot"

where

tree /dev/mapper
/dev/mapper/
├── control
├── VolGroup00-lvolboot -> ../dm-0
├── VolGroup00-lvolhome -> ../dm-3
├── VolGroup00-lvolroot -> ../dm-2
└── VolGroup00-lvolswap -> ../dm-1

After I enable

systemctl enable lvm2-lvmetad.service

Let me know if this works, cause I tried it on Vbox

it worked fine! i've added dm_mod to mkinitcpio.conf and enabled lvm2-lvmetad

Thanks to all! smile

Offline

#8 2015-08-17 18:34:25

boban_dj
Member
Registered: 2015-03-17
Posts: 150

Re: [SOLVED] Unable to find root partition at boot GRUB with LVM

edit your post with [SOLVED} in the title

Offline

Board footer

Powered by FluxBB