Solved Files not visible after restart.

The files are mounted, but not visible before i unmount and remount the dataset, then after a rebot the files are gone, any ideas?

Code:
[anders@yogabsd] ~% ls /usr/home/anders/git/
[anders@yogabsd] ~% zfs mount | grep git
tank/git                        /usr/home/anders/git
[anders@yogabsd] ~% zfs list -r tank/git
NAME       USED  AVAIL  REFER  MOUNTPOINT
tank/git   792M   185G   792M  /home/anders/git
[anders@yogabsd] ~% zfs mount tank/git
cannot mount 'tank/git': filesystem already mounted
[anders@yogabsd] ~% zfs umount tank/git
cannot unmount '/usr/home/anders/git': Operation not permitted
[anders@yogabsd] ~% sudo zfs umount tank/git
Passord:
[anders@yogabsd] ~% sudo zfs mount tank/git
[anders@yogabsd] ~% ls /usr/home/anders/git/
glapal.src Sql
 
Last edited by a moderator:
Permissions? Could it be that the file system was mounted in such a fashion that the user did not have x permission on that directory?
 
Code:
[anders@yogabsd] ~% ls -l | grep git
drwxr-xr-x  2 anders  anders           2 28 nov. 12:07 git
[anders@yogabsd] ~% sudo ls -l | grep git
Passord:
-rw-r--r--   1 anders  anders          60 22 nov. 17:37 .gitconfig
drwxr-xr-x   2 anders  anders           2 28 nov. 12:07 git
[anders@yogabsd] ~% sudo ls -l git
total 0

Can`t see that being the problem and even while running ls like root i still can`t find any files, without unmounting and re mounting the dataset, but thanks for the input, any other ideas?
 
Last edited by a moderator:
Can you provide the full output of mount while in the mounted-but-not-visible state? Likewise of zfs list -ro canmount,mounted,mountpoint,name ?
 
Just to make sure there is no misunderstanding.

What do you mean with "restart"?
Reboot or resume (from suspend)?
 
Code:
[anders@yogabsd] ~% mount
tank/ROOT/12.0-CURRENT-up-20171120_013227 on / (zfs, local, noatime, nfsv4acls)
devfs on /dev (devfs, local, multilabel)
tmpfs on /libexec/rc/init.d (tmpfs, local, noexec, nosuid)
procfs on /proc (procfs, local)
linprocfs on /compat/linux/proc (linprocfs, local)
tmpfs on /compat/linux/dev/shm (tmpfs, local)
tank/git on /usr/home/anders/git (zfs, local, nfsv4acls)
tank/iocage on /iocage (zfs, local, nfsv4acls)
tank/iocage/download on /iocage/download (zfs, local, nfsv4acls)
tank/iocage/download/11.1-RELEASE on /iocage/download/11.1-RELEASE (zfs, local, nfsv4acls)
tank/iocage/images on /iocage/images (zfs, local, nfsv4acls)
tank/iocage/jails on /iocage/jails (zfs, local, nfsv4acls)
tank/iocage/log on /iocage/log (zfs, local, nfsv4acls)
tank/iocage/releases on /iocage/releases (zfs, local, nfsv4acls)
tank/iocage/templates on /iocage/templates (zfs, local, nfsv4acls)
tank/iocell on /iocell (zfs, local, nfsv4acls)
tank/iocell/download on /iocell/download (zfs, local, nfsv4acls)
tank/iocell/jails on /iocell/jails (zfs, local, nfsv4acls)
tank/iocell/jails/7fe287a9-cfa5-11e7-851c-7c7a912b8b71 on /iocell/jails/7fe287a9-cfa5-11e7-851c-7c7a912b8b71 (zfs, local, nfsv4acls)
tank/iocell/jails/7fe287a9-cfa5-11e7-851c-7c7a912b8b71/root on /iocell/jails/7fe287a9-cfa5-11e7-851c-7c7a912b8b71/root (zfs, local, nfsv4acls)
tank/iocell/jails/84f72c78-bccd-11e7-8a43-7c7a912b8b71 on /iocell/jails/84f72c78-bccd-11e7-8a43-7c7a912b8b71 (zfs, local, nfsv4acls)
tank/iocell/jails/84f72c78-bccd-11e7-8a43-7c7a912b8b71/root on /iocell/jails/84f72c78-bccd-11e7-8a43-7c7a912b8b71/root (zfs, local, nfsv4acls)
tank/iocell/releases on /iocell/releases (zfs, local, nfsv4acls)
tank/iocell/templates on /iocell/templates (zfs, local, nfsv4acls)
tank/tmp on /tmp (zfs, local, nosuid, nfsv4acls)
tank/usr/home on /usr/home (zfs, local, nfsv4acls)
tank/usr/home/anders on /usr/home/anders (zfs, local, nfsv4acls)
tank/usr/jails on /usr/jails (zfs, local, nfsv4acls)
tank/usr/local/share/doc on /usr/local/share/doc (zfs, local, nfsv4acls)
tank/usr/obj on /usr/obj (zfs, local, nfsv4acls)
tank/usr/ports on /usr/ports (zfs, local, nfsv4acls)
tank/usr/src on /usr/src (zfs, local, nfsv4acls)
tank/var/audit on /var/audit (zfs, local, nfsv4acls)
tank/var/log on /var/log (zfs, local, noexec, nosuid, nfsv4acls)
tank/var/mail on /var/mail (zfs, local, nfsv4acls)
tank/var/tmp on /var/tmp (zfs, local, noexec, nosuid, nfsv4acls)
map -hosts on /net (autofs)
map -automount on /autofs (autofs)
/dev/fuse on /usr/home/anders/.gvfs (fusefs, local, nosuid, synchronous, mounted by anders)
[anders@yogabsd] ~% zfs list -ro canmount,mounted,mountpoint,name
CANMOUNT  MOUNTED  MOUNTPOINT                                               NAME
      on       no  none                                                     tank
      on       no  none                                                     tank/ROOT
  noauto       no  /                                                        tank/ROOT/12.0-CURRENT-up-20171025_151420
  noauto       no  /                                                        tank/ROOT/12.0-CURRENT-up-20171029_181554
  noauto      yes  /                                                        tank/ROOT/12.0-CURRENT-up-20171120_013227
  noauto       no  /mnt                                                     tank/ROOT/initial
      on      yes  /home/anders/git                                         tank/git
      on      yes  /iocage                                                  tank/iocage
      on      yes  /iocage/download                                         tank/iocage/download
      on      yes  /iocage/download/11.1-RELEASE                            tank/iocage/download/11.1-RELEASE
      on      yes  /iocage/images                                           tank/iocage/images
      on      yes  /iocage/jails                                            tank/iocage/jails
      on      yes  /iocage/log                                              tank/iocage/log
      on      yes  /iocage/releases                                         tank/iocage/releases
      on      yes  /iocage/templates                                        tank/iocage/templates
      on      yes  /iocell                                                  tank/iocell
      on      yes  /iocell/download                                         tank/iocell/download
      on      yes  /iocell/jails                                            tank/iocell/jails
      on      yes  /iocell/jails/7fe287a9-cfa5-11e7-851c-7c7a912b8b71       tank/iocell/jails/7fe287a9-cfa5-11e7-851c-7c7a912b8b71
      on      yes  /iocell/jails/7fe287a9-cfa5-11e7-851c-7c7a912b8b71/root  tank/iocell/jails/7fe287a9-cfa5-11e7-851c-7c7a912b8b71/root
      on      yes  /iocell/jails/84f72c78-bccd-11e7-8a43-7c7a912b8b71       tank/iocell/jails/84f72c78-bccd-11e7-8a43-7c7a912b8b71
      on      yes  /iocell/jails/84f72c78-bccd-11e7-8a43-7c7a912b8b71/root  tank/iocell/jails/84f72c78-bccd-11e7-8a43-7c7a912b8b71/root
      on      yes  /iocell/releases                                         tank/iocell/releases
      on      yes  /iocell/templates                                        tank/iocell/templates
      on      yes  /tmp                                                     tank/tmp
     off       no  none                                                     tank/usr
      on      yes  /usr/home                                                tank/usr/home
      on      yes  /usr/home/anders                                         tank/usr/home/anders
      on      yes  /usr/jails                                               tank/usr/jails
     off       no  none                                                     tank/usr/local
     off       no  none                                                     tank/usr/local/share
      on      yes  /usr/local/share/doc                                     tank/usr/local/share/doc
      on      yes  /usr/obj                                                 tank/usr/obj
      on      yes  /usr/ports                                               tank/usr/ports
      on      yes  /usr/src                                                 tank/usr/src
     off       no  none                                                     tank/var
      on      yes  /var/audit                                               tank/var/audit
      on      yes  /var/log                                                 tank/var/log
      on      yes  /var/mail                                                tank/var/mail
      on      yes  /var/tmp                                                 tank/var/tmp
[anders@yogabsd] ~% ls /home/anders/git/
[anders@yogabsd] ~%

As far as I can see all should be visible


Just to make sure there is no misunderstanding.

What do you mean with "restart"?
Reboot or resume (from suspend)?

It is a reboot or after a shutdown.
 
Last edited by a moderator:
Try setting mountpoint=/usr/home/anders/git on tank/git (currently set to /home/anders/git.) There is likely a /home -> /usr/home symlink, but I would set it to the canonical path and see if that helps after reboot.

If that works, it suggests the mounting logic is not detecting that (due to the symlink) the /home/anders/git needs to be mounted after /usr/home/anders. Unmount and remounting the git dataset (after /usr/home/anders) makes it visible again. The fact that tank/git is listed before tank/usr/home/anders in the mount output makes me think this will likely fix it.
 
Last edited by a moderator:
You where correct, changing the mount point from home/anders/git to /usr/home/anders/git did the job, do you think this is a bug in zfs or the expected behavior?
 
I'd say this is not surprising, especially given that you've assigned a mountpoint that relies on a symlink for its actual destination.

I would wager that ZFS's mounting code sorts the filesystems-to-be-mounted by mountpoint to ensure top-down (/, /foo, /foo/bar, ...) mounting, but this only works if there are no symlinks that re-order the "depth" of the mount. Asking the mounting code to check for this condition seems like it could be prone to other exciting errors.
 
Back
Top