resize2fs:Memory alloction failed while trying to resize

最近入手一块 12T 的西数红盘,打算安装到 WD MyCloud Gen1 上,从 4TB 版本升级到 12TB 版本,作为 TimeMachine 来用。

使用 拯救死翘翘了的WD MyCloud 方式恢复镜像之后,最后一步执行

$ resize2fs /dev/sda4

结果报告如下错误:

$ resize2fs /dev/sda4
resize2fs 1.42.5 (29-Jul-2012)
Resizing the filesystem on /dev/sda4 to 2928542715 (4k) blocks.
resize2fs: Memory allocation failed while trying to resize /dev/sda4
Please run 'e2fsck -fy /dev/sda4' to fix the filesystem
after the aborted resize operation.

这个原因网上查询了很久,基本上断定是 e2fsprogs 1.42.5 的 BUG,这个问题在  e2fsprogs 1.42.9 版本修复。修复内容参考代码下的 debian/changelog

关键日志如下:

e2fsprogs (1.42.9-1) unstable; urgency=low

  * Fixed a large number of bugs in resize2fs, e2fsck, debugfs, to
    handle bigalloc and 64-bit file systems.

编译过程参考 How to successfully build packages for WD My Cloud from source 中对于 e2fsprogs 1.42.13 的编译。

参考链接