where are "legacy" mounts handled

dlaflamme

Dabbler
Joined
Jan 17, 2016
Messages
16
If I run `zfs list`, I see that some dataset mountpoints are listed as "legacy", which means that other tools (not ZFS) will take care of mounting these. Which code/script mounts/can mount these? In this particular case I am referring to .system datasets. I have more than one (probably due to upgrades over the years) and I want to remove the non-current ones but want to check that no other code/scripts have a reference to the old ones marked "legacy".
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You can type df or mount to find the currently active ones.
 

dlaflamme

Dabbler
Joined
Jan 17, 2016
Messages
16
Thanks. Yes, I know that and in general the "legacy" ones that I think can be removed are not actively mounted. Right there I could probably feel pretty safe getting rid of them. However, anyone know the mechanism that TrueNAS does use to mount legacy ones? I don't see fstab entries for the active system dataset, for instance.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Their startup scripts do it, reading the configuration from an SQLite database.
 
Joined
Oct 22, 2019
Messages
3,641
in general the "legacy" ones that I think can be removed are not actively mounted. Right there I could probably feel pretty safe getting rid of them.
Are you referring to the child datasets under the .system dataset which are appended with a string of random numbers?

If so, you can follow this method to figure out which ones are "residual" and no longer being used, hence safe to delete:

EDIT: Don't be fooled by the thread's title. The post I linked to directly is where a second discussion / approach begins for another issue outside of their main problem about data corruption.
 
Last edited:

dlaflamme

Dabbler
Joined
Jan 17, 2016
Messages
16
Their startup scripts do it, reading the configuration from an SQLite database.
That is what I thought as well. In fact, notes I have from 5+ years ago show there used to be a storage_mountpoint table in the freenas-v1.db file. However, that doesn't appear to exist anymore. Further, if I dump the contents of that file as SQL statements and grep for mount, mnt, legacy, etc. I don't see anything. Perhaps the mechanism has changed.
 

dlaflamme

Dabbler
Joined
Jan 17, 2016
Messages
16
Are you referring to the child datasets under the .system dataset which are appended with a string of random numbers?

If so, you can follow this method to figure out which ones are "residual" and no longer being used, hence safe to delete:

Thank you, there are some useful tidbits in that thread.
 
Top