* The btrfs 'label' property: device or filesystem-wide?
@ 2019-08-02 9:42 Hans van Kranenburg
2019-08-02 12:54 ` Anand Jain
0 siblings, 1 reply; 3+ messages in thread
From: Hans van Kranenburg @ 2019-08-02 9:42 UTC (permalink / raw)
To: linux-btrfs
Hi,
I was just looking at btrfs property and what it can do.
Now, I notice that the man page contains:
label: label of device
When I look at a device and ask what properties I can set, I see:
-# btrfs property list -t device /dev/xvdb
label Set/get label of device.
But, when I try to set it, it complains:
-# btrfs property set -t device /dev/xvdb label yolo
ERROR: device /dev/xvdb is mounted, use mount point
A mount point points to a whole filesystem, not a specific device.
-# btrfs property set -t device /btrfs label yolo
The result is that the label at filesystem level is set. A device
doesn't even have something like a label itself.
-# btrfs fi show
Label: 'yolo' uuid: 370415b8-b96f-456e-8713-6833b2a65127
Total devices 4 FS bytes used 144.00KiB
devid 1 size 10.00GiB used 1.00GiB path /dev/xvdb
devid 2 size 10.00GiB used 1.00GiB path /dev/xvdc
devid 3 size 10.00GiB used 288.00MiB path /dev/xvdd
devid 4 size 10.00GiB used 288.00MiB path /dev/xvde
So, am I missing something, or should this have been:
-# btrfs property set -t filesystem label foo /mountpoint
Hans
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: The btrfs 'label' property: device or filesystem-wide?
2019-08-02 9:42 The btrfs 'label' property: device or filesystem-wide? Hans van Kranenburg
@ 2019-08-02 12:54 ` Anand Jain
2019-08-02 13:42 ` Hans van Kranenburg
0 siblings, 1 reply; 3+ messages in thread
From: Anand Jain @ 2019-08-02 12:54 UTC (permalink / raw)
To: Hans van Kranenburg, linux-btrfs
On 8/2/19 5:42 PM, Hans van Kranenburg wrote:
> Hi,
>
> I was just looking at btrfs property and what it can do.
>
> Now, I notice that the man page contains:
>
> label: label of device
>
> When I look at a device and ask what properties I can set, I see:
>
> -# btrfs property list -t device /dev/xvdb
> label Set/get label of device.
>
> But, when I try to set it, it complains:
>
> -# btrfs property set -t device /dev/xvdb label yolo
> ERROR: device /dev/xvdb is mounted, use mount point
>
> A mount point points to a whole filesystem, not a specific device.
>
> -# btrfs property set -t device /btrfs label yolo
>
> The result is that the label at filesystem level is set. A device
> doesn't even have something like a label itself.
>
> -# btrfs fi show
> Label: 'yolo' uuid: 370415b8-b96f-456e-8713-6833b2a65127
> Total devices 4 FS bytes used 144.00KiB
> devid 1 size 10.00GiB used 1.00GiB path /dev/xvdb
> devid 2 size 10.00GiB used 1.00GiB path /dev/xvdc
> devid 3 size 10.00GiB used 288.00MiB path /dev/xvdd
> devid 4 size 10.00GiB used 288.00MiB path /dev/xvde
>
> So, am I missing something, or should this have been:
>
> -# btrfs property set -t filesystem label foo /mountpoint
Yes. Label is for the whole filesystem.
Initially the label was set-able only using the device path (after
mkfs), for which the device has to be in unmounted state.
So when we implemented the label ioctl, so that label can be set on the
mounted fs, we had to maintain its backward compatible.
So at both, btrfs fi label and btrfs prop set the label works on the
mount-point or the device path if its unmounted. And even if the device
path is used the label is for the whole filesystem.
HTH
Anand
> Hans
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: The btrfs 'label' property: device or filesystem-wide?
2019-08-02 12:54 ` Anand Jain
@ 2019-08-02 13:42 ` Hans van Kranenburg
0 siblings, 0 replies; 3+ messages in thread
From: Hans van Kranenburg @ 2019-08-02 13:42 UTC (permalink / raw)
To: Anand Jain, linux-btrfs
Hi,
On 8/2/19 2:54 PM, Anand Jain wrote:
>
> So at both, btrfs fi label and btrfs prop set the label works on the
> mount-point or the device path if its unmounted. And even if the device
> path is used the label is for the whole filesystem.
Aha, clear.
Thanks!
Hans
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-02 13:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-02 9:42 The btrfs 'label' property: device or filesystem-wide? Hans van Kranenburg
2019-08-02 12:54 ` Anand Jain
2019-08-02 13:42 ` Hans van Kranenburg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).