ubuntu at knutejohnson.com
Thu Aug 2 15:45:37 UTC 2012
On 8/2/2012 8:12 AM, Alexander Skwar wrote:
> On Thu, Aug 2, 2012 at 5:00 PM, Knute Johnson <ubuntu at knutejohnson.com
> <mailto:ubuntu at knutejohnson.com>> wrote:
> The reason I ask is that I have a jump drive backup that I mount to
> back up to and can't have mounted when I do the fsck on it once a month.
> Well, in that case, I'd write the fsck script in such a way, that either
> aborts if the filesystem is mounted or that it waits until filesystem
> got unmounted.
> # Check out /dev/disk/by-id for this
> while mount | grep $( readlink -f "$jump_drive_id_dev" ); do
> # jump drive is still mounted
> # wait a bit
> sleep 42
> # or abort
> # exit 1
> # jump drive is not mounted
> fsck "$jump_drive_id_dev"
> # Done
> exit $?
> # EOF
> Or something like that…
Thanks very much.
More information about the ubuntu-users