Skip to content

Instantly share code, notes, and snippets.

@kamawanu
Last active December 15, 2015 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamawanu/5227905 to your computer and use it in GitHub Desktop.
Save kamawanu/5227905 to your computer and use it in GitHub Desktop.
add sparse virtualdisk for linuxmint
#!/bin/sh -x
PART=$1
MSIZE=${2-20}
FS=${3-ext4}
SIZE=$( expr $MSIZE \* 1024 \* 1024 )
LAST=$( expr $SIZE - 1 )
dd if=/dev/zero bs=1k count=1 seek=$LAST of=/host/linuxmint/$PART.disk
mkfs.$FS /host/linuxmint/$PART.disk || exit 9
ls -l /host/linuxmint/$PART.disk
du -sm /host/linuxmint/$PART.disk
mkdir /$PART
echo /host/linuxmint/$PART.disk /$PART $FS loop 0 0 >> /etc/fstab
#!/bin/dash -x
tune2fs -j $1
#!/bin/dash -x
tune2fs -O extents,uninit_bg,dir_index $1
e2fsck -fDC0 $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment