Hi all, I'm trying to resize a journal on my root filesystem. This is Ext3, kernel 2.4.19, latest e2fsprogs + htree patch. I've remounted my root filesystem as ext2, but still when I 'tune2fs -O ^has_journal' I get ---- The has_journal flag may only be cleared when the filesystem is unmounted or mounted read-only. ---- So, how can I increase the size of the journal? I can't remount the root filesystem as readonly because I don't have console access (I only have SSH access, because the machine is in a data centre on the other side of the world--SSH won't work with the root filesystem mounted readonly).
----- Original Message ----- From: "Jeremy Howard" <jh_lists@fastmail.fm> To: <ext3-users@redhat.com> Sent: Friday, October 04, 2002 12:15 PM Subject: Resize journal on root filesystem> Hi all, > > I'm trying to resize a journal on my root filesystem. This is Ext3, > kernel 2.4.19, latest e2fsprogs + htree patch. > > I've remounted my root filesystem as ext2, but still when I 'tune2fs -O > ^has_journal' I get > ---- > The has_journal flag may only be cleared when the filesystem is > unmounted or mounted read-only. > ---- > > So, how can I increase the size of the journal? I can't remount the root > filesystem as readonly because I don't have console access (I only have > SSH access, because the machine is in a data centre on the other side of > the world--SSH won't work with the root filesystem mounted readonly).Add the tune2fs command to rc.sysinit before the root filesystem fsck is run, then reboot the machine remotely. /Martin
On Fri, 4 Oct 2002 13:19:26 -0400, "Theodore Ts'o" <tytso@mit.edu> said:> > Add the tune2fs command to rc.sysinit before the root filesystem fsck is > > run, then reboot the machine remotely. > > What I'd recommend is to create the ability for rc.sysinit to run a > one-shot script. I.e., > > if [ -x /etc/rc.oneshot ] ; then > . /etc/rc.oneshot > fi > > 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. >Thanks to you both. In hindsight, I feel a bit stupid for not thinking of this... gotta love hindsight... ;-)
> 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. Mike Accetta Laurel Networks, Inc.
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!