All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

Use a KFS file system in Linux

Last updated:2021-11-15 20:30:32

This topic describes how to use a KFS file system in Linux.

Connect to a KEC instance

  1. Log in to the Kingsoft Cloud Elastic Compute (KEC) console.
  2. Find the KEC instance to which you want to mount a file system, click Connect Instance in the Operation column, and then enter your username and password.

Mount a KFS file system of the NFS type

1. Start the NFS client

You must install the NFS tool before you mount a file system of the NFS type.

  • In CentOS, run the following command to install the NFS tool:

    sudo yum install nfs-utils 
  • In Ubuntu, run the following command to install the NFS tool:

    sudo apt-get install nfs-common

2. Create the directory to which the file system is mounted

Run the following command:

mkdir <Directory name>

Example:

mkdir /mnt

3. Mount the file system

KFS supports only NFS 3.0. Run the following command to mount the file system. You can view the command on the Details page of the file system.

sudo mount -t nfs -o vers=3,nolock,proto=tcp,noresvport <IP address of the mount target>:/<FSID> <Directory name>
  • Mount target: the IP address that is automatically generated when you create the file system.
  • FSID: the ID of the file system. You can obtain the ID in the mount command that is provided on the Details page of the file system.
  • Directory name: the name of the directory to which the file system is mounted on the KEC instance. You must create the directory before you mount the file system. 3.png

    4. View the mounted file system

    After the file system is mounted, run the mount -l or df -h command to view the mounted file system.

Unmount a file system

To unmount a file system, run the following command:

umount <Directory name>

Example:

umount /mnt

If the "device is busy" message appears, run the fuser -mv <dir> command to query the PIDs of the processes that are accessing the file system, run the kill -9 process PID command to kill the processes, and then unmount the file system again.

Delete a file system

  1. Log in to the KFS console.
  2. Find the file system that you want to delete and click Delete in the Operation column. In the message that appears, click OK.

Note After the file system is deleted, resources cannot be restored. We recommend that you back up your resources before you delete the file system.

On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback