From owner-freebsd-stable@FreeBSD.ORG Mon Jan 7 11:06:54 2008 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0503B16A417 for ; Mon, 7 Jan 2008 11:06:54 +0000 (UTC) (envelope-from byshenknet@byshenk.net) Received: from core.byshenk.net (core.byshenk.net [62.58.73.230]) by mx1.freebsd.org (Postfix) with ESMTP id A68D313C459 for ; Mon, 7 Jan 2008 11:06:53 +0000 (UTC) (envelope-from byshenknet@byshenk.net) Received: from core.byshenk.net (localhost.aoes.com [127.0.0.1]) by core.byshenk.net (8.14.2/8.14.2) with ESMTP id m07B6p8J065496; Mon, 7 Jan 2008 12:06:51 +0100 (CET) (envelope-from byshenknet@core.byshenk.net) Received: (from byshenknet@localhost) by core.byshenk.net (8.14.2/8.14.2/Submit) id m07B6ouD065495; Mon, 7 Jan 2008 12:06:50 +0100 (CET) (envelope-from byshenknet) Date: Mon, 7 Jan 2008 12:06:50 +0100 From: Greg Byshenk To: Jose Garcia Juanino Message-ID: <20080107110649.GE4601@core.byshenk.net> References: <20080105222831.GA862@gauss.sanabria.es> <20080106144120.GD4601@core.byshenk.net> <20080106163830.GA3790@gauss.sanabria.es> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080106163830.GA3790@gauss.sanabria.es> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on core.byshenk.net Cc: stable@freebsd.org Subject: Re: Cannot mount a nfs share after doing a snapshot X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2008 11:06:54 -0000 On Sun, Jan 06, 2008 at 05:38:30PM +0100, Jose Garcia Juanino wrote: > El domingo 06 de enero a las 15:41:21 CET, Greg Byshenk escribi?: > > On Sat, Jan 05, 2008 at 11:28:31PM +0100, Jose Garcia Juanino wrote: > > > > > I have a 7.0-PRERELEASE i386 system with a nfs server, with an unique export > > > line in /etc/exports file: > > > > > > / -maproot=root -network 192.168.1.0 -mask 255.255.255.0 > > > > > > After a reboot, I have no problem mounting this nfs share from a nfs client. > > > But after issuing the following command on the server: > > > > > > # mount -u -o snapshot /.snap/now / > > Is the problem that you are trying to mount your snapshot on top of the / > > directory? I use snapshots, but have never tried to do this, and can > > imagine that there might be a problem, since the snapshot is itself a > > snapshot of a filesystem (different than the actual root filesystem). > > > > That would explain the error: > > > Jan 5 22:47:03 gauss mountd[542]: can't delete exports for /: Cross-device link > No, I am not trying to mount the snapshot. I am just taking (making) the > snapshot, as man mount says. Sorry, I wasn't following this (as I said, I don't work with snapshots in this way). I've looked at the 'mount' man page, and it seems that it should work the way you are trying to do it. That said, because taking a snapshot grabs the entirety of a filesystem, I can well imagine that trying to take a snapshot of the root filesystem while at the same time exporting that filesystem via NFS will cause a problem. > > What happens if you create a directory and mount your snapshot there: > > > > mkdir /snapshotmount > > mount -u -o snapshot /.snap/now /snapshotmount > > > > If this works, then you may need a separate exports line for /snapshotmount. > # file /.snap/now > /.snap/now: Unix Fast File system [v2] (little-endian) last mounted on > /, last written at Sun Jan 6 16:24:19 2008, clean flag 1, readonly flag > 1, number of blocks 130721, number of data blocks 126520, number of > cylinder groups 4, block size 16384, fragment size 2048, average file > size 16384, average number of files in dir 64, pending blocks to free 0, > pending inodes to free 0, system-wide uuid 0, minimum percentage of free > blocks 8, TIME optimization Ok, so it looks like your /.snap/now snapshot actually exists, and is being made, so it looks like the command # mount -u -o snapshot /.snap/now / is actually working. (So ignore the rest of what I said last time...) I've just played with this a bit myself (I'm no expert, but I use snapshots currently with 6-STABLE and want to know about any future problems), and I can reproduce the problem (7.0-PRERELEASE as of 2 Jan 2008). I see the same sort of errors as you report, and they cannot be cleared even by removing the snapshot file and restarting nfsd/mountd. The only solution appears to be to remove the snapshot and restart the machine. I can see how this might be a bit inconvenient. That said, there appears to be a problem with using the # mount -u -o snapshot form of the command. The problem does _not_ occur (at least in my test) if you use the the # mksnap_ffs command. Can you try taking a snapshot using mksnap_ffs? If mksnap_ffs works, while 'mount -u -o' fails, then it looks like a bug... -greg -- greg byshenk - gbyshenk@byshenk.net - Leiden, NL