Hi everyone, I’ve been working on my homelab for a year and a half now, and I’ve tested several approaches to managing NAS and selfhosted applications. My current setup is an old desktop computer that boots into Proxmox, which has two VMs:

  • TrueNAS Scale: manages storage, shares and replication.
  • Debian 12 w/ docker: for all of my selfhosted applications.

The applications connect to the TrueNAS’ storage via NFS. I have two identical HDDs as a mirror, another one that has no failsafe (but it’s fine, because the data it contains is non-critical), and an external HDD that I want to use for replication, or some other use I still haven’t decided.

Now, the issue is the following. I’ve noticed that TrueNAS complains that the HDDs are Unhealthy and has complained about checksum errors. It also turns out that it can’t run S.M.A.R.T. checks, because instead of using an HBA, I’m directly passing the entire HDDs by ID to the VM. I’ve read recently that it’s discouraged to pass virtualized disks to TrueNAS, as data corruption can occur. And lately I was having trouble with a selfhosted instance of gitea, where data (apparently) got corrupted, and git was throwing errors when you tried to fetch or pull. I don’t know if this is related or not.

Now the thing is, I have a very limited budget, so I’m not keen on buying a dedicated HBA just out of a hunch. Is it really needed?

I mean, I know I could run TrueNAS directly, instead of using Proxmox, but I’ve found TrueNAS to be a pretty crappy Hypervisor (IMHO) in the past.

My main goal is to be able to manage the data that is used in selfhosted applications separately. For example, I want to be able to access Nextcloud’s files, even if the docker instance is broken. But maybe this is just an irrational fear, and I should instead backup the entire docker instances and hope for the best, or maybe I’m just misunderstanding how this works.

In any case, I have some data that I want to store and want to reliably archive, and I don’t want the docker apps to have too much control over it. That’s why I went with the current approach. It has also allowed for very granular control. But it’s also a bit more cumbersome, as everytime I want to selfhost a new app, I need to configure datasets, permissions and mounting of NFS shares.

Is there a simpler approach to all this? Or should I just buy an HBA and continue with things as they are? If so, which one should I buy (considering a very limited budget)?

I’m thankful for any advice you can give and for your time. Have a nice day!

  • Possibly linux@lemmy.zip
    link
    fedilink
    English
    arrow-up
    3
    ·
    7 hours ago

    I hope you have backups

    Never should you pass disks though by VM. The disk and SMART data is not passed though so ZFS has no way of knowing disk status. It also has more overhead than just passing though a PCIe device.

    I would strongly recommend that you fix this ASAP

  • rumba@lemmy.zip
    link
    fedilink
    English
    arrow-up
    2
    ·
    7 hours ago

    I would probably shy away from passing the raw disk. There are a few dozen ways to skin that, But in the end I would probably just mount the disc through NFS,smb, whatever it takes. Reading that smart data is paramount for your situation. You could have a bad cable and never know it.

    You could run a couple of VMs K8S and longhorn the data, It’s capable of backing up to an S3 compliant storage.

    For my home stuff at the moment I’m running unraid with a BTRFS and a parity disc. The first every month I run a scrub if I had any corruption it would find it for me and alert me. It’s slow as balls but more protection is better than less. You can also buy some recycled discs and keep a offline store. I don’t love the recycled discs but for backup purposes that aren’t running 24x7 they’re better than nothing.

  • ikidd@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 hours ago

    I run a docker host in Proxmox using ZFS datasets for the VM storage for things like my mailserver and NexcloudAIO. When I backup the docker VM, it snapshots the VM at a point in time, and backs up the snapshot to PBS. I’ve restored from that backup and it’s like the machine had just shut down as far as the data is concerned. It journals itself back to a consistent state and no data loss.

    I wouldn’t run TrueNAS at all because I have no idea how that’s managing it’s storage and wouldn’t trust the result.

  • SayCyberOnceMore@feddit.uk
    link
    fedilink
    English
    arrow-up
    3
    ·
    15 hours ago

    You should have all your data separately stored, it shouldn’t be locked inside containers, and using a VM hosted on a device to serve the data is a little convoluted

    I personally don’t like TrueNAS - I’m not a hater, it just doesn’t float my boat (but I suspect someone will rage-downvote me 😉)

    So, as an alternative approach, have a look at OpenMediaVault

    It’s basically a Debian based NAS designed for DIY systems, which serves the local drives but it also has docker on, so feels like it might be a better fit for you.

  • frongt@lemmy.zip
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    21 hours ago

    If you pass a whole raw disk, not virtualized, then TrueNAS should not complain. I don’t know if you can do that in proxmox, I haven’t tried.

    Personally I’d get rid of TrueNAS. Even if docker is down, the VM with the data is still up and accessible over anything running on the VM, like scp via ssh.

    • Possibly linux@lemmy.zip
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      7 hours ago

      If you pass the disk the meta data isn’t passed though including SMART data so it is a ticking time bomb.

    • thelemonalex@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      16 hours ago

      I passed the whole raw disk in theory, but I’ve read that even if you do that, it’s still virtualized somehow. But I don’t know enough about it, I’m just basing this on the research I’ve done so far. About skipping TrueNAS, maybe you’re right, but if I also want to set up SMB shares? Is there a tool or something that makes it easy for someone with limited experience? It would also need to handle replication of data, and the advantage of ZFS Replication over using something like rsync, is that you can simply push the delta between snapshots, instead of replacing entire files, or at least that’s how I’ve understood this.

  • AlexGreen@techhub.social
    link
    fedilink
    arrow-up
    3
    ·
    21 hours ago

    @thelemonalex I usually find that sata cable or connector are bad.

    Personally I use proxmox as a host and share bulky nfs mounts for each VM like Immich, Plex/Jellyfin. For gitea and other small VM - use VM virtual drive and back it up periodically

    • thelemonalex@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      16 hours ago

      So if I understand correctly, you’re managing the storage directly within Proxmox, instead of using a VM for that, right? Are the tools good? Does it support ZFS replication, SMB and things like that? Edit: I’ll also check the SATA cables, thanks!

      • AlexGreen@techhub.social
        link
        fedilink
        arrow-up
        2
        ·
        15 hours ago

        @thelemonalex I use native linux nfs server. Manage shares using /etc/exports file.

        For SMB, I use vm with samba and mount a few folders over nfs from proxmox (it just gives me a static IP in case if I decide to change something from proxmox side).

        I manage zfs on the proxmox host. I think you can’t export zfs dataset to be managed by VM (except drive passthrough).

        My infra has 1 proxmox bulky node with 2 HDD (zfs) and 3 nodes with small ssd/nvme in the cluster.

  • philoko@ani.social
    link
    fedilink
    English
    arrow-up
    3
    ·
    21 hours ago

    I was in somewhat of a similar situation but some of the SATA ports were bad and ended up buying a cheap SATA to PCIE card and passing it instead but that still had some issues so I ended up moving TrueNAS to its own dedicated machine and haven’t had any problems since.

    Just my two cents.

    • Nollij@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      4
      ·
      18 hours ago

      To anyone reading, do NOT get a PCIe SATA card. Everything on the market is absolute crap that will make your life miserable.

      Instead, get a used PCIe SAS card, preferably based on LSi. These should run about $50, and you may (depending on the model) need a $20 cable to connect it to SATA devices.

      • Possibly linux@lemmy.zip
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        7 hours ago

        I have a cheap PCIe card I bought and it works fine.

        It cost like $15 and has been rock solid. What is the issue?

        • Nollij@sopuli.xyz
          link
          fedilink
          English
          arrow-up
          1
          ·
          7 hours ago

          The one I had would frequently drop the drives, wreaking havoc on my (software) RAID5. I later found out that it was splitting 2 ports into 4 in a way that completely broke spec.

      • thelemonalex@lemmy.worldOP
        link
        fedilink
        English
        arrow-up
        1
        ·
        16 hours ago

        Are there any specific limitations/requirements? Any recommended models or things to look out for? I looked on Amazon, and they range from around $30 to $200, and I really have no criteria, and I want to spend as little as possible.

        • fuckwit_mcbumcrumble@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          1
          ·
          13 hours ago

          If it’s an LSI card then make sure it’s either been flashed into IT mode, is capable of being flashed into IT mode, or is relatively modern and has that option built in.

          What you really want is an HBA, but HBAs can be expensive, a raid card flashed to act as an HBA is typically much cheaper. A 6 gbit SAS card will do 3gbit sata, and no hard drive should be writing more than 3gbit. If you want to do SSDs then find a relatively more modern 12 gbit SAS card which will do 6gb sata.

          I guess also look out for the REALLY old ones that won’t do over like 3tb. But I bought one of those for $20 almost 10 years ago so that shouldn’t be a concern. Those are probably all in the trash by now.

        • Nollij@sopuli.xyz
          link
          fedilink
          English
          arrow-up
          1
          ·
          15 hours ago

          I don’t want to speak to your specific use case, as it’s outside of my wheelhouse. My main point was that SATA cards are a problem.

          As for LSi SAS cards, there’s a lot of details that probably don’t (but could) matter to you. PCIe generation, connectors, lanes, etc. There are threads on various other homelab forums, truenas, unraid, etc. Some models (like the 9212-4i4e, meaning it has 4 internal and 4 external lanes) have native SATA ports that are convenient, but most will have a SAS connector or two. You’d need a matching (forward) breakout cable to connect to SATA. Note that there are several common connectors, with internal and external versions of each.

          You can use the external connectors (e.g. SFF-8088) as long as you have a matching (e.g. SFF-8088 SAS-SATA) breakout cable, and are willing to route the cable accordingly. Internal connectors are simpler, but might be in lower supply.

          If you just need a simple controller card to handle a few drives without major speed concerns, and it will not be the boot drive, here are the things you need to watch for:

          • MUST be LSi, but it can be rebranded LSi. This includes certain cards from Dell and IBM, but not all.
          • Must support Initiator Target (IT) mode. The alternative is Initiator RAID (IR) mode. This is nearly all, since most can be flashed to IT mode regardless
          • Watch for counterfeits! There are a bunch of these out there. My best advice is to find IT recyclers on eBay. These cards are a dime a dozen in old, decommissioned servers. They’re eager to sell them to whomever wants them.

          Also, make sure you can point a fan at it. They’re designed for rackmount server chassis, so desktop-style cases don’t usually have the airflow needed.

    • thelemonalex@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      16 hours ago

      Thank you, that’s actually very helpful, because I’m also kinda concerned that the HBA (or SATA to PCIE card) solution won’t fix this issue entirely, and it’s also relatively old system, and I’m worried about compatibility. Having two machines though is also kind of out of the question, because I don’t want to use that much electricity, it’s pretty expensive here where I live. I do have a Raspberry Pi, which could be used for some selfhosted services, but not the demanding ones, and not running alongside each other. I mean, my current PC sometimes struggles already, so I guess the Raspberry Pi will perform even worse… Maybe I can find a solution that allows to still manage storage reliably and flexibly, and also be able to have docker containers.

      • philoko@ani.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        10 hours ago

        TrueNAS Scale is the Linux version of TrueNAS with docker support. Might be worth looking into. It also supports doing an in place upgrade from Core but you wont be able to revert the same way.

  • carzian@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    20 hours ago

    If you’re only doing a VM or two, I’d get rid of proxmox and run truenas directly. It’s gotten better for VMs.

    Also make sure you read up on the ecc requirements for truenas if you’re not using ecc ram

    • thelemonalex@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      16 hours ago

      And is it easy for the docker instances inside the VM to access the host’s datasets? About ECC, thank you for bringing it up, because I actually have no idea on the subject, and I’m sure that my current ram isn’t ECC. I’ll look into it. It could explain the issue I had with gitea, right?

  • BCsven@lemmy.ca
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    1
    ·
    21 hours ago

    Send your question to the podcasters at 2.5admins, this seems right up their alley.

    • thelemonalex@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      16 hours ago

      Thank you, I might raise the issue there, if I struggle to fix the issue. I didn’t know the podcasters, but now I’ll try and listen to a few episodes, and maybe I can continue learning. Thank you for the suggestion

      • BCsven@lemmy.ca
        link
        fedilink
        English
        arrow-up
        1
        ·
        10 hours ago

        They always do Free consulting on air, so if your issue gets to them and they have a spot, you get a very very competant answer