Is is possible to backup/snapshot for rootfs?

For some reason, I have to use apt in my truenas machine.(like install docker mannually) but sometimes apt or any write to rootfs may cause system break, or unable to boot; So is there’s a way to backup rootfs not only the boot pool?

first of all… while it may cause your system to not be “supportable” enabling apt and using it sensibly will absolutely not cause your system to break at random.

what exactly are you installing/doing?

We support creating clones of boot environments in the UI.

I tried upgrade vim, then in next boot, /data is empty and manifest.json is missing; the middlewared will not start

But once the rootfs is modified, seems that boot will be destroy either…

For some reason, I need a libvips-dev package; However apt think it must remove package ‘truenas’

that would break the system… don’t run apt upgrade honestly it has been known to break TrueNAS Scale for as long as it’s existed… unless it’s narrowed to a package you specifically installed and can actually read the output you should only install what you absolutely ever need, and re-install every upgrade…

while I don’t agree locking out apt behind TrueNAS being “supportable”… these sorts of things make me understand why IX did it…

if you really want up-to-date packages and not in a VM… consider the Jailmaker script or wait for Incus support in Fangtooth

I suppose you could fight with docker containers but the way they work in EE means they lack persistence unless you copy and mount the container filesystem elsewhere… so next to useless if you want to install specific software as it will get wiped any time the container is restarted.

read again, it’s a clone, every boot environment has separate datasets.

sudo zfs list -r boot-pool will show you how exactly this is structured.

Thanks for your kindly reply.

I do use docker to avoid dependency problem, but I need to debug application in local environment, this requires some necessary deps.(Maybe a better way is separating dev and deploy)

TLDR:

I tried to completely not use apt at all in my fresh install. This will lead to some inconvenience, like downloading binary and maintain a extra user-space PATH or compiling from source code(like the libvips I needed).

I do use docker to run my services/applications, but in 24.04 there’s no docker in fresh install, and manually manage docker-engine, docker-ce, docker-core, etc is like hell, so I have to disable rootfs-protection to install docker from apt.

For some reason I have to debug service remotely on my Nas, so necessary deps is required in Host.

Sorry for the chaos. This is a confusion for me, maybe this should be the main topic.

First of all, I agree that using apt or modify rootfs without strict check is a dangerous action

The problem I faced

During truenas boot stage, the volume /data is supposed to be mounted before middlewared.service start.

Last time I broke my dependency with apt upgrade, and during boot, /data is never mounted, middlewared.service shows: /data/manifest.json does not exist.

Then I tried to switch boot to earlier clone, the problem occurs the same. Since time is limited, I didn’t do fully research on Why the /data is not mounted correctly. But maybe this shows that the clones on boot-pool is not covering full rootfs?

The Confusion I have

  1. boot clones and shared parts: I’m not familiar to the system boot stage detailed process. So I wonder is there a way to fully clone the boot and rootfs, ensuring all clones will not affecting each other at all? Mentioned above, clues shows that boot clones have shared data part, which may mean the shared part is not protected.
  2. Truenas package management: Why truenas-related packages is fully managed with apt? Maybe important truenas pacakges are supposed to be locked to avoid apt modify or even not managed by apt to make sure system-important packages not break.Either fully-disable apt or freely-open apt may not be good way.

Have you considered simply upgrading to TrueNAS Electric Eel 24.10 where docker is part of the base OS?

1 Like

Yes I will upgrade to 24.10 later since there’s still some service on k3s cannot be smoothly transformed