1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Unmanaged Cloud server: mounting the volume for data storage
By default, unmanaged Cloud Servers are supplied with two volumes:
- 1 volume for the operating system of your choice (/dev/vda)
- 1 volume for storing your data (/dev /vdb)
The volume for data storage (/dev/vdb) must be formatted, then mounted by the client.
1. SSH commands to format the storage volume
If you choose XFS for example, it is necessary to install the appropriate tools (if they are not yet installed):
sudo apt install xfsprogs
Then it is necessary to format the volume using the following SSH command:
sudo mkfs.xfs -f /dev/vdb
And if you choose EXT4:
sudo mkfs.ext4 /dev/vdb
If necessary, you can format the volume with a different file system supported by your distribution.
2. Mounting the storage volume
mkdir /mnt/home
mount /dev/vdb /mnt/home
rsync -rlptgoDHAX /home/ /mnt/home/
umount /mnt/home
mount /dev/vdb /home
rmdir /mnt/home
What that means in order:
- you create a temporary folder
- you mount the volume on the temporary folder
- you copy the contents of the original "/home" folder to the root of the volume keeping the same rights, owner, group, etc.(warning: you might need to install the "rsync" bundle depending on the Linux distribution chosen)
- you dismount the volume from the temporary folder
- you mount the volume on the "/home" folder
- you delete the temporary folder
This way you should be able to mount the volume on "/home" while keeping the initial configuration which is installed. We recommend that you create a password for "root" in any case so that you do not lose your way if you should make a mistake. The password can be removed afterwards.
Alternative solution: not mounting in "/home"...
This is a standard place to mount the data volume because it is generally in "/home" that users will work and particularly store their data. A user without special rights will usually be limited to their "/home/user" directory. It is possible to indicate another default directory for a user (but the configuration will no longer be "standard").
Another alternative solution: Automatically mounting the volume on startup
A mount does not effectively withstand a restart. If you do not want to make the change permanent, you can add your volume to the file "/etc/fstab". Debian documents about this:https://wiki.debian.org/fr/fstab
3. SSH commands for mounting the storage volume
sudo mount /dev/vdb point_de_montage
Help for the SSH connection
For example, to mount the data volume in the /home folder of your Cloud server, the command to perform is the following:
sudo mount /dev/vdb /home