3

I want to disable mount mentioned in /etc/filesystems. (By disabling I mean set the mount option to false).

I heard, that the /etc/filesystems file, should not be edited directly, so I don't want to edit it using vim or other editor.

Is there any command I could use for this ? (I found that command chnfsmnt might help me with that, but I am not sure how to construct it to change the mount parameter to false).

1 Answer 1

4

Eventually I solved this using smitty tool. (Specifically smitty nfs, as I wanted to remove NFS filesystem).

Alternatively, you can use the underlying chnfsmount command with the -a option, which:

specifies that it should not be automatically mounted at system restart

smitty nfs - "Change / Show Attributes of an NFS File System" uses chnfsmount under the covers to execute the changes from smitty. To use it, you have to specify the remote NFS mount with three options:

  • -f PathName
  • -d RemoteDirectory
  • -h RemoteHost

... followed by the change you want.

To disable the mounting of remote-host:/remote-directory to /local-mount-point, you would run:

chnfsmnt -f /local-mount-point -d /remote-directory -h remote-host -a

... which is the same as editing /etc/filesystems to change the "mount" flag to "false" for that filesystem.

3
  • 1
    Smitty is a wrapper but you can display command(s) it executes. It would be nice if you could post them here as part of answer. Commented Dec 27, 2021 at 18:32
  • 1
    @MariuszZieliński I've added the underlying command (example) as an update. It's not an exact mirror of a smitty nfs ... sequence, since the smitty screen captures all of the arguments, even the ones that aren't changing, but it should do the job.
    – Jeff Schaller
    Commented Jan 5, 2022 at 18:25
  • Thanks for the elaboration. Commented Jan 5, 2022 at 20:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .