[Dirvish] dirvish and an lv snapshot

Eric Searcy emsearcy at gmail.com
Wed Aug 11 23:03:41 UTC 2010


On Aug 5, 2010, at 2:21 PM, Jenny Hopkins wrote:

> Hullo again,
> 
> I thought I'd post my solution to this.
> 
> With more debugging, I found that the problem was that the lvsnapshot
> said it couldn't unmount the lvm snapshot and delete it, because the
> mount was 'busy
> 
> Instead of running the unmount command as a post-client script, I
> moved it to run as a post-server script, and this fixed the problem.
> It could be that the pre-client and post-client scripts are copied to
> the mount point to run, but then the post-client script won't unmount
> as it is itself running from the directory it is trying to unmount.
> Does this make sense?

Was curious about that too ... I have a hypothesis though.  Found this in the man page:

post-client: shell_command (S)
post-server: shell_command (S)
[trim]
The  current  directory  will  be DIRVISH_SRC on the client and DIRVISH_DEST on the server

Of course, you're doing a local backup so the client and server are the same host.  But since the post-client client script had its $PWD in the mounted snapshot, that made the mount busy.  The post-server script runs on the same box, but now with a $PWD in the dirvish vault, so the mount point is free.

Similarly, a "post-client"-ran lvsnapshot.sh script could be modified to change its cwd outside the mountpoint before it tries to umount.  This would be necessary if you really were backing up a remote host, because then post-server wouldn't be able to do your filesystem (u)mounting, it would have to be a client script. (And if changing the cwd of the lvsnapshot script doesn't free up the mount point, you could try running "lsof" inside the script just prior to the umount to see what *does* have the mount point busy.)

Eric


More information about the Dirvish mailing list