From owner-freebsd-questions@freebsd.org Wed Dec 16 15:00:50 2015 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 C5829A49356 for ; Wed, 16 Dec 2015 15:00:50 +0000 (UTC) (envelope-from vsasjason@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7481C1165 for ; Wed, 16 Dec 2015 15:00:50 +0000 (UTC) (envelope-from vsasjason@gmail.com) Received: by mail-wm0-x236.google.com with SMTP id l126so42345840wml.0 for ; Wed, 16 Dec 2015 07:00:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=gM83RNPE4rMHStPnGfguuMAfM/ENYjWM1XCHX1zn24Q=; b=E7uf4I2GxfT7QHdspgIhPRGJG9EaIa1uQA9gygJrWJkUXYBiKs8+Pp6tbajeKSjWkM 5YLFY1t7tyssuwAp+8pkf43ZeN2W4IWCrMU47zzpwyBR2x+2N/lpNNAu73a1zIAL80Bq XZhpxkcl0Pus5i2aqu4lB5CpZMFLtZ4aFjtsLGonAtDWlgq0yhGxFyeAVYXY9wWGmdIS qYbzii87OQlz2nx8DMf1fmhJiSHzXs29Ks1sG3TVrRgUfB28/Ge1gvXweP+RWuub0m88 RIaqojQr31MD8hWmOR/uiUZcWgQraUFFPoHIiLzvpDIjSymc1MDuIizp7nFJ23X3ocWM SccQ== MIME-Version: 1.0 X-Received: by 10.28.136.142 with SMTP id k136mr5625534wmd.43.1450278048990; Wed, 16 Dec 2015 07:00:48 -0800 (PST) Received: by 10.194.76.207 with HTTP; Wed, 16 Dec 2015 07:00:48 -0800 (PST) Received: by 10.194.76.207 with HTTP; Wed, 16 Dec 2015 07:00:48 -0800 (PST) In-Reply-To: References: Date: Wed, 16 Dec 2015 18:00:48 +0300 Message-ID: Subject: Re: which label to use in mount? From: Anton Sayetsky To: Adam Vande More Cc: FreeBSD Questions , Sergei G Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2015 15:00:51 -0000 16 =D0=B4=D0=B5=D0=BA. 2015 =D0=B3. 16:40 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0= =BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C "Adam Vande More" =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: > > On Tue, Dec 15, 2015 at 9:37 PM, Sergei G wrote: > > > I have executed the following commands: > > > > # gpart create -s GPT ada1 > > # gpart add -t freebsd-ufs -l sback -s 50G ada1 > > # newfs -nL back /dev/ada1p1 > > > > so, now I can mount it as either: > > > > # mount /dev/gpt/sback /mnt > > or > > # mount /dev/ufs/back /mnt > > > > Both seem to work. However, command > > > > df -H > > > > reports slightly different numbers: > > > > /dev/ufs/back 52G 4.1k 48G 0% /mnt > > dev/gpt/dback 48G 4.0K 45G 0% /mnt > > > > Which way is the correct way to mount? > > > > It is an arbitrary choice to use either gpt or ufs labels. Use one or th= e > other, not both for a particular filesystem. GPT are more ubiquitous since > you can use them for swap etc. UFS labels also have their use cases. It's no harm to use both at the same time, on the same partitions, isn't it? As I said before, these labels are stored in a different places. Some more detailed explanation: Labels are used when one wants to be independent of disk names and partitions numbers. GPT has native support for labels, thus independent of filesystem or partition types. GPT labels are also not consuming space on disk because that space already reserved. So if you'll make 200-sectors partition and label it - you'll get 200 sectors available. UFS labels stored in last sector of block device so consuming space. If you create partition of 200 sectors and format it to UFS with label - you will get 199 sectors available (internal UFS structures not counted). So let's imagine that one has a partition and wants to mount it by name regardless of disk number: 1. GPT scheme - use GPT labels 2. MBR scheme, partition is UFS-formatted - use UFS label 3. MBR scheme, partition is swap or FS that doesn't support labels - use glabel. > However your output is inconsistent so I have no idea what's going on. > Likely you have misrepresented something. Yep, I'm think so too.