Skip to content

Instantly share code, notes, and snippets.

@evansd
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save evansd/3b5c0096017335e3dc58 to your computer and use it in GitHub Desktop.

Select an option

Save evansd/3b5c0096017335e3dc58 to your computer and use it in GitHub Desktop.
Create loopback filesystem
# Create a loop-mounted filesystem to allow a very high inode count
# without having to reformat entire partition
# Allocate a 1.5TB file without actually having to write 1.5TB of data
fallocate -l 1500G /path/to/filesystem.img
# Make an ext4 filesystem in this file with:
# (-i) One inode per 1024 bytes
# (-F) Force creation of the filesystem even though the
# file is not a block special device
mkfs.ext4 -F -i 1024 /path/to/filesystem.mg
# Disable journaling for data but leave enabled for metadata
# Protects against filesystem corruption in the event of a crash
# but might leave some file data half written
tune2fs -o journal_data_writeback /path/to/filesystem.img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment