You are not logged in.

#1 2024-07-31 20:03:59

bedtime
Member
Registered: 2019-02-12
Posts: 83

/etc/fstab not being obeyed [solved]

I would like my computer to mount the drives listed in /etc/fstab. Instead, it seems to auto-mount my root drive with its own options.

/etc/fstab:

# /dev/nvme0n1p3 LABEL=ROOT
#UUID=df2d0e9e-2d8d-4f79-b023-54f170b86fb1   /           btrfs       rw,noatime,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/@   0 0

# /dev/nvme0n1p1 LABEL=EFI
UUID=2189-33F5       /efi        vfat        rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro  0 2

Note that the root directory is commented out, so it should not be mounted.

But somehow it becomes mounted and with the options that I don't want:

$ mount
...
/dev/nvme0n1p3 on / type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/@)
...

I'm thinking that maybe systemd is auto-mounting it, so I masked these services:

# systemctl mask systemd-remount-fs.service
# systemctl mask efi.mount

Same result.

/etc/mkinitcpio.conf

MODULES=(lz4)
BINARIES=()
FILES=()
HOOKS=(autodetect base keyboard block udev filesystems fsck resume)
COMPRESSION="lz4"
#COMPRESSION_OPTIONS=()
MODULES_DECOMPRESS="no"

Any ideas?

Last edited by bedtime (2024-07-31 20:17:30)

Offline

#2 2024-07-31 20:06:39

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,642
Website

Re: /etc/fstab not being obeyed [solved]

How do you expect your system to work if the root partition isn't mounted? hmm

Here's my fstab:

~$ \cat /etc/fstab                                         
# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
~$

Does that help? tongue

If you want different options to be applied un-comment the root partition line in /etc/fstab and edit it to your taste.


Para todos todo, para nosotros nada

Offline

#3 2024-07-31 20:17:15

bedtime
Member
Registered: 2019-02-12
Posts: 83

Re: /etc/fstab not being obeyed [solved]

Head_on_a_Stick wrote:

How do you expect your system to work if the root partition isn't mounted? hmm
...

If you want different options to be applied un-comment the root partition line in /etc/fstab and edit it to your taste.

I uncommented and unmasked the systemd services, and it's working and adhearing to /etc/fstab now.

Clearly this is over my head, lol. I'm assuming that maybe systemd services have something to do with /etc/fstab?

Anyways, it's working now.

Offline

#4 2024-07-31 20:31:08

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,155

Re: /etc/fstab not being obeyed [solved]

On gpt drives systemd gpt auto generator is what tries to automount  "/" and other stuff .

It can be disabled by adding systemd.gpt_auto=0 or similar as kernel parameter .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2024-07-31 20:57:04

cryptearth
Member
Registered: 2024-02-03
Posts: 1,160

Re: /etc/fstab not being obeyed [solved]

doesn't require systemd-automount a systemd initrd?
how does your mkinitcpio.conf looks?

Offline

#6 2024-07-31 21:07:17

bedtime
Member
Registered: 2019-02-12
Posts: 83

Re: /etc/fstab not being obeyed [solved]

Lone_Wolf wrote:

On gpt drives systemd gpt auto generator is what tries to automount  "/" and other stuff .

It can be disabled by adding systemd.gpt_auto=0 or similar as kernel parameter .

Thanks so much.

doesn't require systemd-automount a systemd initrd?
how does your mkinitcpio.conf looks?

Not sure, but my mkinitcpio.conf is posted in my first post.

Offline

#7 2024-07-31 21:08:22

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,642
Website

Re: /etc/fstab not being obeyed [solved]

The location of the root partition is passed from the bootloader and the kernel applies the default options unless it is over-ridden by /etc/fstab. The auto-generator is only used for the root partition if no location is supplied by the bootloader or kernel command line.

@cryptearth: the OP already shared that config and systemd is not used in their initramfs.


Para todos todo, para nosotros nada

Offline

#8 2024-07-31 21:14:42

bedtime
Member
Registered: 2019-02-12
Posts: 83

Re: /etc/fstab not being obeyed [solved]

Head_on_a_Stick wrote:

The location of the root partition is passed from the bootloader and the kernel applies the default options unless it is over-ridden by /etc/fstab. The auto-generator is only used for the root partition if no location is supplied by the bootloader or kernel command line.

Thanks for the clarification. This makes sense.

Offline

Board footer

Powered by FluxBB