Skip to content

Instantly share code, notes, and snippets.

@dvapelnik
Created July 5, 2015 15:24
Show Gist options
  • Save dvapelnik/e1a087a8f37e1d57eb36 to your computer and use it in GitHub Desktop.
Save dvapelnik/e1a087a8f37e1d57eb36 to your computer and use it in GitHub Desktop.
make file container with some filesystem
#!/bin/bash
# Make file container with 100Gb size
dd if=/dev/zero of=container.ext4 bs=1M count=102400
# Format with ext4 fs
mkfs ext4 -F container.ext4
# Make mount-directory
sudo mkdir -p /mnt/container_dir
# Mount container
sudo mount -o loop,rw,sync container.ext4 /mnt/container_dir
# Unmount container
sudo umount /mnt/container_dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment