Hopefully this is my final edit before getting a full solution but I just want to say that if you are going to either resort to belittling me for not using better/newer hardware or you make it obvious that you haven’t fully read the post before commenting, I’m not going to respond to your comment.

In Windows, there’s a file/folder option called “Compress contents to save disk space”. What it does is it compresses the files, as the name suggests, but leaves them accessible as though they aren’t. This doesn’t really have much of a benefit on newer storage devices but on older storage devices, in addition to saving space, it allows files to potentially read faster.

As I have some old storage devices that I want to run games from, I think this will be a great option to have if I could find something similar for Linux. I tried looking online myself but search engines are terrible and I couldn’t find anything though them. So, I decided to post about this here, to see if anyone knows of anything I could try.

Edit: I have figured out how to use BTRFS and enable what it calls “transparent file compression”. Games are running decently well and I’m able to run games that are much larger than the devices original capacity (it seems to be around 2 to 2.5 times the original free space, on average), so I’m going to use that on most of my old storage devices at least for the time being. The only problem I’m having is that I want to use F2FS on my oldest storage device, as BTRFS takes up too much space on that device.

When formatted to BTRFS, there’s only about 40MB of free space and with compression it can hold around 100MB worth of files. Meanwhile, there’s about 80MB of free space with F2FS and I was told by multiple users that F2FS also supports transparent file compression, which should get me around 200MB worth of files on that device because it’s documented to support the same compression methods as BTRFS. But I can’t get files to compress and I’m not getting any error messages to try and diagnose the problem. Based on what the documentation says, I’m supposed to do something like this:

sudo mkfs.f2fs -f -O extra_attr,inode_checksum,sb_checksum,compression /dev/mmcblk0p1
sudo mount -o compress_algorithm=zstd,compress_extension=* /dev/mmcblk0p1 '/home/j/mountpoint/128mb'
chattr -R +c '/home/j/mountpoint/128mb'

The device will mount like this but files aren’t compressing when added, nor are they compressed if using the last command after they’ve been moved.

  • tiptoes@sh.itjust.works
    link
    fedilink
    arrow-up
    46
    ·
    6 months ago

    The equivalent would be either zfs or btrfs compression. Transparent to applications, you don’t have to do anything special other than enable it.

    • vortexal@lemmy.mlOP
      link
      fedilink
      arrow-up
      6
      ·
      6 months ago

      As I mention in another comment, I’m having a bit of a problem. I tried the smallest device first but it’s too small for btrfs and I can’t figure out how to format devices in zfs. Unless xfs is the same as zfs, the option isn’t available in gparted and mkfs gives an error saying that the zfs file doesn’t exist. If it’s possible to install zfs through apt, “apt search zfs” gives a lot of results for zfs.

      • tiptoes@sh.itjust.works
        link
        fedilink
        arrow-up
        8
        ·
        6 months ago

        How small are these devices? I think the other problem is that neither BTRFS nor zfs really are suitable for removable devices, and definitely not for ones smaller than probably 8Gb at the very least.

        Unlike NTFS which is just a file system, both BTRFS and ZFS do volume management too, so it’s not just a single partition thing; they prefer to take over an entire volume and manage everything.

        So while they’re the closest filesystem with NTFS-like transparent compression……they don’t match exactly.

        I also hazard to guess if the devices you’re using are too small to accept a BTRFS formatted volume, no amount of compression is going to be enough to fit what you need.

        • vortexal@lemmy.mlOP
          link
          fedilink
          arrow-up
          1
          ·
          6 months ago

          I apparently already have it installed but mkfs still thinks that zfs isn’t available. Am I supposed to use something else?

          • ivn@tarte.nuage-libre.fr
            link
            fedilink
            Français
            arrow-up
            5
            arrow-down
            1
            ·
            edit-2
            6 months ago

            You’ll need to read the documentation to understand its concepts first. You don’t use mkfs but zpool to create a pool then use zfs to create the fs on it. ZFS is usually used with some sort of raid configuration so most doc will show this but you can create a pool with no replication using a single drive.

      • BananaTrifleViolin@piefed.world
        link
        fedilink
        English
        arrow-up
        6
        ·
        edit-2
        6 months ago

        How small is your smallest device? BTRFS doesn’t have a minimum size, but practically probably 50-100mb is just about doable before even just setting things up get complex. Having said that though, it’s copy-on-write and has overhead as a result, so may not function well below 1gb.

        ZFS meanwhile really won’t work well below probably 8gb. It’s also copy-on-write but with a lot more overhead due to how it works. It really works best on big drives and filesystems.

        If your old storage is in the mb range, then really neither will help you achieve what you want.

        BTRFS and ZFS do offer the same benefits as NTFS with regard to compression and speeding up some slower devices (due to lowering the actual read/writes needed to achieve the same result as the data is compressed into a smaller space and decompressed rapidly by the PC in memory), but NTFS can go be used on much smaller disk sizes due to how it works. BTRFS and ZFS are designed and optimised with other benefits in mind. And NTFS compression isn’t well supported in Linux.