Converting ext2 to ext3 while mounted
There’s not much to it, but
I just have one problem with this artcle: The fear of adding a journal to a mounted file system is unnecessary.
There’s no need to unmount it or to mount read-only before adding the journal. If you operate on a mounted file system, the journal gets created on a regular inode and marked immutable. Upon your next boot, the journal will be moved to the hidden inode.
====# tune2fs -j /dev/sda7====
|
1 2 3 4 |
tune2fs 3.3.3 (21-Dec-2012) Creating journal inode: done This filesystem will be automatically checked every 21 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. |
====# ls -la====
|
1 2 3 4 5 |
total 131232 drwxr-xr-x 3 root root 4096 2009-04-09 12:21 . drwxr-xr-x 11 root root 4096 2009-04-09 11:27 .. -rw------- 1 root root 134217728 2009-04-09 12:21 .journal drwx------ 2 root root 16384 2009-04-09 12:21 lost+found |
You can’t modify or remove the .journal file either, so don’t even worry about that.
====# chmod 777 .journal====
|
1 |
chmod: changing permissions of `.journal': Operation not permitted |
====# rm -f .journal====
|
1 |
rm: cannot remove `.journal': Operation not permitted |
I see no need for anything more than an ext2 file system for boot since I leave it unmounted after booting anyway. But it’s not a big deal. I only use ext3/ext4 now and ocfs for clustered file systems. My Fedora 10 doesn’t seem to like mounting ext2.
It even saves a little space by not having a journal file. Ok, not much, but its the thought that counts right!? Just in case you’re wondering, on my 15G file system, the journal is 128M.