-
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.
Merge pull request #68 from matteotenca/cache_mode
Small update to initrd scripts to support writeback mode
- Loading branch information
Showing
8 changed files
with
132 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Changelog | ||
|
||
### Version 0.1.0 | ||
|
||
Released 2021-12-12 | ||
|
||
* Added --cache-mode parameter | ||
* Added sanity checks in Ubuntu initrd scripts | ||
* Added many debug messages in Ubuntu initrd scripts | ||
* Added a workaround to Ubuntu boot script in case the first ramdisk can't be attached | ||
* Now initrd scripts are placed in /usr dir under Ubuntu | ||
* The dm-writecache module is added to the initrd file only when needed under Ubuntu | ||
* Fixed Centos script to report dependencies correctly |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
## install_initrd.sh | ||
#### A simple bash script to add rapiddisk cache to your root volume | ||
|
||
###### Author: Matteo Tenca (<[email protected]>) | ||
###### Author: Matteo Tenca (<https://github.com/matteotenca/>) | ||
|
||
Warning: this is experimental - use at your own risk and only if you | ||
know what you're doing. | ||
|
@@ -43,7 +43,8 @@ This script alters this approach: the rule set remains system-wide, but allows t | |
### 1) Usage when installing (`--install`) | ||
``` | ||
sudo ./install_initrd.sh --install --root=<root_partition> | ||
--size=<ramdisk_size> --kernel=<kernel_version> [--force] | ||
--size=<ramdisk_size> --kernel=<kernel_version> | ||
--cache-mode=<mode> [--force] | ||
``` | ||
|
||
The installation process (`--install` switch) can be performed several times. The options you provide will affect only | ||
|
@@ -55,7 +56,7 @@ The installation process (`--install` switch) can be performed several times. Th | |
|
||
|
||
#### --root=<root_partition> | ||
<root_partition> must be be equal to the root device where `/` is | ||
<root_partition> must be equal to the root device where `/` is | ||
mounted, for example `/dev/sda1`. You can find it this way: | ||
|
||
``` | ||
|
@@ -76,6 +77,11 @@ proposal. | |
<ramdisk_size> indicates the number of megabyte rapiddisk will use as | ||
cache for your root device. For example `--size=1000` means your cache will be 1 GB big. | ||
|
||
#### --cache-mode=<cache_mode> | ||
|
||
<cache_mode> indicates the caching behavoiur, must be `wt`, `wa` or `wb`. | ||
See `rapiddisk`'s documentation for more. | ||
|
||
#### --kernel=<kernel_version> | ||
|
||
Instructs the script about which initrd file to update. On many linux | ||
|
@@ -101,7 +107,7 @@ And go. | |
#### --force | ||
|
||
This forces the script to reinstall the needed things and redo the jobs, | ||
even if all seems to be already installed. If you force the reinstall | ||
even if all seems to be already installed. If you force the reinstallation | ||
with a different `--root`, only the last one you specified will be | ||
cached. | ||
|
||
|
@@ -135,7 +141,11 @@ sudo ./install_initrd.sh --global-uninstall | |
``` | ||
|
||
This operation removes everything the script could have installed, and rebuilds ALL the initrd files. A complete | ||
uninstall is performed. | ||
uninstallation is performed. | ||
|
||
## Notes | ||
|
||
* Under Centos 8, using xfs as the root filesystem, rapiddisk may not work if write-back mode is selected. | ||
|
||
## Tips | ||
|
||
|
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
9 changes: 6 additions & 3 deletions
9
misc/rapiddisk-rootdev/centos/96rapiddisk/run_rapiddisk.sh.orig
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
#!/bin/bash | ||
|
||
modprobe rapiddisk | ||
modprobe rapiddisk-cache | ||
modprobe -q dm-mod | ||
modprobe -q dm-writecache | ||
modprobe -q rapiddisk | ||
modprobe -q rapiddisk-cache | ||
|
||
rapiddisk -a RAMDISKSIZE | ||
rapiddisk -m rd0 -b BOOTDEVICE -p wa | ||
rapiddisk -m rd0 -b BOOTDEVICE -p CACHEMODE |
Oops, something went wrong.