ecdye / zram-config

A complete zram-config utility for swap, directories, and logs to reduce SD, NAND and eMMC block wear.
MIT License
412 stars 53 forks source link

F2FS filesystem compatibility #100

Closed sulisu closed 1 week ago

sulisu commented 1 year ago

I have F2FS on my flash driver and zram-config failed to work. It seems that the code is hard coded to work with ext3 or ext4 filesystem.

I replaced this line in zram-config

mke2fs -v -t "$dirFSType" "/dev/zram${RAM_DEV}" &>> "$ZLOG" || return 1

with

    if [[ $dirFSType == "ext4" ]]; then
        mke2fs -v -t "$dirFSType" "/dev/zram${RAM_DEV}" &>> "$ZLOG" || return 1
    elif [[ $dirFSType == "f2fs" ]]; then
        mkfs.f2fs "/dev/zram${RAM_DEV}" &>> "$ZLOG" || return 1
    fi

Now it works.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

tux-ware commented 1 year ago

Thanks for sharing how to add F2FS support.

stale[bot] commented 12 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ecdye commented 1 week ago

I like the idea behind this, but I would like to explore it more, and see if we could add support for any filesystem type by identifying it dynamically.