I'm trying to mount rpc_pipefs with a nodev option. Initially, I tried doing this by editing the /etc/fstab file and adding an entry for it.
Tried:
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,nodev,relatime 0 0
Also:
rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw,nodev,relatime 0 0
Both failed to work. (no errors reported but the changes would not take after running mount -a or rebooting)
This is when I did more reading/research and discovered that the file was being mounted using systemd.
I can add the desired mount option by editing the /usr/lib/systemd/system/var-lib-nfs-rpc_pipefs.mount
file and adding the following:
Options=nodev
When I run the following, the partition/fs is mounted with the nodev option. However, It does not survive a reboot.
[~] systemctl daemon-reload
[~] systemctl restart var-lib-nfs-rpc_pipefs.mount
[~] systemctl enable var-lib-nfs-rpc_pipefs.mount
Also tried appending the following to the mount file but it made no difference:
[Install]
WantedBy=local-fs.target
Environment:
[user@ip-10-0-0-0 ~]$ cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[user@ip-10-0-0-0 ~]$ uname -r
3.10.0-862.14.4.el7.x86_64
[user@ip-10-0-0-0 ~]$