Created
September 18, 2014 08:54
-
-
Save v6ak/65eb3df2c4e75e90d68f to your computer and use it in GitHub Desktop.
My optimizations for /var/log and /tmp/large
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/dev/mapper/largetmp1 /tmp/large ext4 noauto,nosuid,noatime,delalloc,nobarrier,data=writeback,commit=36000 0 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# There is a non-critial partition where /var/log is stored. When there aren't much data to be written, it simply waits up to one hour. | |
# This is aimed to reduce SSD write amplification. I hope it works correctly. I haven't verified it. | |
UUID=someeee-long-long-long-uuuuuuiiiddd /non-critical ext4 nosuid,noatime,commit=3600 0 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DEV=/dev/mapper/largetmp1 | |
( | |
sudo mkfs.ext4 "$DEV" -E lazy_itable_init -m 0 -O sparse_super && | |
sudo tune2fs -o journal_data_writeback "$DEV" && | |
sudo tune2fs -O ^has_journal "$DEV" && | |
sudo mkdir -p /tmp/large && | |
sudo mount /tmp/large && | |
sudo chmod 1777 /tmp/large | |
) || exit 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% # I use symlink. It may be an suboptimal approach, I had some issues with AppArmor. | |
% # Since the /var/log is the only thing moved to /non/critical, I could have created a partition for /var/log. | |
% ll /var/log | |
lrwxrwxrwx 1 root root 22 Apr 4 22:21 /var/log -> /non-critical//var/log/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very nice trick, I am planning to use it in my RaspberryPI2