[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Pb: umount / is busy



Victor B Wagner wrote:
> On Wed, 7 Apr 1999, Patrick Bertholon wrote:
>>     On my Debian 2.0, after I have upgraded to a 2.2 kernel, when I
>> reboot or halt my computer, I have sometimes the message: umount : / is
>> busy. That causes the system to check the disk on the next restart.
>>     I'd like to know why I have (sometimes) umount: /is busy, and how to
>> correct it .
> 
> 
> Really, this is problem which occur on many Linux variants. For some
> reason some process doesn't die when it is time to umount filesystem
> 
> Best solution I've seen was on Redhat 4.2 /etc/init.d/halt script
> 
> # Turn off swap, then unmount file systems.
> echo "Turning off swap"
> swapoff -a
> echo "Unmounting file systems"
> umount -a
> mount -n -o remount,ro /
> 
> echo "Remounting remaining filesystems (if any) readonly"
> mount | awk '/ext2/ { print $3 }' | while read line; do
>     mount -n -o ro,remount $line
> done
> 
> Only problem with this solution is that it assumes that awk
> which is /usr/bin/awk on Debian is available after umount -a
> (on Redhat awk is in /bin). 
> 
> It can be easily fixed with
> following command instead of loop above
> 
> mount |grep ext2| while read a b c junk; do
>   mount -n -o ro,remount $c
> done

Slink (and potato) in effect already does this.  The end of
/etc/init.d/umountfs reads:

echo -n "Unmounting file systems... "
umount -a -r
echo "done."

mount -n -o remount,ro /

The "-r" option to umount means that the file system will be remounted
read-only in case unmounting fails, so there should be no need for bash
trickery to accomplish this.  The "-r" option was added fairly recently
and wasn't available in the hamm version of umount, IIRC.
-- 
       /'"`\  zzzZ  | My PGP Public Key is available at:
      ( - - )       | <http://home1.inet.tele.dk/renehl/>
--oooO--(_)--Oooo------------------------------------------ 
 Don't ya just hate it when there's not enough room to fin 


Reply to: