Reviving this old thread because it's the only one that described my exact problem: newer distros are beginning to default to 'cifs' and might not include the 'smbfs' package by default, which could change the expected behavior of the 'mount' command when mounting password-protected SMB shares. I ran into the problem using Ubuntu 8.04 (Hardy) and 8.10 (Intrepid) LiveCDs, but the information below should apply equally well to any new-ish distribution for which 'cifs' is being implemented as a replacement for 'smbfs'/'smbmount'.
A "vanilla" installation of Ubuntu 8.04/8.10 (Desktop i386) includes no '
smbmount' command, no '
/sbin/mount.cifs' (although, confusingly, the
man page is installed), and instead appears to rely on the 'cifs' loadable module to provide the capability of mounting SMB/CIFS shares via a kernel facility. This is similar to other network filesystems such as NFS, which are built into the kernel or loaded via modules and do not have their own mount.
whatever command.
Some of the changes in switching over to 'cifs' are very subtle from a user perspective, like the meaning of the 'user' command (traditionally = "allow an ordinary user to mount the filesystem"; permitted by newer mount.cifs as a synonym for "username", as in "-ousername=myname").
Of note, the 'cifs' kernel module does not appear to allow prompting for a share password interactively at the command-line, as with smbmount/mount.cifs. It seems you must pass it explicitly on the command-line using the '-o password=' option. (This has always worried me because then your password ends up in your ".bash_history" file, but I guess that's no worse than using a 'credentials' file when you think about it, as both contain the plaintext passwords but neither is world-readable.)
The CIFS kernel module should be loaded dynamically as needed (perhaps when you give a 'mount -t cifs' command for the first time), but you can check to see that it is by typing:
Code:
$ cat /proc/filesystems
and looking for
in the output.
I was familiar with the options for 'smbmount' (or 'mount -t smbfs'), having used it many times on old
RIPLinux and
KNOPPIX boot CDs to mount shares on a NAS for system backups using GNU '
partimage'.
So when I booted up an Ubuntu 8.10 LiveCD, I expected
Code:
mount -t cifs //servername/sharename /local/mount/point -ousername=myname
to prompt me for a password; instead I got the same confusing error as the above poster:
Code:
mount: block device //servername/sharename is write-protected, mounting read-only
mount: cannot mount block device //servername/sharename read-only
I found two solutions: you can either (1) install the 'smbfs' package (yes--possible with the Live CD as long as you're connected to the Internet) to get an actual '/sbin/mount.cifs' which knows how to prompt for a password,
and supports all the expected options from the man page, or (2) specify the password directly in the 'mount' command using the '-o password=' option as below:
Code:
mount -t cifs //servername/sharename /local/mount/point -o username=myname,password=supersecret
After checking all the permissions on my NAS share (and
almost giving up and going back to trusty KNOPPIX), I started poking around on the filesystem of the Ubuntu Intrepid LiveCD and noted there was no 'mount.cifs' or 'smbmount'. This started me searching the web to figure out what the heck was going on. As there was no user-space program to prompt for a password (CIFS being loaded into the kernel instead), it almost makes sense that you'd have to specify the password as an option to 'mount -t cifs'. But it took a loooong time for me to finally figure this out.
