#3650 PR closed: Add MKFS_EXT_OPTIONS for ext2/ext3/ext4 filesystems during 'rear recover'¶
sebastian-koehler opened issue at 2026-10-04 16:05:¶
Summary¶
- Adds
MKFS_EXT_OPTIONS, mirroring the existingMKFS_XFS_OPTIONS, so a user can pass extramkfs/mke2fsoptions (e.g.-E nodiscard) for ext2/ext3/ext4 filesystems vialocal.conf/site.confduringrear recover. - Motivating case:
mke2fs's default block-discard/TRIM pass is slow against thin-provisioned virtual disks, the same problemMKFS_XFS_OPTIONS="-K"already solves for XFS. - One flat global variable, no per-device override: the
(ext*)case arm in131_include_filesystem_code.shis shared by ext2/ext3/ext4 with no per-fstype branching, and unlike XFS there is no saved-raw-options replay tier for a per-device override to take precedence over, so that extra complexity isn't warranted here.
Changes¶
usr/share/rear/layout/prepare/GNU/Linux/131_include_filesystem_code.sh: readsMKFS_EXT_OPTIONSand appends it to the generatedmkfscommand in both the-U uuidbranch (and its no--U-support fallback) and the no-uuid branch.usr/share/rear/conf/default.conf: new documentation block forMKFS_EXT_OPTIONS, placed directly after the existingMKFS_XFS_OPTIONSblock and matching its style.
Test plan¶
-
☒
bash -nsyntax check on the modified script. -
☒ Sourced
create_fs()directly with stubbedLog/LogPrint/mount_fsand a syntheticdisklayout.confext4 entry; confirmed the generatedmkfsline is byte-identical to before this change whenMKFS_EXT_OPTIONSis unset, and correctly includes-E nodiscardright before-U/-Fin all three code paths (uuid branch, its fallback, and the no-uuid branch) when set. -
☐ End-to-end
rear mkbackup/rear recoveron a live ext4 client withMKFS_EXT_OPTIONS="-E nodiscard"set.
codacy-production commented at 2026-10-04 16:06:¶
Up to standards ✅¶
🟢 Issues 0 issues
> > > **Results:** > `0` new issues > > [View in > Codacy](https://app.codacy.com/gh/rear/rear/pull-requests/3650/issues) >
NEW Get contextual insights on your PRs based on Codacy's
metrics, along with PR and Jira context, without leaving GitHub. Enable
AI
reviewer
TIP This summary will be updated as you push new changes.
[Export of Github issue for rear/rear.]