0

I'm trying to mount some network drives to my Raspberry Pi.
I have added a line for each in to the /etc/fstab file that look like this:
//10.0.1.2/TV\040Shows /home/pi/NetworkDriveS/TV cifs username=USERNAME,password=PASSWORD,uid=1000,gid=1000,iocharset=utf8 0 0\

The drives are in a PC running Windows 10 and are shared. 10.0.1.2 is the IP address of the Windows machine. TV Shows is the share name of one of the drives. Obviously I'm using the actual username and password, I changed them here for security.

When I attempt mounting the drives with "sudo mount -a" I get the output "[mntent]: line 6 in /etc/fstab is bad" for each line added to mount a drive.

Can anyone help with this one?

2 Answers 2

2

I would suggest:

  1. Test you can mount the device from a mount command without using the fstab file, e.g:

    mount -t cifs -o username=USERNAME,password=PASSWORD //10.0.1.2/TV\ Shows /mnt

  2. Swap the ASCII code for space for "\". For example, //10.0.1.2/TV\ Shows

  3. Remove the trailing backslash at the end of the line.
  4. It is slightly more secure to put the credentials in a file. For example,

    //192.168.0.16/someuser /home/someuser cifs credentials=/etc/cifs-credentials/someuser 0 0

where the credentials directory and file is only readable by root, rather than any account attached to the machine.

1
  • Got it to work with this: //10.0.1.2/Torrents /home/pi/NetworkDrives/Torrents cifs username=user,password=pw 0 0 Except to time capsule which needed: //10.0.1.1/Network\040Storage /home/pi/NetworkDrives/NetworkStorage cifs username=user,password=pw,rw,uid=1000,iocharset=utf8,sec=ntlm 0 0 Thank you for your help.
    – Meph88
    Sep 16, 2015 at 13:53
2

Got it to work with this:
//10.0.1.2/Torrents /home/pi/NetworkDrives/Torrents cifs username=user,password=pw 0 0 Except to time capsule which needed: //10.0.1.1/Network\040Storage /home/pi/NetworkDrives/NetworkStorage cifs username=user,password=pw,rw,uid=1000,iocharset=utf8,sec=ntlm 0 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.