I recently started using systemd in linux. On systemd mount, I have some observations:
- mount unit file is generated with mount point name when there is an entry in /etc/fstab.
I also observed the two scenarios listed below:
Precondition: I have below entry in fstab:
/dev/sda3 /test_mount ext4 rw,acl,nobarrier,nodelalloc 0 0
(So test_mount.mount file is generated under /var/run/systemd/generator/ directory after reboot.)
Scenario 1: I deleted the entry from fstab and rebooted the machine. My expectation is test_mount.mount file should be deleted from /var/run/systemd/generator/ directory. But the file is not deleted and systemd is attempting to mount the device node.
Scenario 2: I modified the entry in fstab. I renamed the mountpoint to sec_test_mount and rebooted the machine. My expectation is test_mount.mount file should be deleted from /var/run/systemd/generator/ directory and sec_test_mount.mount file should be newly created. sec_test_mount.mount is newly created but test_mount.mount is not deleted. Both the mount files are trying to mount and mount has happened twice.