Bryan J. Smith
2003-Mar-20 06:41 UTC
Is it safe to run "tune2fs -j" on a mounted filesystem?
All -- I'm curious is if it safe or even wise to run the following command on a mounted filesystem, namely root (/)? tune2fs -j /dev/hda1 What about if someone goes into single user mode and runs this first? mount -o remount,ro / And then to enable it, runs this? mount -t ext2 -o remount,rw / I assume it is not safe to do so, but one user in my LUG assumes otherwise. Just curious, as I never like to assume. -- Bryan J. Smith (suffix-free title for your protection) mailto:b.j.smith@ieee.org http://www.thebs.org ------------------------------------------------------------- community : free will communism : will free
Andreas Dilger
2003-Mar-20 07:39 UTC
Re: Is it safe to run "tune2fs -j" on a mounted filesystem?
On Mar 20, 2003 01:41 -0500, Bryan J. Smith wrote:> I'm curious is if it safe or even wise to run the following command on a > mounted filesystem, namely root (/)? > tune2fs -j /dev/hda1Yes, this is possible (and safe) to do. It will create a file /.journal for the journal (and set the has_journal) flag in the superblock along with the inode number of the journal. Of course, since the filesystem is mounted as ext2, it will not suddenly become "journaled" until it is unmounted and remounted as ext3.> What about if someone goes into single user mode and runs this first? > mount -o remount,ro /Won't work, I'm pretty sure.> And then to enable it, runs this? > mount -t ext2 -o remount,rw /Never. While ext2 and ext3 share an on-disk format, the kernel code is very different. The above will remount the filesystem as ext2, and it will totally ignore the journal. Cheers, Andreas -- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://www-mddsp.enel.ucalgary.ca/People/adilger/