I have a large ext4 filesystem which I'm currently shrinking (109Tb -> 83Tb in my case), and it's taking an extremely long time (Day 5 as of asking). Currently I can see that the process is still doing I/O (so it seems it hasn't errored out and stalled i.e. 100% cpu usage) via iotop
. However, from a cursory glance around the internet it would seem that resize2fs hasn't been quite as optimized for shrinks as much as growing the volumes (circa 2011).
To that matter, I don't want to interrupt it if I can help it, but I feel a little naked running a filesystem change for this long. What would be a good/timely estimate for an ext4 shrink, given we know the space requirements before and after (as well as the number of blocks / block sizes)
Software involved:
e2fs
...: 1.43.1- OS:
debian 4.19.16-1-bpo9+1
My specific filesystem:
- Type: ext4
- Size: ~109Tb (29297465344 blocks)
- Shrink to: 83Tb (22280142848 blocks)
- Block size: 4Kb (4096 bytes)
- bytes-per-inode: 2^15 (32786 bytes)
Current outputs:
resize2fs -p ...
:
[root@devlynx]## ~:: resize2fs -p /dev/storage/storage 83T
resize2fs 1.43.4 (31-Jan-2017)
Resizing the filesystem on /dev/storage/storage to 22280142848 (4k) blocks.
Begin pass 2 (max = 802451420)
Relocating blocks XX--------------------------------------
iotop
:
TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
7282 be/4 root 39.21 M/s 39.21 M/s 0.00 % 94.07 % resize2fs -p /dev/storage/storage 83T
cat /proc/7282/io
:
rchar: 12992021859371
wchar: 12988874121611
syscr: 13244258
syscw: 12482026
read_bytes: 13003899662336
write_bytes: 12988874125312
cancelled_write_bytes: 0
I'm still looking up info about the different passes resize2fs
needs to do as well as how I could calculate how long those passes take given the info I've got about my filesystem (I have more if needed). In short, how can I come up with a final estimation for how long this will take?
Edit: Is this actually a finished Pass 2?
[root@devlynx]## ~:: resize2fs -p /dev/storage/storage 83T
resize2fs 1.43.4 (31-Jan-2017)
Resizing the filesystem on /dev/storage/storage to 22280142848 (4k) blocks.
Begin pass 2 (max = 802451420)
Relocating blocks XX--------------------------------------
Begin pass 3 (max = 894088)
Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 4 (max = 92164)
Updating inode references XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/storage/storage is now 22280142848 (4k) blocks long.