Thread (3 messages) 3 messages, 2 authors, 2012-08-30

Re: why online shrink is not supported with EXT4_IOC_RESIZE_FS?

From: Andreas Dilger <hidden>
Date: 2012-08-27 17:51:42

On 2012-08-27, at 7:30 AM, raphel johnson wrote:
I was referring EXT4_IOC_RESIZE_FS ioctl implementation in linux
kernel ver 3.3.8.

It is given in the code that online shrinking not supported.

if (n_blocks_count < o_blocks_count) {
/* On-line shrinking not supported */
ext4_warning(sb, "can't shrink FS - resize aborted");
return -EINVAL;
}

I am new to ext4 file system. Could you please tell online shrinking
issues in ext4.

Thanks in adavance.
There are several reasons for this:
- if blocks are in use beyond the new end of the filesystem, potentially
  all inodes in the filesystem need to be scanned to find the owner
- this also causes consistency issues with the page cache, since moving
  in-use disk blocks is tricky, and it isn't always possible to remove
  them from memory
- if in-use inodes are beyond the end of the new filesystem, potentially
  all of the directories in the filesystem need to be scanned to find the
  parent directory
- moving inodes in ext4 will also cause the inode number to change, which
  would break NFS and potentially other programs

In the end, rarely do users need to shrink a filesystem while mounted, so
the effort and complexity of doing this isn't worthwhile.

Cheers, Andreas




Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help