Last active
January 26, 2025 05:00
-
-
Save JavaScriptDude/bdb60ec8801b1ff28c495a2485b6b13b to your computer and use it in GitHub Desktop.
Linux Mint 21.1 ZFS Root Installation Notes
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
When installing Linux Mint, you can install with ZFS Root by following standard instructions. | |
However, there is an issue with almost all Linux distributions default ZFS install script where the | |
allocated spaces for the partitions are a bit too small for real world ZFS Use. | |
These instructions show how to alter the ZFS setup script to have a more appropriate partition spacing. | |
Boot into the Linux Mint OS USB stick, and: | |
``` | |
sudo su | |
cd /usr/share/ubiquity/ | |
cp ./zsys-setup ./zsys-setup_orig | |
vi zsys-setup | |
``` | |
You can use gedit or any other command line editor of your choice. | |
### Swap File Size | |
Near the top of `format_disk() {` change: | |
``` | |
ss="$6" | |
``` | |
to: | |
``` | |
ss="8192" | |
``` | |
This is the size of the swap file. Set value to what you desire. Default is 2GB. | |
One article talking about this topic: https://opensource.com/article/19/2/swap-space-poll | |
#### Swap Size Percent Comment (optional) | |
Change: | |
``` | |
# bpool size: 500M < 5% of ZFS allocated space < 2G | |
``` | |
to: | |
``` | |
# bpool size: 500M < 20% of ZFS allocated space < 10G | |
``` | |
The above is just a comment, but it's best to update it so as to avoid confusion as you work. | |
### Swap Size Percent | |
Change: | |
``` | |
size_percent=$(expr \( $(blockdev --getsize64 ${partprefix}${partswap}) / 1024 / 1024 \) \* 5 / 100) | |
``` | |
to: | |
``` | |
size_percent=$(expr \( $(blockdev --getsize64 ${partprefix}${partswap}) / 1024 / 1024 \) \* 20 / 100) | |
``` | |
The above line checks the size of memory and changes swap file size accordingly, usually | |
it's 5% of memory or a maximum of only 2 GB. | |
### BPool Size | |
Change: | |
``` | |
[ ${bpool_size} -gt 2048 ] && bpool_size=2048 | |
``` | |
to: | |
``` | |
[ ${bpool_size} -gt 10240 ] && bpool_size=10240 | |
``` | |
Sets the bpool size (rpool size is just whatever free space is left over after you've got all the other partitions set up). | |
### Verify Changes | |
Save the file and do a diff to verify: | |
``` | |
diff zsys-setup zsys-setup_orig | |
``` | |
Once you are satisfied, start the `Install Linux Mint` and choose Advanced -> ZFS. | |
Note: Encryption is recommended for the security conscious. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inspiration for the
zsys-setup
tweaks