5

I'm trying to mount Windows 2000 shared folder on Ubuntu in an effort to get Read/Write capabilities. Any advice?

I've verified that the user credentials have writable permissions from a windows machine.

update

    `sudo mount -t cifs -o username=web,password= //192.168.15.10/Web /dev/fileserver`
//mounts as read-only
Ben
  • 3,800
  • 18
  • 65
  • 96
  • Do you have the error messages backwards? – David Oct 20 '10 at 20:39
  • This doesn't even begin to make sense... are you doing this over a network or not? If it's over a network, then CIFS is the protocol to use, but doing so wouldn't return an "ntfs-3g" error. The last parameter to mount should be an empty directory to mount into, not a device name. – DerfK Oct 20 '10 at 20:42
  • Sorry DerfK, you're right. I've updated the command. `/dev/fileserver` is an empty directory – Ben Oct 20 '10 at 20:49

3 Answers3

8

For network windows shares you need to specify the uid/gid that the drive should be mounted as and/or the file and directory modes to use since Windows doesn't understand Unix users and Linux doesn't understand Windows users or permissions. Right now, the share is probably writable but everything is owned by root so no other user can do anything.

Try:

mount -t cifs -o username=winuser,rw,uid=linuxuser,gid=linuxgroup //192.168.15.10/Web /dev/fileserver

Where linuxuser and linuxgroup are both your username in Ubuntu. If you need to make the windows share writable to everyone, then you can use ,dir_mode=0777,file_mode=0666 instead of uid= and gid=. If you need some people to have access and others not to, then you can combine both of them:

mount -t cifs -o username=winuser,rw,gid=somegroup,dir_mode=0775,file_mode=0664 //192.168.15.10/Web /dev/fileserver

which will give write access to all members of somegroup but everyone else will only have read access.

DerfK
  • 19,493
  • 2
  • 38
  • 54
  • Sweet, thanks! fStab looks a bit different than a simple `mount`. Is that the right location to mount this on bootup? – Ben Oct 21 '10 at 13:58
  • 1
    I'd suggest against trying to mount network partitions during boot, depending on your network (are you on wireless?) your internet connection might not be ready when the system is trying to mount the drive, which could lead to Bad Things (or at least a very long boot time while the mount times out). Instead, add it to fstab with the `noauto,user` options added, which will tell it not to mount on boot, but give permission for regular users to mount it using `mount /dev/fileserver`. The `user` option also sets up permissions suitable for the user running the command, at least on vfat. – DerfK Oct 22 '10 at 01:56
  • On 12.04 I had to add a `,nounix` option before my mount would be world read/write. – CatShoes Aug 22 '13 at 13:25
0

Your order of operations appears to be wrong. It should read:

mount -t [type] [-o mount options] [mount source] [mount destination]
mount -t cifs -o username=user,rw //192.168.15.10/web /dev/fileserver

You will be asked for your password. That should get the volume mounted.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300