use XFS instead of ext4 for persistent changes

This commit is contained in:
Tomas M
2023-08-28 06:57:10 +00:00
parent a41c3a1e69
commit 96380467e9
8 changed files with 2370 additions and 11 deletions

View File

@@ -48,8 +48,8 @@ ln -s bin $INITRAMFS/sbin
cp static/busybox $INITRAMFS/bin
cp static/ncurses-menu $INITRAMFS/bin
cp static/eject $INITRAMFS/bin
cp static/mke2fs $INITRAMFS/bin
cp static/resize2fs $INITRAMFS/bin
cp static/mkfs.xfs.custom $INITRAMFS/bin
cp static/xfs_growfs $INITRAMFS/bin
cp static/mount.dynfilefs $INITRAMFS/bin/@mount.dynfilefs
cp static/mount.httpfs2 $INITRAMFS/bin/@mount.httpfs2
cp static/blkid $INITRAMFS/bin

Binary file not shown.

Binary file not shown.

BIN
initramfs/static/mkfs.xfs.custom Executable file

Binary file not shown.

Binary file not shown.

BIN
initramfs/static/xfs_growfs Executable file

Binary file not shown.

View File

@@ -781,6 +781,11 @@ persistent_changes()
PERCHSIZE=16000
fi
# minimum size is 16GB
if [ "$PERCHSIZE" -lt 16000 ]; then
PERCHSIZE=16000
fi
PERCHFILE="$PERCHDIR/changes.dat"
# resume or use new
@@ -794,19 +799,16 @@ persistent_changes()
# mount it, splitsize of 4000MB is hardcoded, it must be the same all the time anyway
@mount.dynfilefs -f "$CHANGES/$PERCHFILE" -s $PERCHSIZE -m "$2" -p 4000
if [ "$EXISTS" ]; then
echo "- filesystem check"
e2fsck -y "$2/virtual.dat" >>/var/log/perch.fsck.log 2>&1
echo "- filesystem grow if needed"
resize2fs -f "$2/virtual.dat" >>/var/log/perch.resize.log 2>&1
else
echo "- filesystem creation"
mke2fs -t ext4 -F "$2/virtual.dat" >/dev/null 2>&1
if [ ! "$EXISTS" ]; then
echo "- creating filesystem using XFS"
mkfs.xfs.custom "$2/virtual.dat"
fi
echo "- filesystem mount"
mount -o loop "$2/virtual.dat" "$2"
rmdir "$2/lost+found" 2>/dev/null
echo "- filesystem grow if needed"
xfs_growfs "$2"
}

2357
tools/mkfs.xfs.custom.c Normal file

File diff suppressed because it is too large Load Diff