Fileserver-Unmount drive in use via Samba
I hope this fits in as a "Servers" topic.
I have an external drive (in one of those Thermaltake SATA Docks) connected to a headless Samba file server. The files on the drive are a backup from the night before - a self-serve recovery option if someone does something stupid. I want to create a script that a non computer savvy person will be able to run, to un-mount the drive safely, so that they can replace it with another disk. Then in the middle of the night, if the device labeled "backup" is present, a cron job will mount the new drive and start a script that runs the backup, then will leave the drive mounted for the rest of the next day.
When I have the shared volume in question mounted from another computer when I attempt to un-mount the external hard drive, I get an error message because it is in use by someone over Samba.
Does anyone know how to go about un-mounting the drive safely without stopping Samba? I'm not worried about booting users off the "backup" volume, since the share is read only, but I don't want to boot them off the other Samba shares.
I'm open to criticism of my backup plan too. But I know it's a poor-man's solution, so go easy! I'm not going for an enterprise solution here, just an inexpensive way to improve our current situation - which is no backup. And it has to be EASY otherwise no one will do it! I'm backing up about 1.5TB of multimedia data for a Record Company that I work for.
# umount /mnt/backup
umount: /mnt/backup: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
Thanks, much obliged!!