As I mentioned in the title, I’m not looking to save space, I want to test something. In Windows, you could use this option on a folder and still access the contents and run executables while keeping the folder and it’s contents compressed. The benefit to doing this, outside of saving space, is that files could potentially be accessed faster on slower storage devices.

As I’ve been trying to get the most out of some old storage devices I have, I think that something like this would be a great option for this. The only problem is that I’ve tried looking online for a way to do this but search engines are terrible. So, I’m posting about this here in case someone knows of a way to do this.

Edit: I forgot to specify this but I’m trying this for gaming. I know it’s not recommended to this but as a result, I mostly need something that’s not read-only. It might work fine for some games but this obviously wont work for all games.

  • ShimitarA
    link
    fedilink
    English
    arrow-up
    6
    ·
    2 hours ago

    This is at file system level… Checkout btrfs and zfs, I am quite positive both can compress like you want.

    Never used this feature myself, so cannot be more specific.

    Also, there are some read-only compressed filesystems for Linux that you can also use, they offer best compression but data is read only.

    • vortexal@lemmy.mlOP
      link
      fedilink
      arrow-up
      2
      ·
      1 hour ago

      Okay, 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.

      • ShimitarA
        link
        fedilink
        English
        arrow-up
        6
        ·
        1 hour ago

        How small is that device??? Didn’t even knew btrfs has a minimum size.

        After for zfs, you probably have to install some software or kernel patches

        • vortexal@lemmy.mlOP
          link
          fedilink
          arrow-up
          2
          ·
          53 minutes ago

          It’s 128 MB, brtfs needs at least 256 MB. Also yes, I’m aware that I’d need to install something to use zfs but I don’t know where to look to find out what I’d need to install.

          • hendrik@palaver.p3x.de
            link
            fedilink
            English
            arrow-up
            4
            ·
            51 minutes ago

            Huh. My computer allows me to format a 128MB image file with brtfs. It won’t do it at 64MB though.

              • hendrik@palaver.p3x.de
                link
                fedilink
                English
                arrow-up
                1
                ·
                29 minutes ago

                Good call. Seems minimum for ZFS is three quarters of a Gigabyte, anyway. And definitely not made for what OP does 😆

            • vortexal@lemmy.mlOP
              link
              fedilink
              arrow-up
              2
              ·
              50 minutes ago

              How are you trying to format the device? I got that error message when using gparted.

              • hendrik@palaver.p3x.de
                link
                fedilink
                English
                arrow-up
                2
                ·
                edit-2
                12 minutes ago
                truncate -s 128M fs.img  
                parted fs.img  
                  mklabel gpt  
                  mkpart primary btrfs 1MiB 100%  
                  quit  
                sudo losetup --find --partscan --show fs.img  
                sudo mkfs.btrfs /dev/loop0p1  
                

                You should be able to skip the loop device stuff and work on an actual device instead. Seems to me the limit is somewhere between 64M and 128M.

                Edit: But as edinbruh said, maybe try f2fs if it’s a flash device, that’s probably a bit more lightweight?! And since I don’t know what you’re doing… If it’s embedded stuff and you’re alright with read-only, you might want to use squashfs.

          • edinbruh@feddit.it
            link
            fedilink
            English
            arrow-up
            1
            ·
            29 minutes ago

            If it’s a flash memory (sd card, usb stick, ssd, etc), you could try f2fs, it’s very light, and it supports compression and is meant specifically for that kind of devices (well, more for ssds).

            But judging your experience from your comments, I suggest you don’t delve into niche filesystems until you have more experience with Linux, especially for something like 128MB. I especially suggest you avoid zfs for now.

          • edinbruh@feddit.it
            link
            fedilink
            English
            arrow-up
            1
            ·
            32 minutes ago

            Huh. My computer allows me to format a 128MB image file with brtfs. It won’t do it at 64MB though.

      • ShimitarA
        link
        fedilink
        English
        arrow-up
        5
        ·
        1 hour ago

        Xfs and zfs are two different filesystems.