Skip to Content
Operation GuideMount file systemAutomatically Mounting File Systems

Automatically Mounting File Systems

Method 1: Configure the /etc/fstab file to set up automatic mounting

Step 1: Install the client

For client installation steps, refer to “UPFS Client Installation”.

Step 2: Configure automatic mounting on boot

Edit the /etc/fstab file and add the following configuration:

<mount_address1>,<mount_address2>/<resource_id> /path/to/mount upfs _netdev 0 0

Example:

10.72.141.213:10109,10.72.141.215:10109/upfs /upfs_data upfs _netdev 0 0
Command Line FieldExplanation
<mount_address1>,<mount_address2>/<resource_id>The file system URL obtained from the Genesis Cloud console page. (For detailed rules of the URL, see the file system URL part in the main concepts)
/path/to/mountThe local path to be mounted. Ensure that this directory is not mounted by other file systems
upfsIndicates that the type of the file system to be mounted is upfs
_netdevFile system mounting option. Because it is a network file system, _netdev needs to be added. ro, rw are also supported
The first 0Indicates whether the file system will be backed up by the dump tool. Please keep the configuration as 0
The second 0Indicates whether the file system will be checked by the fsck command. Please keep the configuration as 0

Step 3: Check the mounting status

After configuring the file, execute the command mount -a to check the mounting status.

img

Method 2: Use systemd.mount to realize automatic mounting

Step 1

Install the client with reference to Method 1.

Step 2: Configure the file

Create the file /etc/systemd/system/upfs_data.mount and add the following content:

[Unit] Description=Mount upfs at boot [Mount] What=10.72.141.213:10109,10.72.141.215:10109/upfs Where=/upfs_data Type=upfs Options=_netdev TimeoutSec=30 [Install] WantedBy=multi-user.target

Note: The name of the mount unit must be named according to the path of the file system mount point it encapsulates. For example, the unit name corresponding to the automatic mount point /mnt/upfs must be mnt-upfs.mount.

Explanation of some fields:

FieldExplanation
WhatThe file system URL obtained from the UCloud console page
WhereThe local path to be mounted. Ensure that this directory is not mounted by other file systems
TypeIndicates that the type of the mounted file system is upfs
OptionsFile system mounting options. Since it is a network file system, _netdev needs to be added
TimeoutSecSpecifies the timeout for the mount operation, in seconds
WantedBy=multi-user.targetSpecifies under which target this service unit should be started. multi-user.target means starting this service in multi-user mode

Automatic mounting commands:

systemctl enable upfs_data.mount systemctl start upfs_data.mount

If there is a problem with automatically mounting the file system, please contact Genesis Cloud technical support in a timely manner.