From 55fcacfc27aeb5217b637fa60f4f562aa7daf633 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Mon, 14 Sep 2020 19:01:33 +0200 Subject: Add contrib/mount-ext4-ramdisk.sh --- contrib/mount-ext4-ramdisk.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 contrib/mount-ext4-ramdisk.sh (limited to 'contrib') diff --git a/contrib/mount-ext4-ramdisk.sh b/contrib/mount-ext4-ramdisk.sh new file mode 100755 index 0000000..66de968 --- /dev/null +++ b/contrib/mount-ext4-ramdisk.sh @@ -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 -- cgit v1.2.3