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
DEVTYPE=partition
ID_VENDOR=SanDisk
ID_MODEL=Cruzer_Mini
ID_REVISION=0.1
ID_SERIAL=SanDisk_Cruzer_Mini_200517395007FC20132F-0:0
ID_SERIAL_SHORT=200517395007FC20132F
ID_TYPE=disk
ID_INSTANCE=0:0
ID_BUS=usb
ID_PATH=pci-0000:00:02.2-usb-0:2.7:1.0-scsi-0:0:0:0
ID_FS_USAGE=filesystem
ID_FS_TYPE=vfat
ID_FS_VERSION=FAT16
ID_FS_UUID=3B69-1AFD
ID_FS_UUID_ENC=3B69-1AFD
ID_FS_LABEL=XMas
ID_FS_LABEL_ENC=XMas
ID_FS_LABEL_SAFE=XMas
Here I just now plugged in a pendrive. To create a unique fstab entry for this, I will use the UUID instead of the device. Some of these options were selected because it is a pendrive.
Code:
UUID=3B69-1AFD /media/xmas vfat rw,noauto,nosuid,nodev,noatime,flush,uid=1000,utf8,shortname=lower 0 0
Another way is to use a username instead:
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
The noauto, and uid and user options work good together. (Come to think of it, using the "owner" option might be even better in this case) The uid= option sets the ownership of the mounted partition, and it's contents. The ownership for vfat and ntfs are set in the fstab options and not using "chown" as you could with a native Linux filesystem.
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
and to /etc/exports:
Code:
cat /etc/exports
/mnt/xmas *.jesnet(fsid=0,ro,root_squash,sync,no_subtree_check)
Now on the client:
Code:
sudo mount /mnt/xmas
root's password:
jschiwal@hpmedia:~> ls -ld /mnt/xmas
drwxrwx--- 2 jschiwal jschiwal 16384 Dec 31 1969 /mnt/xmas
If the pendrive weren't mounted on the server, then trying to mount /mnt/xmas on the client would fail. Also, I didn't change the ownership of /mnt/xmas on the client. Before mounting it's owned by root.
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!
