'mount' command debug

When I execute:

$ mount /dev/sda   /mnt/sda -t btrfs -o subvol=/,X-mount.mkdir

it works as expected.

However when I put it into the /etc/fstab like this:

/dev/sda   /mnt/sda   btrfs   subvol=/,X-mount.mkdir,noauto   0   0

and then call the mount, it fails:

$ mount /dev/sda /mnt/sda
mount: /mnt/sda: mount point does not exist.
       dmesg(1) may have more information after failed mount system call.

Can anyone please spot what I’m doing wrong ?

I don’t think systemd supports X-mount.mkdir. I believe that may only work with the mount command.

When /dev/sda has the entry you show in fstab, use either mount /dev/sda or mount --target /mnt/sda.

1 Like

Thank you !

For the fstab entry I’ve presented, both of these ways works for me on F39:
mount /dev/sda
mount --target /mnt/sda

The directory is created as expected, which means that this:

wasn’t problem.

I see, your issue was with the mount command syntax. I thought you wanted that fstab entry to work without manually calling mount.

I didn’t read carefully enough.