[PLUG] Mount annoyances

Keith Lofstrom keithl at kl-ic.com
Sun Jan 21 00:39:28 UTC 2007


On Fri, Jan 19, 2007 at 07:06:37PM -0800, John Jason Jordan wrote:
> I am forever forgetting to mount an external disk before copying or
> moving files to it. Of course, then Linux just copies the files to the
> mount point folder. Then I have to go in, delete them, mount the drive,
> and do the operation over again. Much worse, what if I never realize I
> failed to mount the drive and, thinking I have saved the files, unmount
> the drive and put it away thinking I now have a safe backup?
> 
> The part that is annoying is that Linux will copy the files to the
> mount point. Is there a way to make it never do that? Like, if there is
> no drive actually mounted at the mount point, give me an error message
> when I try to move or copy files there?
> 
> If you haven't already guessed, this just happened again tonight. For
> the eleventy-eleventh time. 

One way to do this is to wrap the mount in a script that renames the
mount point just before mounting it, and another script that renames
it back after unmounting.   That way, there is no directory at the
mount point, under normal conditions.

There might be some things you can do with permissions, too.

-- 
Keith Lofstrom          keithl at keithl.com         Voice (503)-520-1993
KLIC --- Keith Lofstrom Integrated Circuits --- "Your Ideas in Silicon"
Design Contracting in Bipolar and CMOS - Analog, Digital, and Scan ICs



More information about the PLUG mailing list