From owner-freebsd-stable@FreeBSD.ORG Wed Jan 21 15:40:40 2009 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 19D451065676 for ; Wed, 21 Jan 2009 15:40:40 +0000 (UTC) (envelope-from eksffa@freebsdbrasil.com.br) Received: from capeta.freebsdbrasil.com.br (capeta.freebsdbrasil.com.br [201.48.151.3]) by mx1.freebsd.org (Postfix) with SMTP id 601388FC08 for ; Wed, 21 Jan 2009 15:40:39 +0000 (UTC) (envelope-from eksffa@freebsdbrasil.com.br) Received: (qmail 35815 invoked from network); 21 Jan 2009 13:13:57 -0200 Received: from unknown (HELO claire.bh.freebsdbrasil.com.br) (201.48.151.226) by capeta.freebsdbrasil.com.br with SMTP; 21 Jan 2009 13:13:57 -0200 Message-ID: <49773B9B.4060402@freebsdbrasil.com.br> Date: Wed, 21 Jan 2009 13:13:31 -0200 From: Patrick Tracanelli Organization: FreeBSD Brasil LTDA User-Agent: Thunderbird 2.0.0.0 (X11/20070612) MIME-Version: 1.0 To: Jerry McAllister References: <20090120161355.GA28525@hugo10.ka.punkt.de> <20090120184216.GA57318@gizmo.acns.msu.edu> <20090121150046.GA61468@gizmo.acns.msu.edu> In-Reply-To: <20090121150046.GA61468@gizmo.acns.msu.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: stable@freebsd.org, Eduardo Meyer , questions@freebsd.org Subject: Re: switching bsdlabel's label 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: Wed, 21 Jan 2009 15:40:40 -0000 Jerry McAllister escreveu: > On Wed, Jan 21, 2009 at 10:45:28AM -0200, Eduardo Meyer wrote: > >> On Tue, Jan 20, 2009 at 4:42 PM, Jerry McAllister wrote: >>> On Tue, Jan 20, 2009 at 03:36:34PM -0200, Eduardo Meyer wrote: >>> >>>> On Tue, Jan 20, 2009 at 2:13 PM, Patrick M. Hausen wrote: >>>>> Hello, >>>>> >>>>> On Tue, Jan 20, 2009 at 01:24:27PM -0200, Eduardo Meyer wrote: >>>>>> I have a certain disk where da0s1a and da0s1d are inverted. By some >>>>>> reason someone labelled root as 'd' and home as 'a'. >>>>>> >>>>>> Can I just >>>>>> >>>>>> bsdlabel -n da0s1 > savedabel.txt >>>>>> >>>>>> Edit savedlabel.txt, switch and restore? (bsdlabel -R da0s1 savedlabel) >>>>> Why not simply use bsdlabel -e da0s1? >>>> Because I didnt know about that? ;-) >>>> >>>> Thank you for the hint. >>>> >>>> However I still have the same doubt. Since basically its the same >>>> task, Is it safe do relabel this way? >>> Hmmm. Is there stuff written on the disk. Is root stuff really written >>> on da0s1d and /home stuff really written on da0s1a? Does the system boot >>> from it OK? >>> >>> Or is it just that the mounts are switched. >>> The mount points are not written in to the label. That comes after >>> booting. If it boots, I wonder if it really is switched on the >>> partitions or if it is just that the partitions are mounted backwards >>> (probably due to editing /etc/fstab incorrectly). >>> >>> ////jerry >> Hello Patrick, thanks again. Yes, label is switched. Yes there really >> are stuff on the partitions. No, I dont boot from da0s1d. It is a disk >> for migration. But the one who partitioned was fooled by Sysinstall >> which creates the first label on extra disks as 'd' and the last from >> the allowed 7 as 'a'. Therefore this server is still booting on the >> original disk (ad6s1a) and everything else is mounted in the new one >> (da0s1), everything but root. > > What sysinstall does is assume that the 'a' partition will be > used for a root mount and the 'b' partition will be used for swap. > Sinc 'c' is reserved, it starts with 'd'. Then, if you later > add an 'a' it will end up being later (higher offset) than the 'd'. > > I suppose it might confuse a person, but otherwise it is no problem > and probably would be best to just leave it that way. You really > only need to use the mount point anyway most of the time. So, if > the mount point addresses the partition you want to with that name, > then you should have no problem. > > You could switch it around using bsdlabel, but I don't think the > risk would be worth the negligible gain. But, do as you wish. > > ////jerry > > >>> >>> >>> >>>>> Kind regards, >>>>> Patrick >>>>> -- >>>>> punkt.de GmbH * Kaiserallee 13a * 76133 Karlsruhe >>>>> Tel. 0721 9109 0 * Fax 0721 9109 100 >>>>> info@punkt.de http://www.punkt.de >>>>> Gf: Jürgen Egeling AG Mannheim 108285 Hello, Yes, you can do this change anytime you want, since (1) da0s1* are unmounted and (2) disk is clean. Therefore I suggest you are in single user mode. If you feel unsure, backup the current label scheme with disklabel da0s1 -n > da0s1.disklabel.bk You can restore anytime with the Rescue Disk. Go ahead, no problem. Sometimes you will really have problem booting from a disk if root is not on label 'a'. I believe it can be workarounded, but your will is safe, go ahead and switch the labels. You can always remember the person who did this from sysinstall that sysinstall will label as 'a' if the mount point is root (/). Therefore if someone wants to use sysinstall for labelling in production, and wont mount on / since / has the current root, one can always fool sysinstall, (C)reating the partition, using / as mpoint and mater redefining the (M)ount point to somewhere else, say, to /mnt. I always relabel this way, never had a problem. TinyBSD sometimes relabels this way too, for some PC Engines Wrap boards. Go ahead. -- Patrick Tracanelli Tel.: (31) 3516-0800 316601@sip.freebsdbrasil.com.br http://www.freebsdbrasil.com.br "Long live Hanin Elias, Kim Deal!"