Add contrib/mount-ext4-ramdisk.sh

This commit is contained in:
Jakob Unterwurzacher 2020-09-14 19:01:33 +02:00
parent af7386713c
commit 55fcacfc27
1 changed files with 16 additions and 0 deletions

16
contrib/mount-ext4-ramdisk.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash -ex
MNT=/mnt/ext4-ramdisk
if mountpoint $MNT ; then
exit 1
fi
IMG=$(mktemp /tmp/ext4-ramdisk-XXX.img)
dd if=/dev/zero of=$IMG bs=1M count=1030
mkfs.ext4 -q $IMG
mkdir -p $MNT
mount $IMG $MNT
chmod 777 $MNT
rm $IMG # unlink the file, it will be deleted once the fs is unmounted