From owner-freebsd-questions@FreeBSD.ORG Tue Aug 10 15:39:26 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4447106566C for ; Tue, 10 Aug 2010 15:39:26 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from fileserver.home.qeng-ho.org (blue.qeng-ho.org [217.155.128.241]) by mx1.freebsd.org (Postfix) with ESMTP id 233EB8FC1B for ; Tue, 10 Aug 2010 15:39:25 +0000 (UTC) Received: from fileserver.home.qeng-ho.org (localhost [127.0.0.1]) by fileserver.home.qeng-ho.org (8.14.3/8.14.3) with ESMTP id o7AFdOEb081964; Tue, 10 Aug 2010 16:39:24 +0100 (BST) (envelope-from freebsd@qeng-ho.org) Message-ID: <4C6172AC.1090400@qeng-ho.org> Date: Tue, 10 Aug 2010 16:39:24 +0100 From: Arthur Chance User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.11) Gecko/20100727 Thunderbird/3.0.6 MIME-Version: 1.0 To: Roland Smith References: <4C6139AB.8020306@nagual.nl> <20100810131343.GB48376@slackbox.erewhon.net> <4C6160E1.4080305@qeng-ho.org> <20100810145211.GA51287@slackbox.erewhon.net> In-Reply-To: <20100810145211.GA51287@slackbox.erewhon.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: AHCI driver X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2010 15:39:26 -0000 On 08/10/10 15:52, Roland Smith wrote: > On Tue, Aug 10, 2010 at 03:23:29PM +0100, Arthur Chance wrote: [snip] >> Alternatively, before switching to the ahci driver, label all your >> partitions and mount them using their labels rather than device names. > > This is probably a better idea. > > But people should note the difference between > using 'tunefs -L' and 'glabel label'! The latter uses the last section of the > provider to store metadata, so in that case one should _only_ create a > filesystem on the labeled device! > >> That way the change in device names won't matter. Just be careful of the >> gotcha with labelling the root partition. > > What do you mean? Unless you're working from a fixit CD/DVD, if you're labelling an existing UFS root partition you have to reboot to single user mode to use "tunefs -L", and then have to reboot again to edit fstab to use the labelled device and then reboot a third time for the labelled mount to take effect. If you try to get clever, as I did, and omit the second reboot by using "mount -uw /" to make fstab editable you wipe out the partition label, and the final reboot fails miserably, telling you it can't find /dev/ufs/root (or whatever) to mount the root partition. The machine then goes into an cycle of rebooting and failing to find the root filesystem until you fix the problem. I haven't looked at the source closely, but I'd guess this is because when / is mounted r/o the kernel caches a copy of its superblock, "tunefs -L" modifies the superblock on disk, "mount -uw /" doesn't reread the disk superblock (it was read only, what could possibly have changed? :-) so the unlabelled superblock remains cached, and the next reboot writes the unlabelled cached superblock over the labelled disk superblock on shutdown. I was stupid enough to make this mistake twice a few months apart, so now instructions for labelling root partitions are part of my hard copy notes for when I may not have a machine working well enough to look at my online notes.