Details on How TrueNAS Loads Itself

HarryMuscle

Contributor
Joined
Nov 15, 2021
Messages
161
I was hoping someone could provide some details on how TrueNAS loads itself. I know in the past (5+years ago I believe) it used to use a file system loaded into RAM which meant that any changes made not via the GUI to the configuration of the system were wiped after a reboot. Since it now requires an actual boot drive I assume it no longer loads itself fully into RAM. However, I read a post from this year that talked about changes made not via the GUI being wiped after a reboot. How does TrueNAS accomplish that? Does it use a hybrid approach where the main system is loaded into RAM, configured at each boot based on the GUI configuration files, but then uses a boot drive for things like logs, etc. to have them persist? Or is there some other approach it takes to wipe changes after a reboot unless they were made via the GUI?
 

ChrisRJ

Wizard
Joined
Oct 23, 2020
Messages
1,919
Is there any particular background to this question?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
it no longer loads itself fully into RAM.
Correct since version 9.10

I read a post from this year that talked about changes made not via the GUI being wiped after a reboot. How does TrueNAS accomplish that?
Basically, there's a config database (which is manipulated by the GUI... or by other means if you want to go into risky territory and/or know what you're doing).

The system (not the FreeBSD OS, but the appliance system that iX maintains) reads that config database and writes some things to the OS config files at reboot or at other times... it is also the case that sometimes those OS files aren't used at all and settings are just set according to the database at boot time (or other times). (for example, in SCALE, the middleware doesn't set sysctl via the OS file, just directly runs the items at boot).

It's not really much more complicated than that... maybe the point that each upgrade/update to the appliance effectively re-writes the core install, so anything you messed with like packages may go away at that time.

As a general rule, if you like getting support and for things to work, don't mess with it.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Correct since version 9.10
9.3, actually.
Basically, there's a config database (which is manipulated by the GUI... or by other means if you want to go into risky territory and/or know what you're doing).
Or the API, which is generally safe, but still requires you know what you're doing.
 

HarryMuscle

Contributor
Joined
Nov 15, 2021
Messages
161
Correct since version 9.10


Basically, there's a config database (which is manipulated by the GUI... or by other means if you want to go into risky territory and/or know what you're doing).

The system (not the FreeBSD OS, but the appliance system that iX maintains) reads that config database and writes some things to the OS config files at reboot or at other times... it is also the case that sometimes those OS files aren't used at all and settings are just set according to the database at boot time (or other times). (for example, in SCALE, the middleware doesn't set sysctl via the OS file, just directly runs the items at boot).

It's not really much more complicated than that... maybe the point that each upgrade/update to the appliance effectively re-writes the core install, so anything you messed with like packages may go away at that time.

As a general rule, if you like getting support and for things to work, don't mess with it.
Just to clarify, so it just completely recreates the native Linux configuration files on boot? For example, if I manually modify the smb.conf file, at reboot it will delete this file and recreate it from scratch based on the configuration saved in its own database, correct?

Thanks,
Harry
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Just to clarify, so it just completely recreates the native Linux configuration files on boot? For example, if I manually modify the smb.conf file, at reboot it will delete this file and recreate it from scratch based on the configuration saved in its own database, correct?

It might, or it might not. The appliance does not assume that you are tinkering with its innards. It will regenerate files if and when it feels there is some reason to do so, and you are not guaranteed that this will be when you expect it, or even that such behaviour isn't subject to change in the future.
 

ChrisRJ

Wizard
Joined
Oct 23, 2020
Messages
1,919
And it's not Linux but FreeBSD under the covers :cool:
 
Top