HostOnNet Blog

Mounting Windows File System on Linux

To mount a windows file system (CIFS/Samba) on Linux, run

mount -t cifs -o username=USER-NAME-HERE,password=PASSWORD-HERE //SERVER-IP-HERE/SHARE-NAME /mnt


mount -t cifs -o username=hostonnet,password=lt0JX7kIcXjqQquj // /mnt

To auto mount file system on boot, add following to /etc/fstab

// /backup cifs  username=hostonnet,password=lt0JX7kIcXjqQquj  0  0

Now run

mount -a

You will see the network drive mounted

[root@ssd ~]# df -h | grep backup
//  500G  7.3G  493G   2% /backup
[root@ssd ~]# 

Common Errors

failed: Key has expired error is due to wrong password or username. Verify your login credentials are correct.

root@backup:~# mount -t cifs -o username=hostonnet,password=superman123 // /mnt
mount: mount // on /mnt failed: Key has expired

Posted in Linux