System Dataset is in wrong location

henderbc

Dabbler
Joined
Jul 31, 2015
Messages
26
According to the documentation, the System Dataset's location is determined by choosing the System Dataset Pool.
So under System|System Dataset|Configure System Dataset, I have chosen my one and only pool named 'tank'.
As I understand it, the System Dataset is named '.system'.

Now comes the problem. I have a single dataset named 'Public' under tank, and this is where I store all my files to be shared via SMB. I was expecting the System Dataset to appear at /mnt/tank/.system, but instead it appears at /mnt/tank/Public/.system, and as near as I can tell, it is just a directory - not a dataset.

How do I get it to be located under /mnt/tank rather than /mnt/tank/Public?
 
Joined
Oct 22, 2019
Messages
3,641
What happens when you type:
Code:
zfs list tank/.system

Does it say "dataset does not exist"?

There won't be a directory under /mnt/tank/.system

The System Dataset(s) are mounted under /var/db/path/to/stuff

There is no ".system" folder that sits directly undernearth /mnt/tank/
 
Last edited:

henderbc

Dabbler
Joined
Jul 31, 2015
Messages
26
Yes, zfs list tank/.system does say "dataset does not exist". But that's not where I'm seeing it.

My datasets under Storage|Pools are:
1617144161532.png


System|System Dataset shows this:
1617143886486.png


So, I look at tank and see this:
1617144022423.png


(no .system directory). Then I look under the Public dataset and see:
1617143439759.png

...and the .system directory contains the following:
1617143519668.png

I don't know where this data came from, and I have no idea whether I can delete it.

What am I missing?
 

Attachments

  • 1617143360035.png
    1617143360035.png
    9.8 KB · Views: 169
Joined
Oct 22, 2019
Messages
3,641
Yeah that's really weird. You might have stumbled onto a rare bug by accident.

For the meantime, you can probably fix this by:
  1. Forcing the System Dataset to the boot pool, and click Save
  2. Leave the System Dataset Configuration page
  3. Return to the System Dataset Configuration page
  4. Set the System Dataset location back to the tank pool, and click Save

This should hopefully delete everything under /mnt/tank/Public/.system, and properly place the System Dataset in your tank pool, mounted under /var/db/system. You won't have two copies of the System Dataset, don't worry. Setting it to the boot pool is a one-time trick to clear it from the tank pool. Once you set it back to the tank pool, it will be removed from the boot pool.

Once this is all done, you can check where it is truly mounted using the zfs mount command.
 
Last edited:

henderbc

Dabbler
Joined
Jul 31, 2015
Messages
26
Well, I tried your procedure and it definitely allowed me to move the system dataset around. zfs mount correctly identifies its location.
I'm not sure how the .system directory got into /mnt/tank/Public in the first place so it's probably flotsam. I also noticed the following in the TrueNAS documentation:
1617204830395.png

Thanks much for pointing me in the right direction!
 
Joined
Oct 22, 2019
Messages
3,641
Most welcome! I'm not sure how it got there either, as it should never be placed or mounted directly under /mnt/tank, or /mnt/tank/path/

Remember that datasets themselves are not "directories". The default directory layout in TrueNAS mounts everything under /mnt/poolname/ and every subsequent child dataset is mounted in a folder of the same name. Even though .system is a dataset directly under tank or boot-pool, it's not mounted as /mnt/tank/.system, but rather /var/db/system

To demonstrate this concept, you can create a ZFS pool from scratch on FreeBSD or a recent Linux distro, and manually mount each dataset to wherever you wish.

For example, pool name is test-tank
  • test-tank/stuff -> mounted at /media/mystuff
  • test-tank/docs -> mounted at /home/user/documents
  • test-tank/temp -> mounted at /mnt/tempfiles

Printing a directory listing with the "ls" command is not the same as using "zfs" commands. Confusion arises since things are laid out, for the most part, in a similar structure (i.e, directories vs datasets.)
 
Top