From owner-freebsd-current@FreeBSD.ORG Sun May 8 06:54:25 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 06BCC16A4E1 for ; Sun, 8 May 2005 06:54:25 +0000 (GMT) Received: from lexi.siliconlandmark.com (lexi.siliconlandmark.com [209.69.98.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8ECB543D1D for ; Sun, 8 May 2005 06:54:24 +0000 (GMT) (envelope-from andy@siliconlandmark.com) Received: from lexi.siliconlandmark.com (localhost [127.0.0.1]) j486sLtx097800 for ; Sun, 8 May 2005 02:54:21 -0400 (EDT) (envelope-from andy@siliconlandmark.com) Received: from localhost (andy@localhost)j486sLoV097797 for ; Sun, 8 May 2005 02:54:21 -0400 (EDT) (envelope-from andy@siliconlandmark.com) X-Authentication-Warning: lexi.siliconlandmark.com: andy owned process doing -bs Date: Sun, 8 May 2005 02:54:21 -0400 (EDT) From: Andre Guibert de Bruet To: current@freebsd.org Message-ID: <20050508020842.T55534@lexi.siliconlandmark.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Information: Please contact the ISP for more information X-SL-MailScanner: Found to be clean X-SL-SpamCheck: not spam, SpamAssassin (score=-2.543, required 6, autolearn=not spam, AWL 0.06, BAYES_00 -2.60) X-MailScanner-From: andy@siliconlandmark.com Subject: The "unmount of /dev failed (BUSY)" message, explained X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 06:54:25 -0000 Folks, In a show of way too much free time, I set off on a quest to figure out what was up with the "unmount of /dev failed (BUSY)" message that is seen on reboot. I am pleased to announce that I found what I believe to be the reason behind the message: vfs_unmountall: Processing /dev/amrd1a: vfs_unmountall: Processing /dev/amrd0s1d: vfs_unmountall: Processing /dev/amrd0s1f: vfs_unmountall: Processing /dev/amrd0s1e: vfs_unmountall: Processing devfs: 0xc53efcc0: tag devfs, type VCHR usecount 1, writecount 0, refcount 22 mountedhere 0xc53d4c00 flags () v_object 0xc10608c4 ref 0 pages 72 dev amrd0s1a 0xc5442550: tag devfs, type VCHR usecount 1, writecount 0, refcount 1 mountedhere 0xc53d4b00 flags () dev amrd0s1b unmount of /dev failed (BUSY) vfs_unmountall: Processing /dev/amrd0s1a: 0xc53efaa0: tag ufs, type VDIR usecount 1, writecount 0, refcount 1 mountedhere 0xc5396800 flags () ino 32896, on dev amrd0s1a 0xc53ef880: tag ufs, type VREG usecount 3, writecount 0, refcount 5 mountedhere 0 flags (VV_TEXT) v_object 0xc1060738 ref 2 pages 89 ino 16527, on dev amrd0s1a Uptime: 12m8s The patch that produces this output is available from: http://bling.properkernel.com/freebsd/vfs_unmountalldiag.diff As you can see from the output, the unmount of /dev fails because the /dev/amrd0s1a (Which is the root mountpoint on this system) and /dev/amrd0s1b (Primary swap) device nodes still exist. The logic that we have that uses reverse TAILQ unmounting is flawed because the root filesystem is mounted read-only before devfs. I will be cleaning up my patch a bit before I submit it to be committed. I will also be producing a patch that will make vfs_unmountall do the right thing. I haven't found a way to make it vacuum my apartment yet but I will submit that functionality to ACME Labs when it's available... ;-) Andy PS: If you want to cross-reference the filesystems, the list is here: http://bling.properkernel.com/freebsd/fstab /* Andre Guibert de Bruet * 6f43 6564 7020 656f 2e74 4220 7469 6a20 */ /* Code poet / Sysadmin * 636f 656b 2e79 5320 7379 6461 696d 2e6e */ /* GSM: +1 734 846 8758 * 5520 494e 2058 6c73 7565 6874 002e 0000 */ /* WWW: siliconlandmark.com * Tormenting bytes since 1980. */