TrueNAS on USB drive

thereverend

Dabbler
Joined
Apr 13, 2020
Messages
36
Is it possible to install TrueNAS on a USB drive so I do not have to have a whole bay ate up by the OS?
And if so HOW would I install TrueNAS on a USB stick so that the server boots to it every time? Thanks in advance.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,398
While possible, this is no longer recommended, since TrueNAS will burn out the thumb drive very quickly. Thumb drives just aren't engineered for the constant reads/writes TrueNAS needs.

What is recommended nowadays is a small SSD, like a DOM (disk on module), which plugs directly into a SATA port. A USB M.2 adapter also works.

As for forcing the small SSD to be the first in your BIOS's boot order, that's something you'll have to spelunk around your BIOS to determine.
 

thereverend

Dabbler
Joined
Apr 13, 2020
Messages
36
Is there a way to make it so that TrueNAS does not constantly read/write from the host disk? I have noticed this on my server that the 1 HD just keep running all day and night and never stops. This appears to be excessive and un-needed
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,398
The system dataset has to live somewhere. If not on the boot pool, then your data pool. See System->System Dataset to set its location. It's recommended to put this on your data pool.
 

thereverend

Dabbler
Joined
Apr 13, 2020
Messages
36
So will this stop the drive from constantly running? or is there a setting that allows that drive to sleep if it is not accessed and the wake up if a FTP or HTTP ect request is received ?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,398
The system dataset is in constant use, which is why a small SSD is recommended. However, sleeping your disks increases the number of start/stop cycles and shortens their useful life. It's better to keep them spinning constantly for long life.
 

truenasfan

Cadet
Joined
Jul 24, 2021
Messages
6
This is a curious post. Having used Unraid, I'm a real big fan of their methodology for using a single USB flash drive and reducing / eliminating the r/w access on it to a near zero amount. Can't TrueNAS SCALE also accomplish this?

Also, if you won't make this work, then how do USB connected rotary drives work in this scenario? What kind of speed do you lose on a USB2 vs USB3? How much continual r/w is actually going on?

This really seems like overkill and I'd love to understand why you're using the root filesystem in this capacity in terms of needing to do so much writing....
 

ChrisRJ

Wizard
Joined
Oct 23, 2020
Messages
1,904
This really seems like overkill and I'd love to understand why you're using the root filesystem in this capacity in terms of needing to do so much writing....
It can indeed be seen as overkill, relative to what is possible if one wants to put in the necessary effort. But you need to aware that the target audience of TrueNAS is different from e.g. Unraid. TrueNAS is made for enterprise usage (or at least larger SMBs). And all the issues mentioned in this thread become non-issues immediately, because companies see this differently. Yes, what has been written about here can be done. But it covers an edge-case (although you probably perceive this differently, which is ok) and so I would not expect it to happen.
 
Joined
Oct 22, 2019
Messages
3,580
This really seems like overkill and I'd love to understand why you're using the root filesystem in this capacity in terms of needing to do so much writing....
I share this frustration. It's all because of the System Dataset, really, as you can see the writes to the boot device are nearly zero, and very rare once you relocate the System Dataset to another pool (either the data pool or a spare SSD.) The constant "clicks" during idle periods that users hear on their spinning HDDs goes away once they remove the System Dataset from said data pool.

Perhaps someone can better explain why the System Dataset needs persistent storage (and constant writes every 5 minutes during a period of inactivity), rather than living in RAM for longer periods of time between writes?

system-dataset-constant-writes.png


The above "EKG pattern" of spikes every five minutes is during a period of inactivity. Nothing is streaming. No SMB shares are being used. No scrubs are being done. Why can't this activity remain in RAM indefinitely or at least for prolonged periods? Why the need to constantly write to the disk?

Correct me if I'm wrong, but if I "lose" my System Dataset, and reboot, won't I still have all of my configurations, SMB shares, etc, and a new System Dataset will be created from scratch? If that's the case, it can't be that critical to have to write to it (on disk) every 5 minutes?
 
Last edited:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,398
Perhaps someone can better explain why the System Dataset needs persistent storage (and constant writes every 5 minutes during a period of inactivity), rather than living in RAM for longer periods of time between writes?

The system dataset is where syslogs are kept, and also where the Reporting graph data is stored.
 

truenasfan

Cadet
Joined
Jul 24, 2021
Messages
6
@winnielinnie makes a good point about either pushing the writes out further OR allowing us to control the frequency of writes. Aggregate them onto a ramdisk and then dump them at a desired interval that the user can set in order to reduce cycles on the drive(s). This could be then adapted to be more conducive to a USB drive in that it could dump when a size is reached and/or the system is rebooted and/or when a kernel panic is achieved (which could then signal to dump everything if you can stop the device gracefully). Otherwise it would be good to keep a cache of these things on the data volume and then move them onto the system or USB device at the defined interval so as to not lose the log data.
 

LayerIIX

Cadet
Joined
Jul 28, 2021
Messages
1
So, maybe I'm confused here, but if you're concerned about the massive amounts of writes, why would the official recommendation be a small SSD? Smaller SSD's typically have much lower TBW than larger ones, and to be fair, I don't know what the TBW would be for an average flash drive, but why not recommend a platter drive instead?
 

ChrisRJ

Wizard
Joined
Oct 23, 2020
Messages
1,904
The write amount is not massive and any normal SSD will have no problems with it. But it will be too much for USB sticks to last very long.
 

QuantumLeaper

Dabbler
Joined
Aug 13, 2020
Messages
18
The write amount is not massive and any normal SSD will have no problems with it. But it will be too much for USB sticks to last very long.
My friend found out a USB Install will last about 10 to 12 months. He has had better luck than me, I had an NVME drive, a SATA SSD (both were between 1 and 2 years old out of warranty), and a 6-year-old HD all Dead in the past year or so.
 

benze

Dabbler
Joined
Dec 30, 2013
Messages
17
The system dataset has to live somewhere. If not on the boot pool, then your data pool. See System->System Dataset to set its location. It's recommended to put this on your data pool.

I realize this is an older thread, but I'm confused about something. If the system dataset is moved from the boot pool to the data pool, would that not limit/eliminate the heavy read/write cycles to the boot device, thereby making a USB thumb drive usable in this context?

Or are there other heavy write loads that occur to the boot disk?

Thanks,

Eric
 

scandrew

Cadet
Joined
Sep 22, 2021
Messages
5
I realize this is an older thread, but I'm confused about something. If the system dataset is moved from the boot pool to the data pool, would that not limit/eliminate the heavy read/write cycles to the boot device, thereby making a USB thumb drive usable in this context?

Or are there other heavy write loads that occur to the boot disk?

Thanks,

Eric
I am actually wondering about this exact point. I wonder why no one responded
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
USB Sticks/thumb drives ARE usable and always have been.

This forum doesn't recommend them (and has petitioned iX to make similar recommendations in the product documentation) due to the lack of reliability we see and in particular have witnessed since the change from 9.x when the OS was held in RAM.

Using a USB2 stick (or a USB3 stick in a USB2 port) can help to prolong the life, but can't brush aside the shortcomings of the cheap/low quality components used in those products... even the ones from "reputable" vendors.

The fact that the boot pool is ZFS means that you can't escape the nature of any writes which are needed on the boot pool being subject to the same ZFS transaction grouping as the data pools... and it's that transaction grouping and the resulting bursts of writes that put unsustainable pressure on the weak components in USB sticks.

That said, there are many far preferable options available for boot media which include SSDs attached via USB to SATA adapters, so there's virtually no way to say there's no other option than using a USB stick (not even due to cost... these are around 30 USD for 128GB https://www.intenso.de/en/products/solid-state-drives/external-SSD-premium).

Where iX makes their money with TrueNAS is with Enterprises for the most part, so customizing the system in a way that goes against what Enterprises want in a NAS (reliable logging and performance measurement) isn't likely to get much attention (but feel free to make a feature request to turn off reports and system logs at user discretion).

I guess there hasn't been much interest in responding to this as the more experienced of us here are getting tired of talking about USB sticks... they're dead to us.

If you're not keen on this direction, I don't know much about the current state of Xigmanas (formerly Nas4Free... http://xigmanas.com), which forked from FreeNAS a long way back, but they may still have the boot pool (optionally) on UFS, so maybe that's a better fit for your hardware if you insist on USB sticks for boot media.
 
Last edited:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,398
is it necessary to install truenas on 2 disk? so i will need 2 x usb to m2

It used to be, when thumb drives were recommended. Nowadays, a single drive is fine. Just remember to back up your config, for easy recovery from a failed boot pool.
 
Top