abandon using sparse files (for persistent changes) in favor of DynFileFS even on NTFS partitions

pull/40/head
TomasM 2017-12-17 08:21:26 -05:00
parent 912e6f8f5f
commit 3599b99ad2
1 changed files with 4 additions and 16 deletions

View File

@ -640,23 +640,11 @@ persistent_changes()
EXISTS="" EXISTS=""
fi fi
# test sparse file support. If supported, use it in favor of fynfilefs
dd if=/dev/zero of="$T1" seek=200k bs=1 count=0 >/dev/null 2>/dev/null && \
test "$(du -k "$T1" | sed -r "s/[^0-9].*//")" -lt 200
if [ $? -eq 0 ]; then
if [ ! "$EXISTS" ]; then
dd if=/dev/zero of="$CHANGES/changes.dat" seek=16000M bs=1 count=0 >/dev/null 2>&1
mke2fs -F "$CHANGES/changes.dat" >/dev/null 2>&1
fi
mount -o loop "$CHANGES/changes.dat" "$2"
else
@mount.dynfilefs "$CHANGES/changes.dat" 4000 "$2" @mount.dynfilefs "$CHANGES/changes.dat" 4000 "$2"
if [ ! "$EXISTS" ]; then if [ ! "$EXISTS" ]; then
mke2fs -F "$2/loop.fs" >/dev/null 2>&1 mke2fs -F "$2/loop.fs" >/dev/null 2>&1
fi fi
mount -o loop,sync "$2/loop.fs" "$2" mount -o loop,sync "$2/loop.fs" "$2"
fi
# if test failed at any point, we may have temp files left behind # if test failed at any point, we may have temp files left behind
rm "$T1" "$T2" 2>/dev/null rm "$T1" "$T2" 2>/dev/null