Re: why online shrink is not supported with EXT4_IOC_RESIZE_FS?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux