Skip to content

Instantly share code, notes, and snippets.

@richinseattle
Created May 21, 2017 19:48
Show Gist options
  • Save richinseattle/a7dd0aedf10bb10484c475045d83fc8b to your computer and use it in GitHub Desktop.
Save richinseattle/a7dd0aedf10bb10484c475045d83fc8b to your computer and use it in GitHub Desktop.
#!/bin/bash
# ext4 disable journal
# Create ext4 fs
mkfs.ext4 /dev/sda2
# Enable writeback mode. This mode will typically provide the best ext4 performance.
tune2fs -o journal_data_writeback /dev/sda2
# Delete has_journal option
tune2fs -O ^has_journal /dev/sda2
# Required fsck
e2fsck -f /dev/sda2
# Check fs options
dumpe2fs /dev/sda2 |more
# For more performance add fstab opions: data=writeback,noatime,nodiratime
echo "/dev/sda2 /opt ext4 defaults,data=writeback,noatime,nodiratime 0 0" >> /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment