How to exclude nullfs with "find"?

MisterE2002

Patron
Joined
Sep 5, 2015
Messages
211
Migration files from CORE to SCALE. I want to create a filelist of "iocage" to be sure.
Code:
find /mnt/tank/iocage/ -type f

However the links are still followed. Seemingly because they are of type "nullfs". Tools are not modified to handle this kind bind mounts? How can i create a list with the *real* files in this folder?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You can use find -x to not cross dataset/filesystem boundaries. That won't work in a straight simple way, though, because iocage uses a lot of dedicated ZFS datasets. But you could do a mount, df, or zfs list to get a list of all the "real" datasets removing the nullfs mounts and then use find -d -x <list of datasets> ...

HTH,
Patrick
 

MisterE2002

Patron
Joined
Sep 5, 2015
Messages
211
the find -x gives indeed a small list. And almost all stuff is missing (only plugins and expected the freebsd releases). I suppose the easiest way is to dismantle my mappings and create the list afterwards.
My only concern if something of value was be ended up there somehow.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
the find -x gives indeed a small list. And almost all stuff is missing (only plugins and expected the freebsd releases). I suppose the easiest way is to dismantle my mappings and create the list afterwards.
My only concern if something of value was be ended up there somehow.
You can try -fstype zfs to limit to ZFS (no nullfs, tmpfs, etc).
Internally find(1) uses FTS_SKIP / fts(3) to prune off branches for no_xdev and other args, so this should be relatively efficient is my guess.
 
Top