From owner-freebsd-current@FreeBSD.ORG Thu Jul 23 07:31:30 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A7721065670 for ; Thu, 23 Jul 2009 07:31:30 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id 91C2F8FC14 for ; Thu, 23 Jul 2009 07:31:29 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from c83-253-252-234.bredband.comhem.se ([83.253.252.234]:60362 helo=mx.exscape.org) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.69) (envelope-from ) id 1MTslv-0005dG-6I; Thu, 23 Jul 2009 09:31:25 +0200 Received: from [192.168.1.5] (macbookpro [192.168.1.5]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx.exscape.org (Postfix) with ESMTPSA id 9CB7F16969C; Thu, 23 Jul 2009 09:31:21 +0200 (CEST) Message-Id: From: Thomas Backman To: McLone In-Reply-To: <451cb3010907181027q13d5c345w8962a648c7682ed8@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Thu, 23 Jul 2009 09:31:19 +0200 References: <451cb3010907181027q13d5c345w8962a648c7682ed8@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) X-Originating-IP: 83.253.252.234 X-Scan-Result: No virus found in message 1MTslv-0005dG-6I. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1MTslv-0005dG-6I 4ba3011694c4f5e1528303ec2874e19f Cc: FreeBSD current Subject: Re: [bug] ZFS zvol dev entry disappearing upon reboot X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 23 Jul 2009 07:31:30 -0000 On Jul 18, 2009, at 19:27, McLone wrote: > Hell Low. > > As downloading torrent files from many peers to ZFS > imposes fragmentation (and there's no way to defragment > ZFS volume - what a pity! How come now-a-days FS can > go like this?), i created zvol with UFS2 on it last time > i wanted to watch some old sci-fi. I had plans to > move sci-fi from UFS2/zvol to ZFS when it'll be complete, > but forgot it, and rebooted machine. After reboot > rtorrent said sci-fi is marked as complete, but it > can not find files. I wasn't surprised, as i haven't modified > my /etc/fstab, so i entered "mount /dev/zvol" and pressed > Tab in hope of tcsh (eek) autocomplete. > It just beeped on me. > I've done "ls /dev" and there was no directory there named zvol. > Then i've done "zfs list" and my zvol was there. > Puzzled, i've done "zfs snapshot" and then a little dance of > "zfs send | zfs recv" to a new volume. Now dev entries appeared > (both for newly created snapshot of an old zvol and for new zvol). > I rebooted, and there was no /dev/zvol again. > > I looked at my uname -v output (it was HEAD/amd64 from Jul 1) > and decided to update. Updating didn't solved this problem. > > Strangely, simple "zfs rename zpool/zvol zpool/newzvol" > cures this woe, but i think this is a bug. > > Steps to reproduce: > zfs create -V 1g zpool/zvol > [newfs /dev/zvol/zpool/zvol] > reboot > ls /dev > > Workaround: > zfs rename zpool/zvol zpool/newzvol > mount /dev/zvol/zpool/zvol /mnt OK, I've found the problem we have here... Or, rather, I've found the *reason* (and this shows why I previously said I couldn't reproduce). I haven't found it in source, though. UFS filesystems in fstab are mounted *before* the /dev/zvol directory is populated, at least on my system! If I remove the entry from fstab, everything boots fine, and the directory exists when the boot is complete. If its IN fstab, init gives me a root prompt because it couldn't find /dev/zvol/x/y. Remove it, and again it works on the next boot. And, as you said, renaming it while in single user creates /dev/zvol and thus resolves the issue for that boot and allows me to boot into multiuser with the ZVOL working. Anyone with a clue in these areas know if there's an easy fix to this (i.e. easy enough that we could have it in 8.0)? I'm guessing /etc/ rc.d/zfs simply starts too late in the boot process? Regards, Thomas