Is exporting pools safe? Why is there a warning?

EccIsGood

Cadet
Joined
Nov 12, 2023
Messages
3
Hi,

Background story:

I’m looking to move to TrueNAS from Synology.

I’m investigating how to use external USB disks with TrueNAS. That’s what I sometimes do, because… ‘reasons’.

So far, this is what I now:
  • TrueNAS is indifferent to where a pool lives. Doesn’t matter if it’s on a USB drive, or a SATA or SAS drive. A pool is a pool.
  • If I want to disconnect a USB drive, I need to Export the pool on it beforehand. (Will be a single drive pool in my case.)
The problem:

I’m looking at the documentation, and there is a screenshot of the Export/Disconnect Pool screen. There is a warning: “Back up critical data before exporting/disconnecting the pool.” This warning is there both for TrueNAS Core and Scale.

https://www.truenas.com/docs/core/coretutorials/storage/pools/managingpools/

https://www.truenas.com/docs/scale/...le/#exportingdisconnecting-or-deleting-a-pool

The question:

Does this mean there is a risk of data loss when a pool is exported?

Or what is this warning supposed to mean?

I mean, there must be a way to safely export a pool regardless of whether it’s on a USB drive or not. Am I wrong in thinking this? What if someone wants to move a pool to a different host, or export it for whatever reason? Is there no way to safely do that? It would be funny if a pool had to live on the same host forever once it’s created or imported.

When is it safe to export a pool if ever?

NOT the question:

(Please, I’m not interested in comments about the importance of backups, and comments about why using USB drives are a bad idea… I do have backups where I need to have backups. And I want to use USB drives where I need to use USB drives. What I’m interested in though, is the Export Pool functionality, and why it is safe or not safe, and what that warning means.)

Thanks.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Fundamentally, you don't want to interrupt whatever clients are doing without their cooperation. So it's more a warning about data loss on higher levels, whereas as far as ZFS is concerned, there's no risk.
I mean, there must be a way to safely export a pool regardless of whether it’s on a USB drive or not. Am I wrong in thinking this? What if someone wants to move a pool to a different host, or export it for whatever reason? Is there no way to safely do that? It would be funny if a pool had to live on the same host forever once it’s created or imported.
Yeah, that scenario would be absolutely ridiculous, which is why it's not reality. You can export, just make sure clients won't get upset at their storage suddenly disappearing.
 
Joined
Oct 22, 2019
Messages
3,641
As an analogy, it's akin to "safety ejecting" a USB stick from a Windows PC. You can always yank out a USB stick whenever you want, but safely ejecting it beforehand allows the write cache (in RAM) to flush to disk first.

ZFS exports do a bit more than that (there's more involved), but it's the same general concept for the most part.

EDIT: But you should always export your pool before physically unplugging, removing, or moving the drives.


NOW LET ME TELL YOU ABOUT THE IMPORTANCE OF BACKUPS AND THE PROBLEM OF USING USB DRIVES WITH ZFS . . .
 

EccIsGood

Cadet
Joined
Nov 12, 2023
Messages
3
Fundamentally, you don't want to interrupt whatever clients are doing without their cooperation. So it's more a warning about data loss on higher levels, whereas as far as ZFS is concerned, there's no risk.

Yeah, that scenario would be absolutely ridiculous, which is why it's not reality. You can export, just make sure clients won't get upset at their storage suddenly disappearing.
This makes sense. I understand now. Thanks a lot for explaining!
 

EccIsGood

Cadet
Joined
Nov 12, 2023
Messages
3
As an analogy, it's akin to "safety ejecting" a USB stick from a Windows PC. You can always yank out a USB stick whenever you want, but safely ejecting it beforehand allows the write cache (in RAM) to flush to disk first.

ZFS exports do a bit more than that (there's more involved), but it's the same general concept for the most part.

EDIT: But you should always export your pool before physically unplugging, removing, or moving the drives.


NOW LET ME TELL YOU ABOUT THE IMPORTANCE OF BACKUPS AND THE PROBLEM OF USING USB DRIVES WITH ZFS . . .

I understand this, but with that analogy and that warning in TrueNAS, it felt like I would need to worry every time I 'safely eject a USB stick in a Windows PC'. Which is not right, because it is a safe thing to do.

Based on Ericloewe's comment, I think a better analogy would be that 'ejecting a USB stick in Windows' can cause inconsistencies in an application's data if that application is using the USB stick at the time of ejection. But it won't cause a file system level corruption. I hope I'm getting it right.

Thanks for the warning! :grin:
 
Top