Skip to content

Instantly share code, notes, and snippets.

@tonmanna
Created August 13, 2021 15:31
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 tonmanna/ef23d95c199fcc2e0850095e3745b159 to your computer and use it in GitHub Desktop.
Save tonmanna/ef23d95c199fcc2e0850095e3745b159 to your computer and use it in GitHub Desktop.
mount image file linux (limit folder size)
$ touch 2gbarea
$ truncate -s 2G 2gbarea
$ mke2fs -t ext4 -F 2gbarea
mke2fs 1.43.3 (04-Sep-2016)
Discarding device blocks: done
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: bf1b2ee8-a7df-4a57-9d05-a8b60323e2bf
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
$ sudo mount 2gbarea up
$ df -h up
Filesystem Size Used Avail Use% Mounted on
/dev/loop0 2.0G 6.0M 1.8G 1% /home/muru/up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment