Issue Mounting ZFS Dataset After Improper Unmount

I was trying to replicate a dataset to my new SSD, but I must have unmounted it incorrectly. Now, my main dataset is mounted at:
main 1.27T 5.87T 104K /mnt/mnt
When I attempt to mount it using:

sudo zfs mount -a

I get the following error:
cannot mount '/mnt/mnt/main/.system/configs-b17eb1df7fd94a8281208d511a311fb0': failed to create mountpoint: Read-only file system
It seems like the data is still intact, but the dataset isn’t mounted correctly, likely due to a read-only file system issue.
I’ve tried:

  • Running zfs mount -a
  • Checking zfs list to confirm the dataset exists

I’m unsure how to properly remount it given the current state. Any guidance on resolving this would be greatly appreciated.

Thanks in advance.

Why are you playing around in the command-line with zfs mount?

What did you even do before all of this?

It sounds like you tried to manually mount a root dataset into /mnt/, even though the ALTROOT is/should already be set during the pool’s import.

You might have to export the pool and then import it in the GUI, without doing anything special in the command-line.

1 Like

I was being dumb, it was late at night and I wasnt thinking right.
I tried disconnecting the pool but it results in:
[Errno 2] No such file or directory: '/mnt/.ix-apps/app_configs'

Unfortunately, you might have to use the command-line to export the pool, since the GUI/middleware has been thrown off of where things should be located.

zpool export main

I attempted to run the zpool export main command, but when I checked the status of the pool afterward, it indicated that the pool was still online.

I then went ahead and tried to clear the pool’s read-only state using the command:

sudo zfs set readonly=off main

This didn’t seem to have any effect, as the pool remained in a read-only state.
Additionally, I tried manually remounting the pool with:

sudo zfs mount main

This didn’t work either, and the same “read-only file system” errors or pool or dataset is busy kept showing up when I attempted to set the mountpoint:

cannot mount '/mnt/mnt/main': failed to create mountpoint: Read-only file system

After this, I ran a zpool status -v main, which showed no errors but confirmed the pool is in an online state. I also ran dmesg | grep -i zfs but didn’t find any kernel-level errors.

You might have to reboot.

Let this be a learned lesson not to play around in the command-line unless you really know what you’re doing and the caveats involved.

So I cant save the data?
im fine rebooting as long as i can keep my main data

What do you mean “save the data”?

It’s on the pool.

Since you played around in the command-line, you threw off the GUI/middleware on the location of the datasets’ mount paths.

A reboot might correct this and bring you back to normal.

Sorry, I misunderstood.
Im saying that I can’t unmount the main dataset or pool, can I continue with the reboot without affecting it negatively?

Rebooting should not destroy a pool or the data within its datasets.

Imagine if you had a sudden power loss? You think you would lose all your data on ZFS?

@Billy_Joe Please stop trying random commands when you don’t know what you are doing. So far you probably haven’t done anything to prevent recovery but if you keep trying stuff you might make things worse.

Instead listen to what experts like @winnielinnie are saying and follow their instructions.

1 Like

After getting a fresh install, nothing seems to have changed, I still have the datasets messed up and get errors such as this when trying to create a smb share.
[EINVAL] sharingsmb_create.path_local: The path must reside within a pool mount point

Not sure what really happened, and this is why tinkering with commands can land you in a pit.

What does this say:

zpool get altroot

When running zpool get altroot i get:

NAME       PROPERTY  VALUE    SOURCE
boot-pool  altroot   -        default
main       altroot   /mnt     local

That’s after an export, reboot, and reimport?

Weirdly, it appears that the root dataset has been moved down a layer and a mnt dataset inserted as the root. Hence /mnt/mnt/*!!

Yes

What does this reveal?

zfs get mountpoint main

This too:

zfs mount | grep main

Those commands give:

CoadNas% sudo zfs get mountpoint main
NAME  PROPERTY    VALUE          SOURCE
main  mountpoint  /mnt/mnt/main  local

CoadNas% sudo zfs mount | grep main
main/.system                    /var/db/system
main/.system/cores              /var/db/system/cores
main/.system/nfs                /var/db/system/nfs
main/.system/samba4             /var/db/system/samba4
main/.system/configs-ae32c386e13840b2bf9c0083275e7941  /var/db/system/configs-ae32c386e13840b2bf9c0083275e7941
main/.system/netdata-ae32c386e13840b2bf9c0083275e7941  /var/db/system/netdata
main/.system/cores              /var/lib/systemd/coredump
main                            /mnt/mnt/main
main/config                     /mnt/mnt/main/config
main/config/crafty              /mnt/mnt/main/config/crafty
main/config/crafty/backups      /mnt/mnt/main/config/crafty/backups
main/config/crafty/config       /mnt/mnt/main/config/crafty/config
main/config/crafty/import       /mnt/mnt/main/config/crafty/import
main/config/crafty/logs         /mnt/mnt/main/config/crafty/logs
main/config/crafty/servers      /mnt/mnt/main/config/crafty/servers
main/config/frigate             /mnt/mnt/main/config/frigate
main/config/frigate/cache       /mnt/mnt/main/config/frigate/cache
main/config/frigate/config      /mnt/mnt/main/config/frigate/config
main/config/frigate/media       /mnt/mnt/main/config/frigate/media
main/ix-applications            /mnt/mnt/main/ix-applications
main/ix-applications/catalogs   /mnt/mnt/main/ix-applications/catalogs
main/ix-applications/default_volumes  /mnt/mnt/main/ix-applications/default_volumes
main/ix-applications/k3s        /mnt/mnt/main/ix-applications/k3s
main/ix-applications/releases   /mnt/mnt/main/ix-applications/releases
main/ix-applications/releases/immich  /mnt/mnt/main/ix-applications/releases/immich
main/ix-applications/releases/immich/charts  /mnt/mnt/main/ix-applications/releases/immich/charts
main/ix-applications/releases/immich/volumes  /mnt/mnt/main/ix-applications/releases/immich/volumes
main/ix-applications/releases/immich/volumes/ix_volumes  /mnt/mnt/main/ix-applications/releases/immich/volumes/ix_volumes
main/ix-applications/releases/jellyfin  /mnt/mnt/main/ix-applications/releases/jellyfin
main/ix-applications/releases/jellyfin/charts  /mnt/mnt/main/ix-applications/releases/jellyfin/charts
main/ix-applications/releases/jellyfin/volumes  /mnt/mnt/main/ix-applications/releases/jellyfin/volumes
main/ix-applications/releases/jellyfin/volumes/ix_volumes  /mnt/mnt/main/ix-applications/releases/jellyfin/volumes/ix_volumes
main/ix-applications/releases/jellyfin/volumes/ix_volumes/cache  /mnt/mnt/main/ix-applications/releases/jellyfin/volumes/ix_volumes/cache
main/ix-applications/releases/jellyfin/volumes/ix_volumes/config  /mnt/mnt/main/ix-applications/releases/jellyfin/volumes/ix_volumes/config
main/ix-applications/releases/jellyfin/volumes/ix_volumes/transcodes  /mnt/mnt/main/ix-applications/releases/jellyfin/volumes/ix_volumes/transcodes
main/ix-applications/releases/metube  /mnt/mnt/main/ix-applications/releases/metube
main/ix-applications/releases/metube/charts  /mnt/mnt/main/ix-applications/releases/metube/charts
main/ix-applications/releases/metube/volumes  /mnt/mnt/main/ix-applications/releases/metube/volumes
main/ix-applications/releases/metube/volumes/ix_volumes  /mnt/mnt/main/ix-applications/releases/metube/volumes/ix_volumes
main/ix-applications/releases/metube/volumes/ix_volumes/downloads  /mnt/mnt/main/ix-applications/releases/metube/volumes/ix_volumes/downloads
main/ix-applications/releases/minecraft  /mnt/mnt/main/ix-applications/releases/minecraft
main/ix-applications/releases/minecraft/charts  /mnt/mnt/main/ix-applications/releases/minecraft/charts
main/ix-applications/releases/minecraft/volumes  /mnt/mnt/main/ix-applications/releases/minecraft/volumes
main/ix-applications/releases/minecraft/volumes/ix_volumes  /mnt/mnt/main/ix-applications/releases/minecraft/volumes/ix_volumes
main/ix-applications/releases/minecraft/volumes/ix_volumes/data  /mnt/mnt/main/ix-applications/releases/minecraft/volumes/ix_volumes/data
main/sysbackups                 /mnt/mnt/main/sysbackups
main/winshare                   /mnt/mnt/main/winshare
main/winshare/Entertainment     /mnt/mnt/main/winshare/Entertainment
main/winshare/Entertainment/Movie  /mnt/mnt/main/winshare/Entertainment/Movie
main/winshare/Entertainment/Tv-Shows  /mnt/mnt/main/winshare/Entertainment/Tv-Shows
main/winshare/Personal Storage  /mnt/mnt/main/winshare/Personal Storage

Extra info just so everything is up to date:

CoadNas% sudo zpool status -v main
  pool: main
 state: ONLINE
  scan: scrub repaired 0B in 02:47:10 with 0 errors on Thu Feb 20 00:23:56 2025
config:

        NAME                                      STATE     READ WRITE CKSUM
        main                                      ONLINE       0     0     0
          mirror-0                                ONLINE       0     0     0
            e9c0f584-28b7-11ef-8723-74563cdad75a  ONLINE       0     0     0
            e9b74005-28b7-11ef-8723-74563cdad75a  ONLINE       0     0     0

errors: No known data errors

CoadNas% sudo zpool get altroot main
NAME  PROPERTY  VALUE    SOURCE
main  altroot   /mnt     local

CoadNas% sudo zfs get mountpoint,readonly main
NAME  PROPERTY    VALUE          SOURCE
main  mountpoint  /mnt/mnt/main  local
main  readonly    off            local

This must have been done manually.

If your altroot is correct, you should not touch a dataset’s mountpoint (or attempt to manually mount datasets in the command-line) when using TrueNAS.

You can try to reset the mountpoint for the root dataset “main”.

zfs inherit mountpoint main

Then you’ll need to export and reimport the pool.

For all I know, this might cause your server to explode.