You are not logged in.

#1 2018-04-18 20:18:17

f3flight
Member
Registered: 2015-03-04
Posts: 27

installing linux - directory permissions differ on /boot/

Hi all,

This has been bugging me for a while now. I have this output every time I update my workstation:

.......
:: Processing package changes...
(1/1) installing linux                                                      [#############################################] 100%
warning: directory permissions differ on /boot/
filesystem: 700  package: 755
.......
[user@pc ~]$ ls -ld /boot
drwxr-xr-x 2 root root 0 Apr 17 13:43 /boot
[user@pc ~]$ mount | grep boot
systed-1 on /boot type autofs (rw,relatime,fd=33,pgrp=1,timeout=120,minproto=5,maxproto=5,direct,pipe_ino=11067)
[user@pc ~]$ df /boot
df: cannot change to directory '/boot': Permission denied
df: no file systems processed
[user@pc ~]$ df /boot
Filesystem     1K-blocks   Used Available Use% Mounted on
/dev/sda1         511720 107536    404184  22% /boot
[user@pc ~]$ ls -ld /boot
drwx------ 4 root root 16384 Dec 31  1969 /boot
[user@pc ~]$ mount | grep boot
systemd-1 on /boot type autofs (rw,relatime,fd=33,pgrp=1,timeout=120,minproto=5,maxproto=5,direct,pipe_ino=11067)
/dev/sda1 on /boot type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)

So you see what's going on here? there's a folder with 755, but as soon as I try to access it - sorry, perm denied; however next try - I can access it already, but suddenly perms changed to 700, and it's double-mounted now.
I understand autofs is a mechanism to automount smth on demand, but why it changes perms to 700? Bug in systemd or smth else? I'm sure I didn't set this up, all I did was install with /boot on a separate partition.

Let me know how I can fix this behavior or debug it further.

Offline

#2 2018-04-23 11:19:27

paulkerry
Member
From: Sheffield, UK
Registered: 2014-10-02
Posts: 611

Re: installing linux - directory permissions differ on /boot/

f3flight wrote:

Hi all,

/dev/sda1 on /boot type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)

You've formatted /boot as vfat instead of [for instance] ext4.

Also why are you using autofs for /boot - why not just use /etc/fstab ?

Last edited by paulkerry (2018-04-23 11:24:44)

Offline

#3 2018-04-23 16:40:47

f3flight
Member
Registered: 2015-03-04
Posts: 27

Re: installing linux - directory permissions differ on /boot/

paulkerry wrote:

You've formatted /boot as vfat instead of [for instance] ext4.

Also why are you using autofs for /boot - why not just use /etc/fstab ?

Hi paulkerry,

I use vfat because /boot is my EFI partition, it has to be vfat.

Regarding autofs - that's exactly the point - I'm not "using" it, that's something which came by default after installation. I'm not sure where it's set! smile

Offline

#4 2018-04-23 16:46:49

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,543

Re: installing linux - directory permissions differ on /boot/

Plenty of things look wrong there with the mounts. What does fstab look like?

Offline

#5 2018-04-23 17:33:48

loqs
Member
Registered: 2014-03-06
Posts: 17,320

Re: installing linux - directory permissions differ on /boot/

Offline

#6 2018-05-03 21:05:27

f3flight
Member
Registered: 2015-03-04
Posts: 27

Re: installing linux - directory permissions differ on /boot/

That makes it a bit clearer, but still the question remains - how do I fix this?
According to @Maniaxx comment in the other thread, "putting the /boot files on ESP is a completely unnecessary step".
However there are a few issues with this statement:
1. https://wiki.archlinux.org/index.php/Systemd-boot - "To keep the kernel updated, it is simpler and therefore recommended to mount the ESP to /boot.", also "If the ESP is not mounted to /boot, the kernel and initramfs files must be copied onto that ESP.".
2. there's no instruction mentioned anywhere for alternative options.

So by default for UEFI the Arch installation (https://wiki.archlinux.org/index.php/installation_guide#Mount_the_file_system - mounting a separate partition to /mnt/boot) will look the same as mine and will show the same symptom, as long as systemd-boot is used as bootlader.
Therefore I'd say this is a glitch which needs some fix.

I see that the autogenerated unit /run/systemd/generator.late/boot.mount has "Options=umask=0077,noauto,rw" and "Where=/boot". Here it gets a bit confusing, the unit is supposed to be used for ESP only, but it so happens that by default /boot folder gets other data as well, the usual stuff - kernel images etc, and it's even recommended by the wiki.

Let's for a moment consider that wiki needs correction. Then how should the automated unit generator determine that ESP should be mounted under /boot/efi and not /boot? If it's possible then I can move the /boot files into primary partition, and just leave /boot/EFI there as an empty folder, and on ESP partition I will move EFI folder contents to top level and remove EFI folder.

Again here - https://wiki.archlinux.org/index.php/EF … _partition the doc says that /boot/efi should be used with bootloader, I consider systemd-boot a bootloader? Then https://wiki.archlinux.org/index.php/Systemd-boot needs correction.

I will try the trick of moving the /boot content to the main partition and remounting ESP to /boot/efi and then using "bootctl install" or "bootctl update", not sure if that will help, fingers crossed I will be able to boot into my system after reboot big_smile

Offline

#7 2018-05-03 21:48:22

f3flight
Member
Registered: 2015-03-04
Posts: 27

Re: installing linux - directory permissions differ on /boot/

So, I did this and it worked:
1. use a trick to disable automount - https://unix.stackexchange.com/a/405604
2. create folder /efi  # not /boot/efi, systemd-boot expects /efi or /boot even though wiki says it also checks /boot/efi
3. copy all content of /boot to /efi
4. umount /boot
5. copy all but "EFI" and "loader" from /efi to /boot (now on root partition)
6. reboot

But now future kernel updates will not automatically become active, as the files will get updated in /boot but not in /efi. So I have to use some of these options - https://wiki.archlinux.org/index.php/EF … unt_points
Conclusion I can make is that systemd-boot does not integrate well with default Arch Linux kernel update process and/or systemd-gpt-auto-generator.

Offline

#8 2018-05-03 22:22:52

loqs
Member
Registered: 2014-03-06
Posts: 17,320

Re: installing linux - directory permissions differ on /boot/

man 1 man systemd-gpt-auto-generator wrote:

Also, on systems where the units are explicitly configured
       (for example, listed in fstab(5)), the units this generator creates are
       overridden, but additional implicit dependencies might be created.

Would not adding an entry to the fstab for /boot been simpler and cleaner?

Offline

#9 2018-05-25 18:10:33

f3flight
Member
Registered: 2015-03-04
Posts: 27

Re: installing linux - directory permissions differ on /boot/

Added a warning to not use autofs for efi - https://wiki.archlinux.org/index.php/Sy … ot_manager
Ran into this issue 2 times in a row, now changing my setup to use /etc/fstab and moving to a default "/boot" mount for EFI without copy hooks.

Offline

Board footer

Powered by FluxBB