diff options
author | Jakob Unterwurzacher | 2020-09-14 19:01:33 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2020-09-14 19:01:33 +0200 |
commit | 55fcacfc27aeb5217b637fa60f4f562aa7daf633 (patch) | |
tree | db116c318594c96418c9ab4b7847f015113ac5e1 /contrib/mount-ext4-ramdisk.sh | |
parent | af7386713c33a476f6094d0c53a518a2c6b2c015 (diff) |
Add contrib/mount-ext4-ramdisk.sh
Diffstat (limited to 'contrib/mount-ext4-ramdisk.sh')
-rwxr-xr-x | contrib/mount-ext4-ramdisk.sh | 16 |
1 files changed, 16 insertions, 0 deletions
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 |