Mount a windows filesystem or network share in Linux

Mount a windows filesystem or network share in Linux

Mount a windows filesystem or network share in Linux 150 150 Roderick Derks

Overview of some linux commands to mount a Windows filesystem or a cifs share (Windows protocol).
Also information about how to install a ntfs driver if this isn't supported yet by your kernel.

Mount a Windows share
# mkdir /mnt/dir
# mount -t cifs //servername/dir /mnt/dir -o user=nobody,password=nobody

-> cifs is the followup protocol of smb

# vi /etc/fstab
   //servername/dir /mnt/dir      cifs    rw,user=username,password=secret_password  0 0

Mount a Windows NTFS filesystem

Mounted NTFS filesystems in linux at this time are read only. 

# mount -t ntfs /dev/sda2 /mnt/ntfs
# dmesg |grep ntfs

If you get the error message that ntfs is not recognized then you probably need to load the ntfs driver. Fedora for example doesn't support mounting ntfs by default.

# modprobe ntfs

You can download the driver here (rpm package). Check for the right processor and kernel version. Every kernelupdate needs a corresponding ntfs driver version update.

# rpm -ihv kernel-module-ntfs-2.6.15-1.2054_FC5-2.1.26-0.rr.10.0.i686.rpm
# modprobe ntfs

This seems to be working to:
# yum -y kernel-module-ntfs

If you want tomount the filesystem at boot time:
# vi /etc/fstab
   /dev/hda1 /mnt/hda1 ntfs    ro,defaults,umask=0222 0 0

Remove the driver rpm package:
# rpm -qa|grep -i ntfs
# rpm -e kernel-module-ntfs-2.6.15-1.2054_FC5-2.1.26-0.rr.10.0.i686.rpm

Roderick Derks

Liefhebber van fietsen, van het oplossen van IT puzzels, en van het delen van informatie om anderen te helpen.

All stories by:Roderick Derks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Your Name (required)

Your Email (required)

Subject

Your Message

Your Name (required)

Your Email (required)

Subject

Your Message