From owner-freebsd-questions@FreeBSD.ORG Fri Dec 23 19:44:20 2011 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 379851065673 for ; Fri, 23 Dec 2011 19:44:20 +0000 (UTC) (envelope-from joh.hendriks@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id BD1B28FC0C for ; Fri, 23 Dec 2011 19:44:19 +0000 (UTC) Received: by eekc50 with SMTP id c50so11287440eek.13 for ; Fri, 23 Dec 2011 11:44:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=BQEhHCfpw5XdvoQsKg1Fcn7NiIeVnDZJjmQgVxGIxJk=; b=L51UZchtyQBbfnRmliCdQ0zCPwCwND8xzPS80RAAs0JCzCDCzrkt7HsO6yrW+N8aHB RlIFtDtuPIdQvI1oxg+SFE295NeO6gWdBtYOSYAOCgp6TvZXQ4wTM9oD5F6rGbEDZMHz 5zBJwXHZjSDHAhaQhohgy2YBsJFRGvVoyfkJc= Received: by 10.213.25.218 with SMTP id a26mr6193094ebc.118.1324669458645; Fri, 23 Dec 2011 11:44:18 -0800 (PST) Received: from [192.168.50.104] (double-l.xs4all.nl. [80.126.205.144]) by mx.google.com with ESMTPS id u53sm4505906eeu.6.2011.12.23.11.44.17 (version=SSLv3 cipher=OTHER); Fri, 23 Dec 2011 11:44:18 -0800 (PST) Message-ID: <4EF4DA0D.50706@gmail.com> Date: Fri, 23 Dec 2011 20:44:13 +0100 From: Johan Hendriks User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111220 Thunderbird/9.0 MIME-Version: 1.0 To: Peter , FreeBSD References: <4EF4C0E4.7080902@gmail.com> <23e2a89872f6805695ac526665c4d60f.squirrel@pop.pknet.net> <4EF4D164.1050005@gmail.com> <5ec54f1ba62092b324c06ff2c509d04b.squirrel@pop.pknet.net> In-Reply-To: <5ec54f1ba62092b324c06ff2c509d04b.squirrel@pop.pknet.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: gpart, modified label does not show up in /dev/gpt. 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: Fri, 23 Dec 2011 19:44:20 -0000 Peter schreef: >> Peter schreef: >>>> Hello all. >>>> >>>> I just installed FreeBSD 9.0 RC2 and upgraded to 9.0 RC3. >>>> >>>> I used the standard GPT disk layout at install. >>>> >>>> Now i want to set labels for my disk, so that i can swap around disks a >>>> little more easy. >>>> So reading through the man page it told me to use gpart modify -i -l >>>> >>>> The layout is as follows: >>>> test# gpart status >>>> Name Status Components >>>> da0p1 OK da0 >>>> da0p2 OK da0 >>>> da0p3 OK da0 >>>> >>>> test# gpart list | grep label >>>> label: (null) >>>> label: (null) >>>> label: (null) >>>> >>>> Now i modified the gpart labels. >>>> >>>> test# gpart modify -i1 -l bootpart da0 >>>> da0p1 modified >>>> test# gpart modify -i2 -l rootpart da0 >>>> da0p2 modified >>>> test# gpart modify -i3 -l swap da0 >>>> da0p3 modified >>>> >>>> Ok all looks fine. >>>> Now lets see if i can use my labels >>>> >>>> test# cd /dev/gpt >>>> /dev/gpt: No such file or directory. >>>> >>>> Well it does not create my labels >>>> I did check if the labels where there >>>> >>>> test# gpart list | grep label >>>> label: bootpart >>>> label: rootpart >>>> label: swap >>>> >>>> So i rebooted the machine! >>>> But after a reboot, still no /dev/gpt. >>>> >>>> So why is it not creating my labels! >>>> Am i missing a step? >>>> >>>> Thanks for your time. >>>> >>>> And before i forget, merry christmas to all, and a wonderful 2012. >>>> >>>> regards, >>>> Johan Hendriks >>>> >>> I was going to say if you mount /dev/da0p? its /dev/gpt/label >>> disappears, >>> and since all the partition are mounted already [/dev/gpt/ is empty], >>> then >>> /dev/gpt is maybe also removed.......but /dev/gpt/bootpart is not >>> mounted >>> and should still show up. >>> >>> >>> When you ran the 'gpart' commands, did you set the sysctl geom debug >>> variable? [sysctl kern.geom.debugflags=17] >>> After the reboot, are the labels still there? [gpart list | grep label] >>> >>> ]Peter[ >>> >> I placed some other disk in (for the zfs pool) >> Now i have /dev/gpt/bootpart, but not the labels for swap and / >> I did not use the sysctl value. >> >> And yes the labels are stil in place. >> >> test# cd /dev/gpt >> test# ls -al >> total 1 >> dr-xr-xr-x 2 root wheel 512 Dec 23 20:02 . >> dr-xr-xr-x 10 root wheel 512 Dec 23 21:02 .. >> crw-r----- 1 root operator 0, 123 Dec 23 20:02 bootpart >> test# gpart list | grep label >> label: bootpart >> label: rootpart >> label: swap >> test# >> >> I will try the debugflag option. >> But it should not be nessacary i guess. >> >> thanks >> regards >> Johan >> > If you have already mounted a /dev/da0p?, its label is removed from > /dev/gpt - 'bootpart' is never mounted, that is why it's label remains. > you just have to change /etc/fstab to the /dev/gpt/labels and then they > will remain and get mounted - Or boot from a DVD, don't mount anything and > you'll see the labels. > > ie: > If you mount '/dev/da0p2'as '/' then '/dev/gpt/rootpart' will no longer be > available, same goes for swap and everything else. If you mount > 'dev/gpt/rootpart' as '/', the you'll have both '/dev/da0p2' and > '/dev/gpt/bootpart' > > ]Peter[ > > Thanks that solved it. !! because i did not see them in /dev/gpt i did not change the /etc/fstab file to the appropiate config. I thought if they are not there, then i can not use them. Wrong assumption !!! I edited /etc/fstab to mount /dev/gpt/rootpart on / and /dev/gpt/swap on swap, and the machine booted like it should. Also the gpt entries are now there! Thanks again! Merry cristmas !!! regards Johan