Map Linux Network Drive With SHFS Module
When the Linux servers are running low of disk space, you may want to add additional hard disks. But, the limited SCSI or SATA hard disk I/O connectors are all fully used up. For non-critical application or quick solution, it’s possible to temporarily increase Linux free disk space with an USB to SATA converter, external SATA connector, or mount a remote Linux file system as network drive!
Though there are many ways create a Linux network drive, I would like to document the Secure Shell FileSystem (shfs) approach.
As suggest by SHFS tagline “Mount ANY dir from ANY host in a SECURE way”, you don’t have to setup a Samba server and explicitly create shared resources, only a workable SSH server will do the job!
SHFS is a lightweight Linux kernel module (similar to smbfs, ftpfs or ncpfs) used to securely mount remote folders or filesystems as Linux network drive via SSH protocol! Other than providing SSH security feature, shfs also supports persistent connection and file cache data structure to speed up I/O performance.
How to compile and setup SHFS or Secure Shell FileSystem?
This guide is tested on Red Hat Linux 9
How to use SHFS to mount a remote folder or filesystem as Linux network drive?
To mount or map /tmp folder at walkernews host (via walker Linux login ID) as the local Linux network drive, execute
To create persistent Linux network drive with SHFS, execute
To preserve UID/GID of remote file creation:
To display Linux kernel debugging output (verbose mode):
P/S: Visit official site for more SHFS installation or usage guide.

As suggest by SHFS tagline “Mount ANY dir from ANY host in a SECURE way”, you don’t have to setup a Samba server and explicitly create shared resources, only a workable SSH server will do the job!
SHFS is a lightweight Linux kernel module (similar to smbfs, ftpfs or ncpfs) used to securely mount remote folders or filesystems as Linux network drive via SSH protocol! Other than providing SSH security feature, shfs also supports persistent connection and file cache data structure to speed up I/O performance.
How to compile and setup SHFS or Secure Shell FileSystem?
This guide is tested on Red Hat Linux 9
- Download SHFS v0.35 source code (latest version at official site),
- Execute
tar -zxvf shfs-0.35.tar.gzto uncompress (untar) the gzipped tarball,
- Execute
cd shfs-0.35to change directory to the untar folder,
- Execute
maketo compile the SHFS source code with GCC compiler (the same GCC compiler that compile the host kernel),
- Execute
cd shfs/Linux-2.xto change directory to shfs sub-folder, where the Linux-2.x is the host kernel version (i.e.uname -r),
- Execute
insmod shfs.oto install the SHFS kernel module,
- Execute
make installto install the compiled SHFS program and library files to system path, create symlink /sbin/mount.shfs to shfsmount, etc. You can also executemake uninstallif you want to uninstall them accordingly.
How to use SHFS to mount a remote folder or filesystem as Linux network drive?
To mount or map /tmp folder at walkernews host (via walker Linux login ID) as the local Linux network drive, execute
shfsmount walker@walkernews:/tmp /mnt/shfsTo create persistent Linux network drive with SHFS, execute
shfsmount --persistent walker@walkernews:/tmp /mnt/shfsTo preserve UID/GID of remote file creation:
shfsmount root@walkernews /mnt/shfs -o preserve,rmode=755To display Linux kernel debugging output (verbose mode):
shfsmount -vvv walker@walkernews:/tmp /mnt/shfsP/S: Visit official site for more SHFS installation or usage guide.
Custom Search








2010 •
[...] just mount the network share first before mounting the CD ISO image – refers to earlier post on [ How to mount or map a network drive in Linux? [...]
[...] few thousands of tiny files, either to transfer it over the network (via scp command, ftp protocol, shfs system, samba file sharing, etc) or copy between local filesystem, as there is less overheat of [...]