All the details aren't necessary for my question, but here's a summary:
A couple of lines in my fstab look like this:
# External USB hard drive 1
UUID=41554152-a2ad-43f7-ada8-6acae4705b75 /var/backup ext2
rw,auto,exec,sync 0 2
# NFS mount for access to snapshot backups
localhost:/var/backup/protected/snapshot/ /var/backup/snapshot/ nfs
ro 0 0
/var/backup/protected is the root of all the backup files, where
rsnapshot puts all its stuff. This directory is owned and only usable
by root. All the subdirectories, though (daily, weekly, etc), use the
typical file perms of 755, and then any actual backed-up files preserve
whatever permissions they had to start with.
/var/backup/snapshot is mounted read-only by nfs, and lets me look into
all the backup directories and read whatever I have permission to read.
The idea is that only root can modify the backup files, and any regular
user of the system can read (i.e. "restore") any file that the user
could normally read.
So with all that, here's my question: When I unmount the USB drive
("umount /var/backup") I get an error that the filesystem is busy or in
use, with a recommendation to try lsof or fuser to discover which
processes are currently hanging on. It turns out those didn't help, and
the culprit was the nfs daemon. I had unmounted the NFS directory
(/var/backup/snapshot) before trying to unmount the USB drive, but that
wasn't good enough. The only thing that freed up the drive was
restarting the nfs daemon.
I have a feeling, though, that there ought to be a cleaner or easier way
of releasing the USB drive so it can be gracefully unmounted without
having to restart nfs, since that seems kinda extreme to me. Restarting
NFS is something I can do, and it works, but I don't know much at all
about NFS so I'm curious if there's a better way.
Anyone have any ideas?
- Aaron
--
Aaron Brown :: aa...@thebrownproject.com :: www.thebrownproject.com
To release the /var/backup dir, try
"exportfs -u /var/backup"
When the usb storage is back, and you're ready to share it again,
"exportfs -a"
man exportfs will give you better information
You might also want to consider autofs.