External disk problem.

ny6p01 at gmail.com ny6p01 at gmail.com
Mon Jul 30 13:16:34 UTC 2012


On Mon, Jul 30, 2012 at 11:01:53AM +0100, Bryn M. Reeves wrote:
> On Mon, 2012-07-30 at 06:48 -0300, Fernando Cassia wrote:
> > On Mon, Jul 30, 2012 at 6:32 AM, Bryn M. Reeves <bmr at redhat.com> wrote:
> > > Do you see that happen a lot?
> > 
> > Do you mean the error, or the sharing of scripts?
> 
> The error: it's an abnormal condition so if you are seeing that,
> especially if it is happening frequently, there is a problem.
> 
> When a device is removed the kernel issues remove uevents that should be
> picked up by udev and cause the device nodes to be removed.
> 
> Bryn.

Well, FWIW, and at the risk of showing off my rather meager talents at bash
scripting (lol), my script simply checks that the drives aren't busy, and
then unmounts them before suspending.  I still have to manually remount them
after I resume. 

#! /bin/bash
umount /mnt/Ptec
if [ -e "/mnt/Ptec/Gentoo" ]; then
    echo "Device Ptec Busy"
    exit
else
        umount /mnt/USB
fi
if  [ -e "/mnt/USB/icons" ]; then
   echo "Device USB Busy"
   exit 
else
      /usr/sbin/hibernate-ram
fi

Terry


More information about the users mailing list