Add contrib/mount-ext4-ramdisk.sh
This commit is contained in:
parent
af7386713c
commit
55fcacfc27
16
contrib/mount-ext4-ramdisk.sh
Executable file
16
contrib/mount-ext4-ramdisk.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user