Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Feb 2005 07:53:42 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        FreeBSD Mailing list <freebsd-questions@freebsd.org>
Subject:   Re: mounted ext2 fs causes bad shutdown
Message-ID:  <20050201055342.GC776@gothmog.gr>
In-Reply-To: <20050201041642.GA1733@oliverfuchs.onlinehome.de>
References:  <20050131110432.GD8619@alzatex.com> <20050201041642.GA1733@oliverfuchs.onlinehome.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-02-01 05:16, Oliver Fuchs <oliverfuchs@onlinehome.de> wrote:
>On Mon, 31 Jan 2005, Loren M. Lang wrote:
>> On a FreeBSD 5.3 system of mine that is dual boot with linux I have
>> my linux home partition which is ext3fs mounted on freebsd.  Anytime
>> I reboot or halt freebsd while it is mounted, freebsd fails to sync
>> all it's buffers.
>
> You first have to umount the linux partition. I have this uncommented
> in my /etc/rc.shutdown (I have it from the list):
>
> #extfs=`eval mount | grep ext2fs | awk '{print $1 }'`
> #for _elem in $extfs; do
> #       echo -n "Unmounting ext2/ext3 filesystems: "
> #       umount -a -t ext2fs
> #       echo -n "$_elem "
> #done
> #
> #echo '.'
> #exit 0

What you have is not correct.

A more correct approach would be to actually *USE* the _elem iterator in
the loop, instead of just echoing it.

There is also a bug lurking in there.  The script prints the
"Unmounting" message once for each unmounted filesystem.

One of the many ways to do the same thing without the bugs could be:

#       extfs=$(mount | grep '^/.*(ext2fs,' | awk '{print $1}')
#       if [ -n "${extfs}" ]; then
#               echo -n "Unmounting ext2/ext3 filesystems:"
#               for _elem in ${extfs} ;do
#                       umount "${_elem}" && echo -n " ${_elem}"
#               done
#               echo '.'
#       fi
#       unset extfs



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050201055342.GC776>