Last active
July 2, 2017 10:39
-
-
Save FauxFaux/38ea20288c13eecffd30f4d4095b8e15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cleanup() { | |
sudo umount a | |
rm a.img | |
sudo losetup -d /dev/loop0 | |
} | |
set -eu | |
mkdir -p a | |
truncate -s 128k a.img | |
mkfs.ext4 a.img >/dev/null 2>&1 | |
sudo losetup -P -f a.img | |
sudo mount /dev/loop0 a | |
seq 5000 | sudo tee a/b >/dev/null | |
sudo umount a | |
dd if=<(echo FAILED) of=a.img bs=100 count=1 conv=notrunc seek=500 >/dev/null 2>&1 | |
sudo mount /dev/loop0 a | |
fgrep -2 FAIL a/b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment