Problem when resize ext3 file system online

Latest response

Dear All,

 

Is there anyone who do research into resize ext3 file system online (mountedt with rw mode). I have tested some cases in which I used dd command to create some files ( > 1G each file) and resize file system at the same time. After that, I usually encountered some problems, such as "Free blocks count wrong" or "Free inodes count wrong", like bellow. If I choose Yes (y) to fix the problems, there are many files were lost. Dit you do some test case like mime?

 

I feel that ext3/ext4 file system are more difficult to manage thatn jfs2 on AIX, especially when resize them. I live environment, some time I must resize online, and maybe in future I can use RHEL for core banking. So Down time seems to be unaccaptable. Did you compare these file system, Pros and Cons of these?

 

Thanks for your ideas.

 

================================

 

root@client03 test1]# e2fsck /dev/VG0/test1 -fn
e2fsck 1.39 (29-May-2006)
Warning!  /dev/VG0/test1 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (1394262, counted=531989).
Fix? no

Free inodes count wrong (391285, counted=440436).
Fix? no

/dev/VG0/test1: ********** WARNING: Filesystem still has errors **********

/dev/VG0/test1: 51083/442368 files (0.0% non-contiguous), 375210/1769472 blocks

Responses

Running a filesystem check on a mounted file system is a very effective way of destroying the file system. The filesystem check utilities run against the data as it exists on the storage, and for a mounted filesystem that data is unlikely to ever be in a consistent state. I've uncloaked Running fsck on mounted filesystem results in it becoming unusable now which is intended to document this.

 

While JFS2 was ported to Linux, it never gained much traction and we've never shipped it (cf. Does Red Hat Enterprise Linux support the JFS / JFS2 filesystem?).

 

If you have usability issues with the filesystems that we ship that go beyond this fsck issue, please share them. I'm sure our filesystem specialists would like to learn about them.

 

Hi Mr. Ray,

 

Thank for your very helpful information!

 

Is it ok if I resize mounted FS with rw mode (by resize2fs command or system-config-lvm tool) without check FS after that? because I think in some special cases I cannot umount FS and run fsck to check it.

Off the top of my head, we support online (i.e. while-it-is-mounted) growing of an ext3 filesystem using the resize2fs command, but for shrinking the filesystem needs to be offline (unmounted). I'm on a slow mobile connection currently, so apologies for not providing chapter and verse of the product documentation or knowledge base entry documenting this.

Thank you!

 

Please kindly give me some entries about this when you are convenient.

For ext4 on RHEL6, online growing is discussed in the Resizing an Ext4 File System section of the Storage Administration Guide and the resize2fs(8) man page states the restriction of shrinking to offline:

       The resize2fs program will resize ext2, ext3, or ext4 file systems.  It
       can  be  used  to enlarge or shrink an unmounted file system located on
       device.  If the filesystem is mounted, it can be  used  to  expand  the
       size  of  the  mounted filesystem, assuming the kernel supports on-line
       resizing.