Skip to content

Commit

Permalink
Add support for alternate filesystems
Browse files Browse the repository at this point in the history
Fixes #100

Signed-off-by: Ethan Dye <[email protected]>
  • Loading branch information
ecdye committed Jun 22, 2024
1 parent ca1e2b8 commit c9debbb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Experimental Alpine support has also been added, other distributions may work bu
- [Conflicts with services](#conflicts-with-services)
- [Swapiness on older Linux kernel versions](#swapiness-on-older-linux-kernel-versions)
- [Raspberry Pi 4 8GB compatibility](#raspberry-pi-4-8gb-compatibility)
- [Filesystem compatibility](#filesystem-compatibility)
7. [Performance](#performance)
8. [Reference](#reference)

Expand Down Expand Up @@ -193,6 +194,13 @@ The Raspberry Pi 4 8GB model can exhibit issues with zram due to a Linux kernel
This bug has been fixed as of Raspberry Pi Kernel version 1.20210527.
See [raspberrypi/linux@cef3970381](https://github.com/raspberrypi/linux/commit/cef397038167ac15d085914493d6c86385773709) for more details about the issue.

#### Filesystem compatibility

By default zram-config should support most regular filesystems, as long as the tools are installed and available on the host system.
In some cases, with niche filesystems some manual editing of the code may be required to enable support.

Pull requests adding support for filesystems that don't work automatically are welcome.

### Performance

LZO-RLE offers the best performance and is probably the best choice, and from kernel 5.1 and onward it is the default.
Expand Down
3 changes: 2 additions & 1 deletion zram-config
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ createZdir() {
echo "createZdir: dirMountOpt - ${dirMountOpt}; dirFsType: ${dirFSType}" >> "$ZLOG"
createZdevice || return 1

mke2fs -v -t "$dirFSType" "/dev/zram${RAM_DEV}" &>> "$ZLOG" || return 1
# shellcheck disable=SC2086
[[ -x $(command -v mkfs.$dirFSType) ]] && mkfs.$dirFSType -v "/dev/zram${RAM_DEV}" &>> "$ZLOG" || return 1
mkdir -p "${ZDIR}/zram${RAM_DEV}" &>> "$ZLOG" || return 1
mount --verbose --types "$dirFSType" -o "$dirMountOpt" "/dev/zram${RAM_DEV}" "${ZDIR}/zram${RAM_DEV}/" &>> "$ZLOG" || return 1
mkdir -p "${ZDIR}/zram${RAM_DEV}/upper" "${ZDIR}/zram${RAM_DEV}/workdir" "$TARGET_DIR" &>> "$ZLOG" || return 1
Expand Down

0 comments on commit c9debbb

Please sign in to comment.