Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
systemd unable to mount devicemapper lvm lvs other than /
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
Atha
Apprentice
Apprentice


Joined: 22 Sep 2004
Posts: 230

PostPosted: Wed Jul 15, 2020 10:31 am    Post subject: systemd unable to mount devicemapper lvm lvs other than / Reply with quote

I have an existing encrypted LVM installation from a previous Linux (different distribution). I reuse it for Gentoo.

Mounts within the LUKS LVM "linux_crypt":
  • / (btrfs) /dev/mapp/linux_crypt-gentoo
  • /mnt/previous-linux (btrfs) /dev/mapper/linux_crypt-previouslinux
  • /home (ext4) /dev/mapper/linux_crypt-user
  • /usr/local (ext4) /dev/mapper/linux_crypt-local
  • swap (swap) /dev/mapper/linux_crypt-swap

When the system is started, / gets mounted (probably by genkernel initrd), but systemd then fails to mount the remaining filesystems in vg "linux_crypt", /home and /usr/local, both ext4, as well as the swap and the /mnt/previous-linux (btrfs).
Under /dev/linux_crypt/* and /dev/mapper/linux_crypt* everything is there as supposed to.

Code:
You are in emergency mode. After logging in, type "jounalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or "exit"
to boot into default mode.

So I enter the root password and do a "swapon -a", which works. But when I run "mount -a", I don't get an error message, but no additional filesystem gets mounted either. "dmesg | tail" reviels it tried successfully though:
Code:
EXT4-fs (dm-4): mounted filesystem with ordered data mode. Opts: discard
EXT4-fs (dm-5): mounted filesystem with ordered data mode. Opts: discard


What the journal reviels is that I have a systemd-problem:
Code:
Subject: A start job for unit local-fs.target has failed.
Defined-By: systemd
Support: https://gentoo.org/support

A start job for unit local-fs.target has finished with a failure.

The job identifier is 44 and the job result is dependency.


Clearly, systemd is missing something, but what? Also, the "mount -a" fails because systemd immediately unmounts them (explaining the successful log in dmesg, but the filesystem ending up unmounted anyway):
Code:
kernel: EXT4-fs (dm-5): mounted filesystem with ordered data mode. Opts: discard
systemd[1]: home.mount: Unit is bound to inactive unit dev-linux_crypt-user.device. Stopping, too.
systemd[1]: Unmounting /home...


Code:
# systemctl status dev-linux_crypt-user.device
● dev-linux_crypt.device - /dev/linux_crypt/user
     Loaded: loaded
     Active: inactive (dead)

Jul 15 11:04:06 localhost systemd[1]: dev-linux_crypt-user.device: Job dev-linux_crypt-user.device/start timed out.
Jul 15 11:04:06 localhost systemd[1]: Timed out waiting for device /dev/linux_crypt/user.
Jul 15 11:04:07 localhost systemd[1]: dev-linux_crypt-user.device: Job dev-linux_crypt-user.device/start failed with result 'timeout'.


But why the timeout?!? The device is there!

It doesn't matter if I change /dev/mapper/linux_crypt* to /dev/linux_crypt/*, I tried.

A workaround, to get the system started by any means possible, I added "noauto" to the mount points in /etc/fstab. Now systemd starts successfully into default, meaining a SDDM login screen. I have to switch to a text console (Ctrl+Alt+F2), login as root, and finally I can mount all the filesystems without systemd interfering.

What am I missing here?
_________________
Think for yourself and let others enjoy the privilege of doing so too. Voltaire
Back to top
View user's profile Send private message
tabascoz
n00b
n00b


Joined: 14 May 2003
Posts: 45
Location: Rio de Janeiro

PostPosted: Mon Aug 03, 2020 9:16 pm    Post subject: Reply with quote

Hi,

I had the same issue, resolved by updating to latest masked sys-kernel/genkernel-4.1.0_beta1 and having new initramfs generated. Hope this helps,

Cheers, Fernando
_________________
Tabascoz
Back to top
View user's profile Send private message
Atha
Apprentice
Apprentice


Joined: 22 Sep 2004
Posts: 230

PostPosted: Thu Sep 10, 2020 6:58 am    Post subject: partly resolved Reply with quote

Thanks for the answer and sorry for the late reply.

I just couldn't get it to work, regardless of which version of genkernel I used.

I finally found that I had to add the "x-initrd.mount" mount option in /etc/fstab. According to systemd.mount this option will mount the specified filesystem already within the initrd/initramfs environment.

In my case this was successful, the filesystems are now mounted without any further issue, but I still have a failed "systemd-cryptsetup@lukscrypt.service". This LUKS partition is already decrypted from within the initramfs, the LVM vg linux_crypt and its partitions are then made available. Strangely I don't see as much services now, only "systemd-fsck@dev-linux_crypt-local.service", "systemd-fsck@dev-linux_crypt-user.service" and "dev-linux_crypt-swap.swap", all of which are loaded successfully. Also "usr-local.mount" and "home.mount" are now successful.

Maybe this helps others too. I don't think it's somewhere in the handbook or the wiki (yet). Thanks again.
_________________
Think for yourself and let others enjoy the privilege of doing so too. Voltaire
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