Mounting file shares on Red Hat Linux
Use these instructions to connect a Red Hat Enterprise Linux®-based IBM Cloud® Compute Instance to a Network File System (NFS) file share.
Before you begin
-
If the file share was set up with Security group access mode, verify that the compute host is part of the same security group as the share. If your file share was set up with VPC access mode, verify that the server where you want to mount the share is in the same zone as the file share. For more information, see Mount target access modes.
-
Confirm that a mount target for the share exists for the VPC where the server is. If a new mount target is needed, follow the instructions in Creating file shares and mount targets.
-
Get the mount path of the file share from the mount target. Mount path information can be obtained from the File share details page in the console, from the CLI, with the API, or Terraform.
-
If you want to use encryption in transit, you need to obtain an IPsec certificate from the metadata service. Make sure that encryption in transit is enabled for the mount target. Plus, mount the file share with a secure connection. This feature is only available for file shares with
dp2
profiles and security group access mode. For more information, see Encryption in transit - Securing mount connections between file share and host.Install and run the mount helper utility to mount file shares with encryption in transit or without an encrypted connection.
File Storage for VPC service requires NFS versions v4.1 or higher.
Implementing no_root_squash
for NFS (optional)
By default, NFS downgrades any files that were created with the root permissions to the nobody
user. This security feature prevents privileges from being shared unless they are requested.
By configuring no_root_squash
, root clients can retain root permissions on the remote NFS file share.
For NFSv4.1, set the nfsv4 domain to: slnfsv4.com
and start rpcidmapd
or a similar service that is used by your OS.
-
From the host, set the domain setting in
/etc/idmapd.conf
.$ vi /etc/idmapd.conf [General] #Verbosity = 0 #The following should be set to the local NFSv4 domain name #The default is the host's DNS domain name. Domain = slnfsv4.com [Mapping] Nobody-User = nobody Nobody-Group = nobody
-
Run
nfsidmap -c
.
Unmounting the file system
To unmount any currently mounted file system on your host, run the umount
command with disk name or mount point name.
umount /dev/sdb
umount /mnt