-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
partitioning: Reduce commit
mount option for btrfs and ext4 to 120
#6919
Conversation
Mount option `commit=600` (=10 minutes) seems pretty high. Reduce it to 120 for ext4 (default for ext4 is `commit=5`) and 120 for btrfs (default for btrfs is `commit=30`) to reduce risk of losing data on power loss. Sources: - https://www.kernel.org/doc/html/latest/admin-guide/ext4.html - https://wiki.archlinux.org/title/Btrfs#Commit_interval - https://btrfs.readthedocs.io/en/latest/Administration.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is from the days when most people were using slow SD cards. Lets go with the time.
The question is no longer about the speed of the cards, but about minimizing the number of write operations and accesses to the card. In 10 minutes, there's a chance that several changes to the file system will be combined into one (for example, log files, databases, etc.). The question of what is more important: the lifespan of the SD card or the survivability of the data in case of power loss remains open. |
Yes, I kept this in mind, which is why I chose 120 instead of the default. 120 seconds is still quite a long time, considering the default for ext4 is 5 seconds. 120s is a compromise and can likely be lowered even more without meaningful impact. That being said, my RPi has been running for about 7-8 years now 24/7 with just If anyone was seriously concerned about improving SD card lifespan, they would've made f2fs the default instead of ext4 long ago :)
Don't run databases off of an SD card. Just don't do it 😆 For logs, Armbian is using ramlog by default ( BUT! Don't worry, I've got a few PRs lined up that will massively improve SD card lifespan if that's something you care about 😉 |
You're falling into a perception error: your experience doesn't mean it works the same for everyone :) |
True, but I do not believe that this is related to the
Honestly, in that case I believe there has to be something else wrong. Some variable in your configuration that contributes to the wearing out big time. Unrelated to eMMC, what brand and quality of SD cards were you using? |
Description
Mount option
commit=600
(=10 minutes) seems pretty high.Reduce it to 120 for ext4 (default for ext4 is
commit=5
) and 120 for btrfs (default for btrfs iscommit=30
) to reduce risk of losing data on power loss.Only verly low settings (maybe 1-10) will have impact on performance according to documentation.
From ext4:
From btrfs:
Sources:
How Has This Been Tested?
Checklist: