Bug #6327

devfsadm and bootadm taking long time for configs with large number of zvols

Added by Matthew Ahrens about 5 years ago. Updated over 4 years ago.

zfs - Zettabyte File System
Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


There are several problems here:
1. when running 'bootadm update-archive' I see that lots of time is spent in newfs. The problem here is that this call is using libdiskmgt to verify that the lofi device is not being used by anybody. Since the lofi device was just created the use of libdiskmgmt here is unnecessary.
2. devzvol_readdir() traverses every snapshot.

I looked at removing the snapshots from /dev/zvol by making a change in the zvol code. This does improve things but doesn't it solve it completely. In my investigation I still saw that mkfs would still try to lstat() every zvol snapshot even though the device node did not exist.

Digging further I think the real solution is to change the dev subsystem to prevent both pseudo and the /dev/zvol links from being created.

This change adds a tunable which disables creation of /dev/zvol links for snapshots. By default, the behavior is not changed, but if you don't need to access zvol snapshots through /dev/zvol, you can disable them for a nice performance improvement.


Updated by Electric Monk over 4 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 470bc2d6d44a4a70ed9403c0bce321333e897c31

commit  470bc2d6d44a4a70ed9403c0bce321333e897c31
Author: George Wilson <>
Date:   2016-07-14T19:11:34.000Z

    6327 devfsadm and bootadm taking long time for configs with large number of zvols
    Reviewed by: Matthew Ahrens <>
    Reviewed by: Sebastien Roy <>
    Reviewed by: Eric Schrock <>
    Reviewed by: Igor Kozhukhov <>
    Reviewed by: Richard Elling <>
    Reviewed by: Dan McDonald <>
    Approved by: Robert Mustacchi <>

Also available in: Atom PDF