Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 8621  / 1 Year ago, thu, april 13, 2023, 6:00:39

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


More From » fstab

 Answers
1

And here the essential parts from the documentation:


Mount units may either be configured via unit files, or via /etc/fstab
(see fstab(5) for details). Mounts listed in /etc/fstab will be converted
into native units dynamically at boot and when the configuration of the
system manager is reloaded. In general, configuring mount points through
/etc/fstab is the preferred approach. See systemd-fstab-generator(8) for
details about the conversion.

Further down you'll find this:


Where=

Takes an absolute path of a file or directory for the mount point;
in particular,the destination cannot be a symbolic link. If the
mount point does not exist at the time of mounting, it is created
as directory.

[#2144] Friday, April 14, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
amacal

Total Points: 457
Total Questions: 102
Total Answers: 116

Location: Thailand
Member since Thu, Apr 22, 2021
3 Years ago
amacal questions
Thu, Aug 11, 22, 17:35, 2 Years ago
Sat, Oct 22, 22, 09:15, 2 Years ago
Mon, Aug 16, 21, 07:56, 3 Years ago
;