You are not logged in.

#1 2016-03-11 15:03:08

BubuIIC
Member
Registered: 2013-01-18
Posts: 8

[Solved] System not starting up after moving to lvm2

Dear all,

I moved my archlinux system to a new lvm2 disk setup without a separate /boot partition.

I did what I thought were all necessary migration steps but I still can't get the system to boot again. (Basically going over the relevant points in the Install-Guide from the wiki, fstab, bootloader install and adjusting mkinitcpio.conf)

The system is running inside qemu/kvm.
Here is the output during the boot process:

Welcome to Linux!

[  OK  ] Listening on udev Control Socket.
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Listening on udev Kernel Socket.
[  OK  ] Listening on Journal Socket.
[  OK  ] Reached target Paths.
[  OK  ] Reached target Local File Systems.
[  OK  ] Created slice system.slice.
[  OK  ] Reached target Slices.
         Starting Create list of required st... nodes for the current kernel...
         Starting udev Coldplug all Devices...
[  OK  ] Reached target Timers.
[  OK  ] Reached target Swap.
[  OK  ] Reached target Sockets.
         Starting Journal Service...
[  OK  ] Started Create list of required sta...ce nodes for the current kernel.
         Starting Create Static Device Nodes in /dev...
[  OK  ] Started Journal Service.
[  OK  ] Started Create Static Device Nodes in /dev.
         Starting udev Kernel Device Manager...
[  OK  ] Started udev Kernel Device Manager.
[  OK  ] Started udev Coldplug all Devices.
[  OK  ] Reached target System Initialization.
[  OK  ] Reached target Basic System.
[     *] A start job is running for dev-disk...c89a6120.device (17s / 1min 30s)
[ TIME ] Timed out waiting for device dev-di...\x2d8a6b\x2d4172c89a6120.device.
[DEPEND] Dependency failed for File System C...42b-c49d-4631-8a6b-4172c89a6120.
[DEPEND] Dependency failed for /sysroot.
[DEPEND] Dependency failed for Initrd Root File System.
[DEPEND] Dependency failed for Reload Configuration from the Real Root.
[  OK  ] Stopped target Initrd Default Target.
[  OK  ] Stopped target Basic System.
[  OK  ] Stopped target System Initialization.
[  OK  ] Reached target Initrd File Systems.
[  OK  ] Started Emergency Shell.
[  OK  ] Reached target Emergency Mode.

From the live system:

root@archiso ~ # lsblk
NAME                MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sr0                  11:0    1  1024M  0 rom  
vda                 254:0    0   200G  0 disk 
└─vda1              254:1    0   200G  0 part 
  └─arch-arch--root 253:0    0   200G  0 lvm  
loop0                 7:0    0 310.6M  1 loop /run/archiso/sfs/airootfs
root@archiso ~ # blkid
/dev/vda1: UUID="JD02P2-AYig-3V7r-pjpl-E0K3-KbVX-KZiqjv" TYPE="LVM2_member" PARTUUID="bc009b47-01"
/dev/loop0: TYPE="squashfs"
/dev/mapper/arch-arch--root: UUID="5bd6642b-c49d-4631-8a6b-4172c89a6120" TYPE="ext4"
root@archiso ~ # cat /mnt/etc/fstab 
# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>

# /dev/mapper/arch-arch--root
UUID=5bd6642b-c49d-4631-8a6b-4172c89a6120	/         	ext4      	rw,relatime,data=ordered	0 1

I have added lvm2 to mkinitcpio.conf HOOKS:

HOOKS="systemd autodetect modconf block lvm2 filesystems keyboard fsck shutdown"

Any ideas as to what is the problem?

Last edited by BubuIIC (2016-03-11 16:19:30)

Offline

#2 2016-03-11 15:16:07

elkoraco
Member
Registered: 2013-02-18
Posts: 140

Re: [Solved] System not starting up after moving to lvm2

Did you adjust your bootloader configuration, which bootloader do you use, can you post its configuration content?

Offline

#3 2016-03-11 15:24:03

BubuIIC
Member
Registered: 2013-01-18
Posts: 8

Re: [Solved] System not starting up after moving to lvm2

I'm using grub, I ran the following commands for the new disk inside the chroot:

grub-install --target=i386-pc /dev/vda
grub-mkconfig -o /boot/grub/grub.cfg

There were warnings akin to this:   

WARNING: Failed to connect to lvmetad: No such file or directory. Falling back to internal scanning.

But form what I gathered this is non-critical(?), anyway grub reported success and seemed to find all startup configurations.

Here is the config:

root@archiso ~ # cat /mnt/etc/default/grub 
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="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_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=0 --stop=1"

I would have thought this is not bootloader related, the system is booting the linux kernel and finding the initramdisk. (But I'm not completely sure...)
But then for some reason can't find/mount the root filesystem. (This is my understanding of the error, which may be completely wrong.)

Last edited by BubuIIC (2016-03-11 15:31:35)

Offline

#4 2016-03-11 16:04:48

elkoraco
Member
Registered: 2013-02-18
Posts: 140

Re: [Solved] System not starting up after moving to lvm2

can you cat the grub.cfg file please?

Offline

#5 2016-03-11 16:18:22

BubuIIC
Member
Registered: 2013-01-18
Posts: 8

Re: [Solved] System not starting up after moving to lvm2

Solved.
The key was in me using the systemd hook in mkinitcpio.conf. Apparently the lvm2 hook is not compatible with that.[1]

Now the setup looks like this and the system boots fine:

HOOKS="systemd autodetect modconf block sd-lvm2 filesystems keyboard fsck"

The documentation in the wiki can definitely be improved though, it is just one tiny notice and not referenced in pages mentioning the lvm2 hook.

But at least the explanation why I could not get a rescue shell is buried in the same paragraph :-).

I'll see what I can do about the wiki pages.

[1]: https://wiki.archlinux.org/index.php/Mk … mmon_hooks

Edit: Wiki pages are updated.

Last edited by BubuIIC (2016-03-11 16:38:34)

Offline

Board footer

Powered by FluxBB