Date: Tue, 10 Aug 2010 16:39:24 +0100 From: Arthur Chance <freebsd@qeng-ho.org> To: Roland Smith <rsmith@xs4all.nl> Cc: freebsd-questions@freebsd.org Subject: Re: AHCI driver Message-ID: <4C6172AC.1090400@qeng-ho.org> In-Reply-To: <20100810145211.GA51287@slackbox.erewhon.net> References: <4C6139AB.8020306@nagual.nl> <SNT142-w18E920D1253EE370CA730B8C950@phx.gbl> <20100810131343.GB48376@slackbox.erewhon.net> <4C6160E1.4080305@qeng-ho.org> <20100810145211.GA51287@slackbox.erewhon.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C6172AC.1090400>