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

Re: Resize journal on root filesystem

This makes me wonder whether a problem similar to the one I asked about
last week (removing a journal on the root without immediate reboot) could
crop up here after resizing the journal on the root.  Is it even safe
to remount R/W without reboot first in this case?  If so, what makes the
difference?  If the kernel still has a handle on the old journal somehow,
then it would seem any write access to the disk would be questionable.

------- Forwarded Message
Date:    Fri, 04 Oct 2002 23:15:49 +0000
From:    "JP Howard" <jh_lists fastmail fm>
Subject: Re: Resize journal on root filesystem

On Fri, 04 Oct 2002 18:21:14 -0400 (EDT), "Michael J. Accetta"
<mja laurelnetworks com> said:
> > Then in /etc/rc.oneshot, do something like this:
> > 
> > #!/bin/sh
> > tune2fs -O ^has_journal /dev/hdXXXX
> > tune2fs -j -J size=XXX /dev/hdXXXX
> > rm -f /etc/rc.oneshot
> > reboot
> > 
> > After you make these sorts of changes to the root filesystem, even
> > though it's mounted read-only, you really do want to reboot
> > immediately.  Hence the need for doing it as a rc script that only is
> > run once.
> Presumably /etc/rc.oneshot is on the (read-only) root file system so
> unfortunately it can't be as straightforward as this.  
Here's what I changed in rc.sysinit:
- ----
if [ -x /etc/rc.oneshot -a ! -f /etc/.doneoneshot ] ; then

# Remount the root filesystem read-write.
state=`awk '/(^\/dev\/root| \/ )/ { print $4 }' /proc/mounts`
[ "$state" != "rw" ] && \
  action $"Remounting root filesystem in read-write mode: " \
  mount -n -o remount,rw /

if [ -x /etc/rc.oneshot -a ! -f /etc/.doneoneshot ] ; then
  /bin/mv -f /etc/rc.oneshot /etc/rc.oneshot.done
  /bin/touch /etc/.doneoneshot
- ----

I checked for both files because of paranoia--I don't have access to the
console, so I have to be really sure the machine will come back up!

------- End of Forwarded Message

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