Mounting drives in Debian linux

This guide will cover mounting drives for your htpc media server: samba shares on windows machines and local ntfs formatted hard drives connected via usb to your box running Debian.


This is for mounting a network drive samba share. This can be a drive or folder shared on a Windows machine you want to access from Debian.

First make sure cifs-utils is installed

sudo apt-get install cifs-utils

Now make sure you can access the samba share

smbclient \\\\remotemachinenameorip\\sharename -U usernameonwindowsmachine passwordonwindowsmachine

If you did not get an error all is well try and list the folder’s contents


Now create the mount point, in linux you create a folder that you want to act as a symbolic link for the network drive

mkdir /path/of/folder/on/linux

Now we mount the network drive, remember your network drives are case sensitive

mount –t cifs //networkip/share /local/linux/folder –o username=usernameonwindowsmachine,password=passwordforwindowsmachine

Make this network drive automount on boot

Fire up WInSCP, browse to and open /etc/fstab and add the following line

//networkip/share /local/linux/foldermountpoint cifs defaults,username=usernameonwindows,password=passwordonwindows 0 0

Make sure you press enter after pasting this line or you will get an error on boot

NTFS Local Drive

Make sure you have ntfs-3g installed

sudo apt-get install ntfs-3g

Now determine the sda path of the usb drive.

Plug in the usb drive and you will see some messages on the debian box

[ xxx.xxxx] sdc 3:0:0:0: [sdc] Assuming drive cache: write through

[ xxx.xxxx] sdc 3:0:0:0: [sdc] No Caching mode page found

At this point it is safe to assume that the drive is sdc1 (but see below)

Create a mount point to act as a symbolic link for the drive

mkdir /place/to/mount

Mount the drive, sdc1 should be replaced with the sdx you found when you plugged in the drive

mount -t ntfs-3g /dev/sdc1 /place/to/mount

Now you can make it automount on boot

Fire up WInSCP, browse to and open /etc/fstab and add the following line

/dev/sdc1 /place/to/mount ntfs-3g rw,uid=1000,gid=1000,dmask=0002,fmask=0003 0 0

If on reboot the drive fails to mount it may be because linux assigned it a different letter when it was plugged in.

Since you will probably be keeping this drive plugged in at boot, you can go to the /dev folder and find how linux is assigning it

cd /dev/ && ls

You will get a screen like this. sda is used for the primary hard drive so look for the first sdb or sdc that is unassigned. Here it is sdb1.

Go back and edit /etc/fstab and change the sdx1 to the correct identifier you just found.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s