Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* howto create subvolume at top level?
@ 2015-06-01 17:25 Neal Becker
  2015-06-01 17:34 ` Calvin Walton
  2015-06-01 17:51 ` Duncan
  0 siblings, 2 replies; 5+ messages in thread
From: Neal Becker @ 2015-06-01 17:25 UTC (permalink / raw)
  To: linux-btrfs

[nbecker@nbecker2 ~]$ sudo btrfs subvolume create /home2
Create subvolume '//home2'
[nbecker@nbecker2 ~]$ sudo btrfs subvolume list /
ID 257 gen 66376 top level 5 path root
ID 316 gen 66376 top level 257 path home2

This created home2 under root.  How do I create home2 with top level as top 
level 5, at the same level as root?

IOW:

ID 257 gen 66376 top level 5 path root
ID 316 gen 66376 top level 5 path home2

-- 
Those who fail to understand recursion are doomed to repeat it


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: howto create subvolume at top level?
  2015-06-01 17:25 howto create subvolume at top level? Neal Becker
@ 2015-06-01 17:34 ` Calvin Walton
  2015-06-01 17:51 ` Duncan
  1 sibling, 0 replies; 5+ messages in thread
From: Calvin Walton @ 2015-06-01 17:34 UTC (permalink / raw)
  To: Neal Becker; +Cc: linux-btrfs

On Mon, 2015-06-01 at 13:25 -0400, Neal Becker wrote:
> [ nbecker@nbecker2~]$ sudo btrfs subvolume create /home2
> Create subvolume '//home2'
> [ nbecker@nbecker2~]$ sudo btrfs subvolume list /
> ID 257 gen 66376 top level 5 path root
> ID 316 gen 66376 top level 257 path home2
> 
> This created home2 under root.  How do I create home2 with top level 
> as top 
> level 5, at the same level as root?
> 
> IOW:
> 
> ID 257 gen 66376 top level 5 path root
> ID 316 gen 66376 top level 5 path home2

To do this, you have to mount the top level of the btrfs filesystem 
somewhere. For example:

mount -o subvolid=5 /dev/sda2 /mnt/btrfs

Then you can create your home directory under the top level by doing

btrfs subvolume create /mnt/btrfs/home2


-- 
Calvin Walton <calvin.walton@kepstin.ca>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: howto create subvolume at top level?
  2015-06-01 17:25 howto create subvolume at top level? Neal Becker
  2015-06-01 17:34 ` Calvin Walton
@ 2015-06-01 17:51 ` Duncan
  2015-06-01 18:01   ` Duncan
  2015-06-01 18:08   ` Neal Becker
  1 sibling, 2 replies; 5+ messages in thread
From: Duncan @ 2015-06-01 17:51 UTC (permalink / raw)
  To: linux-btrfs

Neal Becker posted on Mon, 01 Jun 2015 13:25:52 -0400 as excerpted:

> [nbecker@nbecker2 ~]$ sudo btrfs subvolume create /home2
> Create subvolume '//home2'
> [nbecker@nbecker2 ~]$ sudo btrfs subvolume list /
> ID 257 gen 66376 top level 5 path root
> ID 316 gen 66376 top level 257 path home2
> 
> This created home2 under root.  How do I create home2 with top level as
> top level 5, at the same level as root?
> 
> IOW:
> 
> ID 257 gen 66376 top level 5 path root
> ID 316 gen 66376 top level 5 path home2

Briefly stated, you don't.  Just like / is the top of a Unix style 
directory tree, the root subvolume is the top of a btrfs subvolume tree.  
You can't go higher than that, and that's what the top level /is/.

But what are you actually trying to do?  You _can_ change the default 
subvolume pointer so a subvolume other than root/5 is mounted by default, 
and you can nest subvolumes, so for most purposes, you can /pretend/ that 
some arbitrarily named subvolume is your top subvolume.  Alternatively, 
you can of course mount subvolumes wherever you want in the directory 
tree.

Also see the subvolumes discussion and related FAQs on the wiki if you 
haven't.

https://btrfs.wiki.kernel.org/

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: howto create subvolume at top level?
  2015-06-01 17:51 ` Duncan
@ 2015-06-01 18:01   ` Duncan
  2015-06-01 18:08   ` Neal Becker
  1 sibling, 0 replies; 5+ messages in thread
From: Duncan @ 2015-06-01 18:01 UTC (permalink / raw)
  To: linux-btrfs

Duncan posted on Mon, 01 Jun 2015 17:51:19 +0000 as excerpted:

>> This created home2 under root.  How do I create home2 with top level as
>> top level 5, at the same level as root?
>> 
>> IOW:
>> 
>> ID 257 gen 66376 top level 5 path root ID 316 gen 66376 top level 5
>> path home2
> 
> Briefly stated, you don't.  Just like / is the top of a Unix style
> directory tree, the root subvolume is the top of a btrfs subvolume tree.
> You can't go higher than that, and that's what the top level /is/.

OK, I see now, you already have a subvolume called root, that's not ID5, 
the root (aka top level ID5) subvolume.  Thus it's ID 257.  Fine 
distinction.

Calvin W is correct.  Mount the top level subvolume and create there.  
What you're doing now is actually what I suggested with the nesting, and 
your "root" subvolume <> the top-level ID5 subvolume.  I'll claim just 
waking up and not having my caffeine yet. =:^)



-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: howto create subvolume at top level?
  2015-06-01 17:51 ` Duncan
  2015-06-01 18:01   ` Duncan
@ 2015-06-01 18:08   ` Neal Becker
  1 sibling, 0 replies; 5+ messages in thread
From: Neal Becker @ 2015-06-01 18:08 UTC (permalink / raw)
  To: linux-btrfs

Duncan wrote:

> Neal Becker posted on Mon, 01 Jun 2015 13:25:52 -0400 as excerpted:
> 
>> [nbecker@nbecker2 ~]$ sudo btrfs subvolume create /home2
>> Create subvolume '//home2'
>> [nbecker@nbecker2 ~]$ sudo btrfs subvolume list /
>> ID 257 gen 66376 top level 5 path root
>> ID 316 gen 66376 top level 257 path home2
>> 
>> This created home2 under root.  How do I create home2 with top level as
>> top level 5, at the same level as root?
>> 
>> IOW:
>> 
>> ID 257 gen 66376 top level 5 path root
>> ID 316 gen 66376 top level 5 path home2
> 
> Briefly stated, you don't.  Just like / is the top of a Unix style
> directory tree, the root subvolume is the top of a btrfs subvolume tree.
> You can't go higher than that, and that's what the top level /is/.
> 
> But what are you actually trying to do?  You _can_ change the default
> subvolume pointer so a subvolume other than root/5 is mounted by default,
> and you can nest subvolumes, so for most purposes, you can /pretend/ that
> some arbitrarily named subvolume is your top subvolume.  Alternatively,
> you can of course mount subvolumes wherever you want in the directory
> tree.
> 
> Also see the subvolumes discussion and related FAQs on the wiki if you
> haven't.
> 
> https://btrfs.wiki.kernel.org/
> 

But I already have a server setup like this, which was created by anaconda:

sudo btrfs subvolume list /
ID 256 gen 1828545 top level 5 path home
ID 259 gen 1818478 top level 5 path root
ID 487 gen 1828544 top level 5 path root00

-- 
Those who fail to understand recursion are doomed to repeat it


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-01 18:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-01 17:25 howto create subvolume at top level? Neal Becker
2015-06-01 17:34 ` Calvin Walton
2015-06-01 17:51 ` Duncan
2015-06-01 18:01   ` Duncan
2015-06-01 18:08   ` Neal Becker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox