NFS mount external drive
Hello
I'm having some trouble NFS mounting a USB external drive. On my server I mount the drive in /etc/fstab as: Quote:
Quote:
I can successfully mount any other location from the server, but not the /media/archive which is a USB external drive. I'm running Debian Etch on both machines. Attempting to mount the same drive from Ubuntu give me the following error: Quote:
|
Could you show "ls -ld /media/archive" on the server.
Also, /etc/exports on the server and /usr/sbin/showmount --exports 192.168.1.2 at the client. You might want to use the "uid=<username>" option in mounting the devices. |
ls -ld /media/archive/
Quote:
Quote:
Quote:
Can you give me an example of using "uid=<username>" option, I'm having a bit of trouble with it? |
For an external drive use the UUID= or LABEL= entry instead of the device node. The device node could easily change for an external drive.
Code:
udevinfo -q env -n /dev/sdb1 Code:
UUID=3B69-1AFD /media/xmas vfat rw,noauto,nosuid,nodev,noatime,flush,uid=1000,utf8,shortname=lower 0 0 Code:
UUID=3B69-1AFD /media/xmas vfat rw,noauto,nosuid,nodev,noatime,flush,user,uid=jschiwal,gid=jschiwal,fmask=117,dmask=007,utf8,shortname=lower 0 0 Using the above fstab entry, a normal user can mount and umount the disk. The ownership and group ownership will be jschiwal.jschiwal and the permissions will be rwxrrx--- on directories and rw-rw--- on files. Because the uuid number is unique, I can have more than one fstab entry, one for each pendrive. Another user could not access it on this computer. (very weak security I know, but still convenient.) User jschiwal can mount it without using sudo. It could even be mounted by a command in ~/profile. On the client (hpmedia.jesnet) I added this to /etc/fstab: Code:
hpamd64.jesnet:/mnt/xmas /mnt/xmas nfs noauto,defaults,soft,_netdev 0 0 On the server (hpamd64.jesnet) I added this to /etc/fstab: Code:
UUID=3B69-1AFD /mnt/xmas vfat rw,noauto,nosuid,nodev,noatime,flush,user,uid=jschiwal,gid=jschiwal,fmask=117,dmask=007,utf8,shortname=lower 0 0 Code:
cat /etc/exports Code:
sudo mount /mnt/xmas One difference is that I didn't use root as the owner, and I used root_squash on the export definition. I assume that in your case a member of user "archive" uses this nfs share for creating backups. I wouldn't recommend using ntfs (or vfat) as the filesystem of choice. Use a native Linux filesystem. While ntfs-3g has read/write support, I wouldn't trust it for something as important as backups. Fat32 has a small filesize limit and isn't very robust. Using /media/ for the drive mount may not be a good idea either on the nfs server. While /media/ is used for external media, since you are offering it up as a share and since you have an entry for it in /etc/fstab, using /media might cause problems due to hald interaction. I'm not certain but would use /mnt/ instead as a precaution. --- I hope I remember to undo all this after posting!:eek: |
Thanks for that, I can mount the drive from a debian client. A number of points though, my device has a blank ID_FS_UUID so I had to stick with /dev/sda1, and the flush option was not recognised (I just removed it).
More frustratingly though, I still have the same error on the Ubuntu client. I run the same command and still get: Quote:
|
I solved the problem on Ubuntu by installing nfs-common. I didn't realise this was required on the client.
jschiwal, thanks for you help and advice! |
Serveral User Problem with remote usb mount
Nice explanation jschiwal!
I just have one little problem with my remote usb-drive. I have two users on the client and one of them can't access the mount because the owner after mounting is the user with uid=1000. I don't understand who sets it to this user? Here a better explanation of the actual condition: Server has user X Client has user Y and Z After mounting the mounted directory has the owner Y and group Y. Z can't access Any idea?? |
All times are GMT -5. The time now is 04:42 PM. |