Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong dataset for path found #2

Open
jcatrysse opened this issue Dec 30, 2021 · 3 comments
Open

Wrong dataset for path found #2

jcatrysse opened this issue Dec 30, 2021 · 3 comments

Comments

@jcatrysse
Copy link

jcatrysse commented Dec 30, 2021

I am having an issue on FreeBSD, where zsd is using the wrong dataset, and is not finding the changed files. This is a default, out of the box FreeBSD 13.0 ZFS installation.

/root: zsd -d 6 -v /var/db/mysql/ibdata1 list
DEBUG | full path: /var/db/mysql/ibdata1
DEBUG | exceute: zfs list -Ho name
DEBUG | search datasets under zfs: zroot
DEBUG | exceute: zfs list -Hp -o name,used,avail,refer,mountpoint -r -t filesystem zroot
DEBUG | 13 datasets found:
DEBUG |     Name                                     Mountpoint
DEBUG |     zroot                                    /zroot
DEBUG |     zroot/ROOT/default                       /
DEBUG |     zroot/tmp                                /tmp
DEBUG |     zroot/usr                                /usr
DEBUG |     zroot/usr/home                           /usr/home
DEBUG |     zroot/usr/ports                          /usr/ports
DEBUG |     zroot/usr/src                            /usr/src
DEBUG |     zroot/var                                /var
DEBUG |     zroot/var/audit                          /var/audit
DEBUG |     zroot/var/crash                          /var/crash
DEBUG |     zroot/var/log                            /var/log
DEBUG |     zroot/var/mail                           /var/mail
DEBUG |     zroot/var/tmp                            /var/tmp
DEBUG | 1 not mounted datasets ignored:
DEBUG |     zroot/ROOT
DEBUG | Dataset for path found - path: /var/db/mysql/ibdata1, ds: zroot/var, mount-point: /var
DEBUG | work on dataset: zroot/var
scan the last 6 days for other file versions
DEBUG | exceute: zfs list -t snapshot -s creation -r -d 1 -o name,creation -Hp zroot/var
DEBUG | search for file versions for file: /var/db/mysql/ibdata1, in the date range: between Fri Dec 24 2021 and Thu Dec 30 2021
DEBUG | 0 versions for file /var/db/mysql/ibdata1 found - scan duration: 7.337788ms
  # | File changed | Snapshot | Snapshot age
--------------------------------------------

Actually, the dataset should be zroot/ROOT/default and not zroot/var.
/var is no mount point for zroot/var.

/root: mount
devfs on /dev (devfs)
zroot/tmp on /tmp (zfs, local, noatime, nosuid, nfsv4acls)
zroot/var/log on /var/log (zfs, local, noatime, noexec, nosuid, nfsv4acls)
zroot/usr/src on /usr/src (zfs, local, noatime, nfsv4acls)
zroot/var/mail on /var/mail (zfs, local, nfsv4acls)
zroot/var/crash on /var/crash (zfs, local, noatime, noexec, nosuid, nfsv4acls)
zroot/var/tmp on /var/tmp (zfs, local, noatime, nosuid, nfsv4acls)
zroot/usr/home on /usr/home (zfs, local, noatime, nfsv4acls)
zroot on /zroot (zfs, local, noatime, nfsv4acls)
zroot/usr/ports on /usr/ports (zfs, local, noatime, nosuid, nfsv4acls)
zroot/var/audit on /var/audit (zfs, local, noatime, noexec, nosuid, nfsv4acls)

However, there must be some misunderstanding about the meaning of the mount point in zfs list because zfs list is showing /var as being a mount point (but there are only about 3 MB of data, while I have GB's of data on /var/db ...)

It is my understanding that zroot/var and /var are only placeholders for /var/audit, /var/log, and so on.

/root: zfs list
NAME                 USED  AVAIL     REFER  MOUNTPOINT
zroot               20.6G  29.3G       96K  /zroot
zroot/ROOT          19.8G  29.3G       96K  none
zroot/ROOT/default  19.8G  29.3G     19.8G  /
zroot/tmp            128K  29.3G      128K  /tmp
zroot/usr            722M  29.3G       96K  /usr
zroot/usr/home       128K  29.3G      128K  /usr/home
zroot/usr/ports      722M  29.3G      722M  /usr/ports
zroot/usr/src         96K  29.3G       96K  /usr/src
zroot/var           2.89M  29.3G       96K  /var
zroot/var/audit       96K  29.3G       96K  /var/audit
zroot/var/crash       96K  29.3G       96K  /var/crash
zroot/var/log       2.07M  29.3G     1.69M  /var/log
zroot/var/mail       456K  29.3G      456K  /var/mail
zroot/var/tmp         96K  29.3G       96K  /var/tmp

Maybe a solution could be to check if the file system can be mounted?

/root: zfs list -o name,mountpoint,canmount
NAME                MOUNTPOINT  CANMOUNT
zroot               /zroot      on
zroot/ROOT          none        on
zroot/ROOT/default  /           noauto
zroot/tmp           /tmp        on
zroot/usr           /usr        off
zroot/usr/home      /usr/home   on
zroot/usr/ports     /usr/ports  on
zroot/usr/src       /usr/src    on
zroot/var           /var        off
zroot/var/audit     /var/audit  on
zroot/var/crash     /var/crash  on
zroot/var/log       /var/log    on
zroot/var/mail      /var/mail   on
zroot/var/tmp       /var/tmp    on

Could this be looked at? Thank you and have a happy new year!

Jan

@j-keck
Copy link
Owner

j-keck commented Jan 2, 2022

Hello Jan,

sorry for my late response, just saw this issue.

For what is this zroot/var dataset when it's not used?
A simple fix would be to delete this zroot/var dataset or set the mountpoint to none.

I need to think about this a little bit at first. Maybe zsd should check the output of the mount command?

@jcatrysse
Copy link
Author

jcatrysse commented Jan 2, 2022

Hi Jürgen, thank you.

I am not aware of the reasons but this is the default setup on FreeBSD 13.0… No idea why it is done this way. I am new to ZFS.

If I can check something, I am happy to help when I'm back from ski.

regards,
Jan

@jcatrysse
Copy link
Author

Hello Jürgen, did you find the time to think about this?

Would the 'canmount' be an option? Maybe with an additional flag, so standard behavior is not modified.

Thank you and have a nice weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants