-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mount-options: Add Mount Options Support
When using zram for file system, we need to enable `discard` mount option for issue discard/TRIM commands to the underlying zram block device when blocks are freed. Else deleted files are not zero-ed, so zram does not remove the compressed pages. Fixes #89
- Loading branch information
Showing
9 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ After=systemd-zram-setup@zram11.service | |
[Mount] | ||
What=/dev/zram11 | ||
Where="/var/compressed" | ||
Options="" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[zram11] | ||
mount-point = /var/compressed | ||
fs-type = ext4 | ||
mount-options = discard |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
MemTotal: 801322 kB | ||
MemFree: 611992 kB | ||
MemAvailable: 139764 kB |
1 change: 1 addition & 0 deletions
1
tests/09-mount-options/run.expected/units/local-fs.target.wants/var-compressed.mount
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../var-compressed.mount |
4 changes: 4 additions & 0 deletions
4
...9-mount-options/run.expected/units/systemd-zram-setup@zram11.service.d/bindsto-mount.conf
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Automatically generated by "zram-generator" | ||
|
||
[Unit] | ||
BindsTo=var-compressed.mount |
12 changes: 12 additions & 0 deletions
12
tests/09-mount-options/run.expected/units/var-compressed.mount
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Automatically generated by "/home/zbyszek/src/zram-generator/target/debug/zram-generator" | ||
|
||
[Unit] | ||
Description=Compressed Storage on /dev/zram11 | ||
Documentation=man:zram-generator(8) man:zram-generator.conf(5) | ||
Requires=systemd-zram-setup@zram11.service | ||
After=systemd-zram-setup@zram11.service | ||
|
||
[Mount] | ||
What=/dev/zram11 | ||
Where="/var/compressed" | ||
Options="discard" |
This file contains 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