Thread (29 messages) 29 messages, 9 authors, 2011-01-25

Re: Synching a Backup Server

From: Hugo Mills <hidden>
Date: 2011-01-09 22:01:01

On Sun, Jan 09, 2011 at 08:57:12PM +0000, Alan Chandler wrote:
On 09/01/11 18:30, Hugo Mills wrote:
quoted
   No, subvolumes are a part of the whole filesystem. In btrfs, there
is only one filesystem. There are 6 main B-trees that store metadata
in btrfs (plus a couple of others). One of those is the "filesystem
tree" (or FS tree), which contains all the metadata associated with
the normal POSIX directory/file namespace (basically all the inode and
xattr data). When you create a subvolume, a new FS tree is created,
but it shares *all* of the other btrfs B-trees.

   There is only one filesystem, but there may be distinct namespaces
within that filesystem that can be mounted as if they were
filesystems. Think of it more like NFSv4, where there's one overall
namespace exported per server, but clients can mount subsections of
it.
I think this explanation is still missing the key piece that has
confused me despite trying very hard to understand it by reading the
wiki.  You talk about "Distinct Namespaces", but what I learnt from
further up the thread is that this "namespace" is also inside the
the "namespace" that makes up the whole filesystem.  I mount the
whole filesystem, and all my subvolumes are automatically there (at
least that is what I find in practice).  Its this duality of
namespace that is the difficult concept.  I am still not sure of
there is a default subvolume, and the other subvolumes are defined
within its namespace, or whether there is an overall filesystem
namespace and subvolumes defined within it and if you mount the
default subvolume you would then lose the overall filesystem
namespace and hence no longer see the subvolumes.
   There is a root subvolume namespace (subvolid=0), which may contain
files, directories, and other subvolumes. This root subvolume is what
you see when you mount a newly-created btrfs filesystem.

   The default subvolume is simply what you get when you mount the
filesystem without a subvol or subvolid parameter to mount. Initially,
the default subvolume is set to be the root subvolume. If another
subvolume is set to be the default, then the root subvolume can only
be mounted with the subvolid=0 mount option.
 I find the wiki
also confusing because it talks about subvolumes having to be at the
first level of the filesystem, but again further up this thread
there is an example which is used for real of it not being at the
first level, but at one level down inside a directory.
   Try it, see what happens, and fix the wiki where it's wrong? :)

   Or at least say what page this is on, and I can try the experiment
and fix it later...
What it means is that I don't have a mental picture of how this all
works, and all use cases could then be worked out by following this
mental picture.  I think it would be helpful if the Wiki contained
some of the use cases that we have been talking about in this thread
- but with more detailed information - like the actual commands used
to mount the filesystems like this, and information as to in what
circumstances you would perform each action.
   I've written a chunk of text about how btrfs's storage, RAID and
subvolumes work. At the moment, though, the wiki is somewhat broken
and I can't actually create the page to put it on...

   There's also a page of recipes[1], which is probably the place that
the examples you mentioned should go.
quoted
   The main awkward piece of btrfs terminology is the use of "RAID" to
describe btrfs's replication strategies. It's not RAID, and thinking
of it in RAID terms is causing lots of confusion. Most of the other
things in btrfs are, I think, named relatively sanely.
I don't find this AS confusing, although there is still information
missing which I asked in another post that wasn't answered.  I still
can't understand if its possible to initialise a filesystem in
degraded mode. If you create the filesystem so that -m RAID1 and -d
RAID1 but only have one device - it implies that it writes two
copies of both metadata and data to that one device.  However if you
successfully create the filesystem on two devices and then fail one
and mount it -o degraded it appears to suggest it will only write
the one copy.
   From trying it a while ago, I don't think it is possible to create
a filesystem in degraded mode. Again, I'll try it again when I have
the time to do some experimentation and see what actually happens.

   Hugo.

[1] https://btrfs.wiki.kernel.org/index.php/UseCases

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
        --- A clear conscience.  Where did you get this taste ---        
                         for luxuries,  Bernard?                         

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help