From owner-freebsd-questions@freebsd.org Thu Oct 26 15:55:16 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA9C7E4CF02 for ; Thu, 26 Oct 2017 15:55:16 +0000 (UTC) (envelope-from carlj@peak.org) Received: from filter01.peak.org (filter01.peak.org [207.55.16.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "*.peak.org", Issuer "Go Daddy Secure Certificate Authority - G2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 92F8D82F4F for ; Thu, 26 Oct 2017 15:55:15 +0000 (UTC) (envelope-from carlj@peak.org) Received: from zmail-mta02.peak.org ([207.55.16.112]) by filter01.peak.org ({e1c81c21-e4c4-4528-aa90-7a27869c545a}) via TCP (outbound) with ESMTPS id 20171026155135459_0000 for ; Thu, 26 Oct 2017 08:51:35 -0700 X-RC-FROM: X-RC-RCPT: Received: from zmail-mta02.peak.org (localhost [127.0.0.1]) by zmail-mta02.peak.org (Postfix) with ESMTPS id 360484CC1E for ; Thu, 26 Oct 2017 08:51:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zmail-mta02.peak.org (Postfix) with ESMTP id 1C6284CC46 for ; Thu, 26 Oct 2017 08:51:33 -0700 (PDT) Received: from zmail-mta02.peak.org ([127.0.0.1]) by localhost (zmail-mta02.peak.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id CnNOrHI21qZq for ; Thu, 26 Oct 2017 08:51:33 -0700 (PDT) Received: from mailproxy-lb-06.peak.org (mailproxy-lb-06.peak.org [207.55.17.96]) by zmail-mta02.peak.org (Postfix) with ESMTP id B29154CC1E for ; Thu, 26 Oct 2017 08:51:32 -0700 (PDT) Received: from carlj by elm.localnet with local (Exim 4.89 (FreeBSD)) (envelope-from ) id 1e7kRM-000LxZ-0A for freebsd-questions@freebsd.org; Thu, 26 Oct 2017 08:51:28 -0700 From: Carl Johnson To: freebsd-questions@freebsd.org Subject: Re: label disappearing at reboot References: X-Clacks-Overhead: GNU Terry Pratchett Date: Thu, 26 Oct 2017 08:51:27 -0700 In-Reply-To: (Luca Ferrari's message of "Thu, 26 Oct 2017 14:41:51 +0200") Message-ID: <86vaj1oqkg.fsf@elm.localnet> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-MAG-OUTBOUND: peakinternet.redcondor.net@207.55.16/22 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Oct 2017 15:55:16 -0000 Luca Ferrari writes: You have some problems as I note inline below. > Hi all, > on a testing virtual machine I have a virtual disk labeled via glabel > disappearing at each reboot (11-RELEASE). > > When the system boots it is turned into single user mode because it > cannot mount DATA4 as it has disappeared. > In particular on the console it is printed: > > mount: /dev/label/DATA4: No such file or directory > > And effectively the lanel has disappeared. I try to recreate the whole > partition and label from scratch as follows, and effectively I'm able > to mount the filesystem after that, but every time the machine is > rebooted the disk label disappear. What am I missing? > > root@olivia:~ # glabel list ada4 > Geom name: ada4 > Providers: > 1. Name: diskid/DISK-VB97f8d8f5-8f70a2a4 > Mediasize: 2147483648 (2.0G) > Sectorsize: 512 > Mode: r0w0e0 > secoffset: 0 > offset: 0 > seclength: 4194304 > length: 2147483648 > index: 0 > Consumers: > 1. Name: ada4 > Mediasize: 2147483648 (2.0G) > Sectorsize: 512 > Mode: r0w0e0 > > > root@olivia:~ # gpart create -s GPT ada4 > ada4 created > root@olivia:~ # gpart add -t freebsd-ufs ada4 > ada4p1 added > > root@olivia:~ # glabel create DATA4 ada4p1 This creates a temporary label only according to the man page, so you need to use 'glabel label' to create a permanent label. > root@olivia:~ # newfs label/DATA4 > label/DATA4: 2048.0MB (4194224 sectors) block size 32768, fragment size 4096 > using 4 cylinder groups of 512.00MB, 16384 blks, 65536 inodes. > super-block backups (for fsck_ffs -b #) at: > 192, 1048768, 2097344, 3145920 > root@olivia:~ # echo "/dev/label/DATA4 /mnt/data4 ufs rw 0 0" >> /etc/fstab > root@olivia:~ # mount -a You can also use UFS labels without using glabel at all. In that case use 'newfs -L DATA4 ada4p1', and then use /dev/ufs/DATA4 in fstab. -- Carl Johnson carlj@peak.org