Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Dec 2015 18:00:48 +0300
From:      Anton Sayetsky <vsasjason@gmail.com>
To:        Adam Vande More <amvandemore@gmail.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>, Sergei G <sergeig.public@gmail.com>
Subject:   Re: which label to use in mount?
Message-ID:  <CAA2O=b_AFe%2BkuyE=6kvMR9rCm-Yz%2BGjOVefz5zqPSR0aprM11Q@mail.gmail.com>
In-Reply-To: <CA%2BtpaK3yfkNk0haQ3Ogbc920Go4HUFaik=tWtqyNtsDmJynKLg@mail.gmail.com>
References:  <CAFLLzCMQtupZX651wR35vrJdXY5Ber8qKPd%2B5EX4Dkp4iCv=vg@mail.gmail.com> <CA%2BtpaK3yfkNk0haQ3Ogbc920Go4HUFaik=tWtqyNtsDmJynKLg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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" <amvandemore@gmai=
l.com>
=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 <sergeig.public@gmail.com>
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAA2O=b_AFe%2BkuyE=6kvMR9rCm-Yz%2BGjOVefz5zqPSR0aprM11Q>