How to mount a remote folder inside your virtual or dedicated server using FUSE
Mounting a remote folder in CentOS is a great way to access information on a different server. Mounting the folder into your file system will allow you to drag and drop files into the required folder and the information will then be transferred to the remote location. This is especially good if you wanted to run cPanel incremental backups but don’t have a second hard drive.
First we need to add the FUSE repository
yum install epel-release –y
Next, let’s install FUSE
yum install fuse sshfs –y
Then we need to load the FUSE module
modprobe fuse
At this point you can confirm FUSE is running by issuing
lsmod | grep fuse
If all went well you should see a screen like this
Now we need to make sure FUSE is loaded on the next reboot
echo "modprobe fuse" >> /etc/rc.local
That’s FUSE installed to your server now let’s mount a remote folder into your file system
I’m going to mount a folder called “mount” located in the /home partition on a server with the ip address 198.162.2.9. I’m going to mount this in my system as “remote”
sshfs root@198.162.2.9:/home/mount /home/remote
NOTE:- You must create your mount point in your server before issuing the above command. Make sure your already in the location you want the remote folder to be in and issue “mkdir remote” You can also mount a remote folder using a standard linux user which would be more secure than using the root user
Sometime FUSE can get confused and the remote folder is not reachable from your server. If this happens kill the fuse process in your server and unmount the folder using umount -l remote then issue the mount code above again.
Originally appeared at our blog: https://www.first2host.co.uk/how-to-mount-a-remote-folder-inside-your-virtual-or-dedicated-server-using-fuse/#