[*nix Server] Mount FTP space to Debian as local hard drive

Online.net dedicated servers come with 100GB backup spaces that I never use since got the server. I figure I might want to use it as a real backup space somehow. I found CurlFTPFS is a pretty good solution on this.

Do the following you will get additional 100GB HD on your server with decent speed:

Edit/create new file at /root/.netrc

machine FTP.URL.COM
login ftp-user
password ftp-password

Change permission to avoid others seeing your password:

chmod 600 /root/.netrc

look up your id and group information for NON-ROOT user on your server

su NON-ROOT-USER
id

and edit /etc/fstab file, so that every time you reboot, you will get the FTP automatically mounted.

curlftpfs#FTP.URL.COM /mnt/ftp fuse allow_other,uid=1000,gid=1000,umask=0022 0 0

Simply reboot the server, you will see the FTP is mounted on /mnt/ftp folder. If you don’t want to reboot, do

mount -a

you will get it immediately.

Let’s check the I/O speed now:

root@localhost:/mnt/ftp#  dd if=/dev/zero of=test_$$ bs=64k count=16k conv=fdatasync && rm -f test_$$
16384+0 records in
16384+0 records out
1073741824 bytes (1.1 GB) copied, 11.717 s, 91.6 MB/s 

It’s even faster than my local hard drive!

« »

Leave a Reply

Your email address will not be published. Required fields are marked *