4

I'm trying to setup a folder as a network drive.

I added the following into /etc/fstab:

//192.168.0.150/Files /media/sda1/Files cifs defaults,username=<name>,password=<password>

Then I tried mount -a to mount it (as the tutorial I'm using explained) but I got the following error message:

root@pi:/media/sda1# mount -a
mount: wrong fs type, bad option, bad superblock on //192.168.0.150/Files,
   missing codepage or helper program, or other error
   (for several filesystems (e.g. nfs, cifs) you might
   need a /sbin/mount.<type> helper program)

   In some cases useful info is found in syslog - try
   dmesg | tail or so.
root@pi:/media/sda1#  dmesg | tail
[   43.233536] eth0: no IPv6 routers present
[   56.788933] ip_tables: (C) 2000-2006 Netfilter Core Team
[   59.084915] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[1208037.847633] CIFS VFS: Connecting to DFS root not implemented yet
[1208037.859146] CIFS VFS: cifs_mount failed w/return code = -22
[1208150.427065] Installing knfsd (copyright (C) 1996     okir@monad.swb.de).
[1208223.167024] CIFS VFS: Connecting to DFS root not implemented yet
[1208223.178430] CIFS VFS: cifs_mount failed w/return code = -22
[1208571.347110] CIFS VFS: Connecting to DFS root not implemented yet
[1208571.358562] CIFS VFS: cifs_mount failed w/return code = -22
1

The only package required for a Samba client is cifs-utils.

Instead of putting the password in a publicly-viewable file, I would put it in a place that only the root can view.

/etc/fstab entry:

//192.168.0.150/Files /media/sda1/Files cifs auto,owner,rw,credentials=/root/samba.credentials 0 0

/root/samba.credentials:

username=u
password=p

You can improve this further by putting the Samba host name in /etc/hosts and specify the host name in fstab instead of the IP address.

| improve this answer | |
0

I am not sure you have the smbfs package installed - that will provide the mount.cifs command which will probably be stored in /sbin or /usr/sbin. I'd also recommend "Reading The Fine Manual" i.e. look at the output from man mount.cifs as that points out that leaving the password in the /etc/fstab file is not secure! Also, I hope the line in that file is not literally:

//192.168.0.150/Files /media/sda1/Files cifs defaults,username=<name>,password=<password>

in which the name you specify is "<name>" and the password "<password>" ?

Finally, have you set up your systems so that the server is definately at 192.168.0.150? Many people will direct you to set a static IP address on the Server but a more robust and elegant method to ensure this is to make your DHCP server (often your Broadband Modem/Router) reserve the required IP Address for the relevant MAC for the network interface on the Server that will be used to provide the share...

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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