Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: /dev/mapper/home not mounted to /home at boot anymore (have to do it manually) (Read 446 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

/dev/mapper/home not mounted to /home at boot anymore (have to do it manually)

The title pretty much says it, after having done a `pacman -Syu` today, my /dev/mapper/home is not anymore mounted automatically to /home, and I have to do it manually at each boot.

I would love to have a way to rollback everything, but I have made the mistake to try to roll back selected packages one by one (linux kernel, udev, esysusers, etc etc...) which now makes it cumbersome to get a list of what needs to be rolled back.

If somebody has a workaround and/or a similar experience after the latest upgrade, I would love to hear from you!

Some context: I am using OpenRC, seatd, have removed elogind (but there still seems to be a libelogind packaged installed)...
Other than that, well, I have all latest packages.

Re: /dev/mapper/home not mounted to /home at boot anymore (have to do it manually)

Reply #1
check if your
Code: [Select]
/etc/fstab
contains correct information about your disk and how it should be mounted. fstab

Re: /dev/mapper/home not mounted to /home at boot anymore (have to do it manually)

Reply #2
Thanks for the reply,
my /etc/fstab contains (among others) the line:

Code: [Select]
/dev/mapper/home	/home		ext4		rw,noatime,discard	0 2

(as I wrote it a long time ago, and it has worked fine until yesterday)

Re: /dev/mapper/home not mounted to /home at boot anymore (have to do it manually)

Reply #3
Seems like it might be some sort of race condition ?
I have zero experience with LVM but I'm guessing openrc is trying to mount /home before LVM has done it's thing?

As a workaround you could try just adding
Code: [Select]
mount -a
to the end of /etc/rc.local

Make sure
rc_logger="YES"
in /etc/rc.conf  (I can't remember if it's the default?). rc_verbose=yes might also help.
And then look in /var/log/rc.log for any errors regarding the mounting of /home

Re: /dev/mapper/home not mounted to /home at boot anymore (have to do it manually)

Reply #4
Thanks @gripped for looking into it.
I'm not using LVM, the responsible of the creation of /dev/mapper/home is dmcrypt.
I've checked in /etc/init.d that dmcrypt has the line
Code: [Select]
  before checkfs fsck localmount
so that the problem should not occur.

Here is an excerpt of rc.log:
Code: [Select]
 * Setting up dm-crypt mappings ...
egrep: warning: egrep is obsolescent; using grep -E
 *   home using: --allow-discards open /dev/nvme0n1p4 home ...
Enter passphrase for /dev/nvme0n1p4:
 [ ok ]
 [ ok ]
 * Updating /etc/mtab ...
 * Creating mtab symbolic link
 [ ok ]
 * Activating swap devices ...
 [ ok ]
 * Configuring kernel parameters ...
 [ ok ]
 * Creating user login records ...
 [ ok ]
 * Wiping /tmp directory ...
 [ ok ]
 * Setting hostname to <hostname> from /etc/hostname ...
 [ ok ]
 * Setting terminal encoding [UTF-8] ...
 [ ok ]
 * Setting keyboard mode [UTF-8] ...
 [ ok ]
 * Loading key mappings [fr] ...
 [ ok ]
 * Bringing up network interface lo ...
RTNETLINK answers: File exists
 [ ok ]
 * Bringing up interface lo
*   Caching network module dependencies
 *   127.0.0.1/8 ...
 [ ok ]
 *   Adding routes
 *     127.0.0.0/8 via 127.0.0.1 ...
 [ ok ]
 [ ok ]
 * Setting up sysusers.d entries ...
 [ ok ]
 * Setting up tmpfiles.d entries ...
 [ ok ]
 * Starting powerbuttonled ...
 * start-stop-daemon: /home/<user>/src/EmbeddedController/build/bds/util/ectool does not exist
 * Failed to start powerbuttonled
 [ !! ]
 * ERROR: powerbuttonled failed to start
 * Saving key mapping ...
 [ ok ]
 * Saving terminal encoding ...
 [ ok ]
 * Starting seatd ...
 [ ok ]
 * Seeding random number generator ...
 * Seeding 256 bits and crediting

【・・・】

You can see that dm-crypt starts, I type the password, all seems well, but at the point where the contents of /home is actually used (for a custom service I wrote powerbuttonled) it fails and that reveals that /home is actually not mounted.
But the file /dev/mapper/home exists, showing that dm-crypt did succeed.

Re: /dev/mapper/home not mounted to /home at boot anymore (have to do it manually)

Reply #5
Weird, I've noticed that in my whole rc.log there is absolutely no mention of "mounting local filesystems" as should be if the openrc service localmount was properly called.

So I guess somehow localmount isn't executed anymore after my latest upgrade?

Edit: even weirder, it was actually never called even before the problem started to occur. So I guess it is just not useful?
Then, what is actually in charge of mounting my home? Still investigating by comparing before with after, in the rc.log...

Re: /dev/mapper/home not mounted to /home at boot anymore (have to do it manually)

Reply #6
Code: [Select]
rc-update show

Re: /dev/mapper/home not mounted to /home at boot anymore (have to do it manually)

Reply #7
rc-update show

Code: [Select]
                acpid |      default                           
          agetty.tty1 |      default                          
          agetty.tty2 |      default                          
          agetty.tty3 |      default                          
          agetty.tty4 |      default                          
          agetty.tty5 |      default                          
          agetty.tty6 |      default                          
            alsasound |      default                          
         avahi-daemon |      default                          
               binfmt | boot                                  
           bluetoothd |      default                          
                boltd |      default                          
             bootmisc | boot                                  
              cgroups |                                 sysinit
             connmand |                                 sysinit
                cupsd |      default                          
                 dbus |      default                          
                devfs |                                 sysinit
              dmcrypt | boot                                  
                dmesg |                                 sysinit
                 fsck | boot                                  
             hostname | boot                                  
              hwclock | boot                                  
              keymaps | boot                                  
            killprocs |                        shutdown       
    kmod-static-nodes |                                 sysinit
                local |      default nonetwork                
           localmount | boot                                  
             loopback | boot
                 lxdm |      default                          
              modules | boot                                  
             mount-ro |                        shutdown       
                 mtab | boot                                  
               net.lo | boot                                  
             netmount |      default                          
         opensysusers | boot                                  
     opentmpfiles-dev |                                 sysinit
   opentmpfiles-setup | boot                                  
           postgresql |      default                          
       powerbuttonled | boot                                  
               procfs | boot                                  
        rfkillunblock |      default                          
                 root | boot                                  
         save-keymaps | boot                                  
    save-termencoding | boot                                  
            savecache |                        shutdown       
                seatd | boot default                          
              seedrng | boot                                  
              sideled | boot                                  
                 swap | boot                                  
               sysctl | boot                                  
                sysfs |                                 sysinit
              sysrqon | boot                                  
         termencoding | boot                                  
                 udev |                                 sysinit
         udev-trigger |                                 sysinit

Re: /dev/mapper/home not mounted to /home at boot anymore (have to do it manually)

Reply #8
Well it's enabled in boot ?

From /etc/init.d/localmount
Code: [Select]
depend()
{
need fsck root
use lvm modules
after clock lvm modules
keyword -docker -jail -lxc -prefix -systemd-nspawn -vserver
}
The fact you say localmount is not mentioned at all in rc.log make me wonder if any of its 'need' or 'after' dependencies are failing ? I could be way off the mark.

Can you enable verbose logging in /etc/rc.conf and then post a full rc.log
I'm not sure it will give an answer but that's my best idea atm.






Re: /dev/mapper/home not mounted to /home at boot anymore (have to do it manually)

Reply #9
Ok I solved it by adding

Code: [Select]
need dmcrypt

in both /etc/init.d/localmount and /etc/init.d/fsck (just in case, as I often see a non-fatal error of it trying to check the encrypted partition).

Maybe those changes should be upstreamed.

@gripped I can still show you the verbose log, but maybe it is not useful anymore?

Re: /dev/mapper/home not mounted to /home at boot anymore (have to do it manually)

Reply #10
Nah mate. We're good if you sorted it.  8)

 

Re: /dev/mapper/home not mounted to /home at boot anymore (have to do it manually)

Reply #11
Something weird is that, some months ago, I already had modified my /etc/init.d/dmcrypt to include
Code: [Select]
before checkfs fsck localmount

and that was working.

Now after the recent upgrade that was not enough, and I had to add the need dmcrypt in localmount...
I wonder what changed to provoke that...

I had even documented my mod of /etc/init.d/localmount here!! :
https://forum.artixlinux.org/index.php/topic,4342.msg28281.html#msg28281
Now maybe I should update that to include the mod of dmcrypt?