lsof and ZFS

Dmitry Morozovsky marck at rinet.ru
Mon Jan 7 13:04:04 PST 2008


On Mon, 7 Jan 2008, Vic Abell wrote:

VA> Larry,
VA> 
VA> You write:
VA> >
VA> > On Sat, 5 Jan 2008, Dmitry Morozovsky wrote:
VA> > >
VA> > > The only additional thing I would like to bring attention 
VA> > > at is the fact that
VA> > > ZFS can be used as root, requiring to additionally patch 
VA> > > lsof like FreeSBIE people did for cd9660 root.
VA> 
VA> I'm not sure about that.  The patch in the cd9660 PR was needed
VA> because lsof couldn't stat(2) the root file system.  I'm not
VA> sure I understand why that is.
VA> 
VA> What's more, the patch may have unwanted side effects which I
VA> can't determine myself -- e.g., lsof may not be able to convert
VA> kernel device numbers to the user space device numbers returned
VA> by stat(2) and displayed by ls(1).  I've e-mailed the PR author,
VA> asking him to do some testing.
VA> 
VA> > I believe Vic Abell (the author) is aware of this, although 
VA> > my machines (that he is using for the dev, on RELENG_7), are
VA> > NOT rooted on ZFS, although everything else, except swap, is
VA> > on ZFS.
VA> 
VA> Yes, Larry, I see that now.  / is UFS.  Some time someone will
VA> have to test the lsof update for ZFS on a system that does have
VA> / on ZFS.  I won't be able to do that.
VA> 
VA> I need to warn everyone that the ZFS update for FreeBSD lsof is
VA> going to take a lot of work and time.  Lsof needs the znode
VA> structure definition (and other ZFS structure definitions) that
VA> are defined in the OpenSolaris sources and its header files won't
VA> compile in combination with any FreeBSD header files.  I found
VA> the module compatibility stuff, so I know how to make the
VA> OpenSolaris headers compile, but it will require major
VA> modifications to lsof to be able to do it.

I'll more than happy to test on my machines with ZFS root - my home FreeBSD 
workstation has been configured with ZFS-on-root, and so my notebook FreeBSD 
boot (it's triple-booted).

Which info should I provide?

Quick reference:

root at revamp:/usr/src# mount | grep '/ '
revamp on / (zfs, local)
root at revamp:/usr/src# uname -a
FreeBSD revamp.wpub.woozle.net 7.0-BETA4 FreeBSD 7.0-BETA4 #17: Sun Dec 16 
16:24:37 MSK 2007     marck at revamp.wpub.woozle.net:/usr/obj/usr/src/sys/MINI  
i386
root at revamp:/usr/src# lsof -n -c init
COMMAND PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
init      1 root  cwd                             unknown file system type: zfs
init      1 root  rtd                             unknown file system type: zfs
init      1 root  txt                             unknown file system type: zfs
root at revamp:/usr/src# pkg_info | grep lsof
lsof-4.79E          Lists information about open files (similar to fstat(1))

Thanks you in advance!

Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer:                                 marck at FreeBSD.org ]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck at rinet.ru ***
------------------------------------------------------------------------


More information about the freebsd-ports mailing list