As mentioned here, "you must create the mount point before you mount the partition." But after adding the following lines in fstab and rebooting the system
/dev/sdxy /media/user/hdd_mount_point ext4 defaults 0 0
tmpfs /mnt/tmpfs_mount_point tmpfs rw,nosuid,noatime,nodev,size=4G,mode=1777 0 0
the mount points (target directories) hdd_mount_point
and tmpfs_mount_point
are automatically created if they do not exist. I know that you can make a mount point if it does not exist by adding the X-mount.mkdir
option to mount
command as mentioned in its manual page, but I really like to know if this option is implicitly used when mounting file systems via fstab.
And NO, it is not a duplicate of Automatic Adding of Filesystems to /etc/fstab
This used to be true, and still is if you wish to use the classic
mount
command.In recent years, the entries in
/etc/fstab
are mounted at boot time by systemd, which automatically creates missing mountpoints as needed, irrespective of the presence of theX-mount.mkdir
option.It also provides the command
systemd-mount
as an alternative tomount
, should you wish to mount a partition yourself without first manually creating a directory to mount over.And here the essential parts from the documentation:
Further down you'll find this: