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

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
  /etc/rc.oneshot
fi

# 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
  /sbin/reboot
fi
----

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!





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