[20230322]mount systemd.txt
--//别人的系统每次重启机器发现本地的一个ISO映象文件总是mount 到/mnt/iso目录。而检查/etc/fstab文件这项mount并不存在。
--//我记忆里好像看过systemdctl可以管理mount选项,这样/etc/fstab可以不存在。
--//找到如下链接:
https://www.thegeeksearch.com/how-to-manage-order-of-mounting-in-centos-rhel-78-using-systemd/
--//实际上我猜测mount上后,在/run/systemd/generator/就存在这项.然后cp到/etc/systemd/system/目录.
--//我当时移动/etc/systemd/system/下对应文件到另外的地方,无法继续测试.在自己管理的服务器上查看如下:
# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Nov 10 19:36:09 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=67a1c5a7-1875-4fb4-a49f-54db7e5bff2c / xfs defaults 0 0
UUID=4d847c59-3180-4a5d-b813-5c691d04968f /u01 xfs defaults 0 0
UUID=9f6761e1-d91e-4354-af11-82c094ffa0da swap swap defaults 0 0
UUID=dea6f8c9-e39e-46a5-b409-b7a8c14e1d8b /u02 ext4 defaults 0 0
# ls -lR /run/systemd/generator
/run/systemd/generator:
total 16
-rw-r--r--. 1 root root 209 2022-10-26 09:49:39 dev-disk-by\x2duuid-9f6761e1\x2dd91e\x2d4354\x2daf11\x2d82c094ffa0da.swap
drwxr-xr-x. 2 root root 100 2022-10-26 09:49:39 local-fs.target.requires
-rw-r--r--. 1 root root 250 2022-10-26 09:49:39 -.mount
drwxr-xr-x. 2 root root 60 2022-10-26 09:49:39 swap.target.requires
-rw-r--r--. 1 root root 253 2022-10-26 09:49:39 u01.mount
-rw-r--r--. 1 root root 254 2022-10-26 09:49:39 u02.mount
/run/systemd/generator/local-fs.target.requires:
total 0
lrwxrwxrwx. 1 root root 30 2022-10-26 09:49:39 -.mount -> /run/systemd/generator/-.mount
lrwxrwxrwx. 1 root root 32 2022-10-26 09:49:39 u01.mount -> /run/systemd/generator/u01.mount
lrwxrwxrwx. 1 root root 32 2022-10-26 09:49:39 u02.mount -> /run/systemd/generator/u02.mount
/run/systemd/generator/swap.target.requires:
total 0
lrwxrwxrwx. 1 root root 96 2022-10-26 09:49:39 dev-disk-by\x2duuid-9f6761e1\x2dd91e\x2d4354\x2daf11\x2d82c094ffa0da.swap -> /run/systemd/generator/dev-disk-by\x2duuid-9f6761e1\x2dd91e\x2d4354\x2daf11\x2d82c094ffa0da.swap
--//看看"-.mount"文件,实际上这个对应的是/.使用-代替.
# cat -- '-.mount'
# Automatically generated by systemd-fstab-generator
[Unit]
SourcePath=/etc/fstab
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
Before=local-fs.target
[Mount]
What=/dev/disk/by-uuid/67a1c5a7-1875-4fb4-a49f-54db7e5bff2c
Where=/
Type=xfs
--//说句老是话,我到现在还无法适应systemctl管理启动服务.不知道自己是否老了,对应新的知识接收比较慢.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-2941144/ ,如需转载,请注明出处,否则将追究法律责任。