Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

(Apologies in advance for giving so few details below, but trust me that the set-up and the problem I'm dealing with are truly baroque, and even a superficial description would result in a far lengthier and complicated post than any of you would want to read!)

I'm trying to back up a disk that has been acting very strangely lately, but my back-up attempts fail after a few minutes, because the disk's file system (at /dev/disk4) "spontaneously" unmounts. (I doubt this unmounting is literally "spontaneous", but to my ignorance it looks that way.)

I would like to "lock" the mount, so to speak, so that no other process can unmount it (other than something like umount /dev/disk4 issued by me). Is there a way to achieve such a lock?

(The flavor of Unix I'm dealing with happens to be OS X, but I am interested in, say Linux-specific solutions too, since they may provide useful keyword for further Googling. Also solutions for any other BSD-ish flavor of Unix would be welcome.)

(It goes without saying that I am interested only in locking schemes that do not prevent me from backing up the disk!)

If there is no way to "lock the mount"

how can I determine why the unmounting is happening?

Thanks!

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

If the mount is busy it shouldn't be able to unmount*.

An easy way to make a mount busy is to have at least one process with its CWD under the mount point.


*Lazy unmounts will still return but it shouldn't actually unmount until the filesystem is no longer busy.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.