Jump to content

[Armbian build PR] - partitioning: Reduce `commit` mount option for btrfs and ext4 to 120


RSS Bot

Recommended Posts

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 is commit=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:

commit=nrsec (*)

This setting limits the maximum age of the running transaction to ‘nrsec’ seconds. The default value is 5 seconds. This means that if you lose your power, you will lose as much as the latest 5 seconds of metadata changes (your filesystem will not be damaged though, thanks to the journaling). This default value (or any low value) will hurt performance, but it’s good for data-safety. Setting it to 0 will have the same effect as leaving it at the default (5 seconds). Setting it to very large values will improve performance. Note that due to delayed allocation even older data can be lost on power failure since writeback of those data begins only after time set in /proc/sys/vm/dirty_expire_centisecs.

From btrfs:

commit=

(since: 3.12, default: 30)

Set the interval of periodic transaction commit when data are synchronized to permanent storage. Higher interval values lead to larger amount of unwritten data, which has obvious consequences when the system crashes. The upper bound is not forced, but a warning is printed if it’s more than 300 seconds (5 minutes). Use with care.

Sources:

How Has This Been Tested?

  • [x] Change is reflected in fstab

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] My changes generate no new warnings

View the full article

Link to comment
Share on other sites

Armbian & Khadas are rewarding contributors

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines