All Products
Search
Document Center

Object Storage Service:Configure automatic mount on startup

Last Updated:Jan 29, 2026

An OSS bucket that you manually mount to a Linux system is not automatically remounted when the system restarts. To automatically mount an OSS bucket on system startup, modify the /etc/fstab file.

Prerequisites

You have installed ossfs 2.0.6 or a later version, and completed the ossfs 2.0 configuration. If you are using a version of ossfs 2.0 earlier than 2.0.6, upgrade to 2.0.6 or a later version.

Procedure

ossfs 2.0.6 and later versions allow you to configure automatic mount on startup using the /etc/fstab file. After you complete the configuration, the specified OSS bucket is automatically mounted when the Linux system restarts.

  1. Log on to the Linux system. Edit the /etc/fstab file to add the following automatic mount entry, and then save the file.

    Note

    Each automatic mount entry applies to only one bucket. To configure automatic mount for multiple buckets, add a separate mount entry for each bucket.

    bucket_name mount_point ossfs2 _netdev,nofail,x-systemd.after=networkd-dispatcher.service,conf=/root/ossfs2.conf 0 0

    The following table describes the parameters.

    Parameter

    Description

    bucket_name

    The name of the target bucket to mount. Replace this with the actual name of your OSS bucket.

    mount_point

    The local mount folder. Replace this with the actual path of your local mount folder.

    _netdev,nofail,x-systemd.after=networkd-dispatcher.service

    fstab-related parameters. These parameters ensure that the mount operation is executed only after the relevant network services are started. This prevents mount failures caused by network connectivity issues.

    conf=/root/ossfs2.conf

    The absolute path of the ossfs 2.0 configuration file. Replace this with the actual path of your configuration file.

    0 0

    The dump and fsck options for the file system. Set both to 0.

  2. Run the mount -a -t ossfs2 command to automatically mount all ossfs2 file system entries in /etc/fstab. If the command runs without reporting any errors, the configuration is correct.