5.3.13. Mounting storage to VPS using CurlFtpFS
Vaults you can connect to VPS and work with them as with regular directories. Data is received and transferred between the VPS and the storage invisibly to the user, as if the contents of the storage are in a directory on the server (only with slower access).
Preparation
- Install on the server CurlFtpFS:
apt install curlftpfsdnf install curlftpfspacman -S curlftpfs - Create a mount directory on the server (after mounting, the contents of the repository will be displayed in it):
mkdir /mnt/storage
Note Instead
/mnt/storageyou can specify any directory on the server.
Mounting
Manual
For a one-time manual mount (not saved when the server is rebooted), use the command:
curlftpfs -o allow_other cdnXX:ftp-password@cdnXX.backup.ukraine.com.ua /mnt/storage
In a team:
cdnXX.backup.ukraine.com.ua— FTP host address your storage./mnt/storage— mount directory (see \"Mounting directory\"). higher).
Automatic
The procedure for configuring automatic mounting (preserved when the server is rebooted):
- In the home directory of the user under which CurlFtpFS will run, create a file
.netrcwith the following content:machine cdnXX.backup.ukraine.com.ua login cdnXX password ftp-password
In the lines:
cdnXX.backup.ukraine.com.ua— FTP host address your storage.
- Set permissions for the created file
600:chmod 600 /path/to/.netrc
In a team:
/path/to/.netrc— — path to the created file.netrc. - Add to file
/etc/fstabline like:curlftpfs#cdnXX.backup.ukraine.com.ua /mnt/storage fuse allow_other,uid=0,gid=0,_netdev 0 0
In line:
cdnXX.backup.ukraine.com.ua— FTP host address your storage./mnt/storage— mount directory (see \"Mounting directory\"). higher).
- Apply the changes without restarting the server:
mount -a
To disable automatic mounting, simply remove the added line from /etc/fstab.
Unmount
To unmount, use the command:
fusermount -u /mnt/storage
In a team: /mnt/storage — mount directory (see \"Mounting directory\"). higher).