From: Calvin Walton <calvin.walton@kepstin.ca>
To: Florian Lindner <mailinglists@xgm.de>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: subvolumes: default and IDs
Date: Mon, 30 Jul 2012 07:29:56 -0400 [thread overview]
Message-ID: <1343647796.6064.12.camel@ayu> (raw)
In-Reply-To: <CAJtBfr-ndERMvhG2dEwKJVsUe++sqGk_ZU=0gHDr3vbZLSyo_w@mail.gmail.com>
On Mon, 2012-07-30 at 09:56 +0200, Florian Lindner wrote:
> Hey!
>
> I recently starting playing with btrfs and subvolume, but it has left
> me puzzled:
> root@horus /mnt/test # btrfs subvolume get-default .
> ID 256 top level 5 path sv1
> ID 259 top level 5 path sv2
> <<<
>
> What is the default subvolume now? How can I tell?
It looks like there's currently a bug in btrfs-progs - the 'get-default'
command is actually doing a 'list' instead of printing the default. With
any luck it's just a little error in the command-line parsing and should
be easy to fix...
> >>>
> root@horus /mnt # btrfs subvolume set-default 5 test
> root@horus /mnt # umount test && /mnt # mount /dev/sdb1 test
> root@horus /mnt # ls test
> sv1/ sv2/
> <<<
>
> Ok, 5 seems to be the root subvolume id. Is it always like that? I
> remembered to have read somewhere it was 0 ? (which makes a kind of
> more sense for me)
The internal ID of the root subvolume is 5, yes. I don't know whether
this is a current implementation detail and subject to change, or if it
will permanently stay that way. I *think* it's part of the disk format,
and it permanent.
In either case, the subvol id '0' is treated as an alias for 'the
original root subvolume', and the two can be used interchangeably in the
mount command. I always find '0' just a bit easier to remember :)
> >>>
> root@horus /mnt # btrfs subvolume set-default 0 test
> root@horus /mnt # umount test && mount /dev/sdb1 test
> root@horus /mnt # ls test
> sv1.file
> <<<
>
> set-default 0 seems to do nothing but does not produce an error
> either.
Looks like you've found another bug (or maybe just a missing feature);
it would be nice if this command allows you to use '0' as an alias for
the root subvolume.
--
Calvin Walton <calvin.walton@kepstin.ca>
next prev parent reply other threads:[~2012-07-30 11:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-30 7:56 subvolumes: default and IDs Florian Lindner
2012-07-30 11:29 ` Calvin Walton [this message]
2012-07-30 12:43 ` Swâmi Petaramesh
2012-07-30 12:18 ` Liu Bo
2012-07-31 0:28 ` Alexander Karbstein
2012-07-31 0:50 ` Alexander Karbstein
2012-07-31 0:53 ` [PATCH] Btrfs-progs: Enabled setting root subvolume with subvolid=0 Alexander Karbstein
2012-07-31 1:26 ` Liu Bo
2012-07-31 2:09 ` Alexander Karbstein
2012-07-31 17:11 ` [PATCH V2] " Alexander Karbstein
2012-07-31 17:11 ` Alexander Karbstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343647796.6064.12.camel@ayu \
--to=calvin.walton@kepstin.ca \
--cc=linux-btrfs@vger.kernel.org \
--cc=mailinglists@xgm.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).