Last active
January 7, 2019 07:39
-
-
Save silenceshell/e9117aa5ff5b162528cbe2a561523f7a to your computer and use it in GitHub Desktop.
create a loopback file and mount it
This file contains 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
#!/bin/bash | |
# sudo loopmount file size mount-point | |
touch $1 | |
truncate -s $2 $1 | |
mke2fs -t ext4 -F $1 1> /dev/null 2> /dev/null | |
if [[ ! -d $3 ]]; then | |
echo $3 " not exist, creating..." | |
mkdir $3 | |
fi | |
mount $1 $3 | |
df -h |grep $3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment