Thread (5 messages) 5 messages, 2 authors, 2011-02-14

Re: Question on subvolumes and mount options

From: Hugo Mills <hidden>
Date: 2011-02-13 19:18:20

On Sun, Feb 13, 2011 at 06:49:58PM +0100, Yuri D'Elia wrote:
On Sun, 13 Feb 2011 17:30:59 +0000, Hugo Mills wrote:
quoted
quoted
First: In the / filesystem I create a subvolume named /home. As soon as
the subvolume is created, I can already see the entry point in /home
without having to mount it separately. Is that expected?
   Yes.
What happens if I mount the home subvolume into a different point, like:

mount -o subvol=home /home2

and then change a file in /home (which is accessible through the default
subvolume)?

Will the change be reflected on both mount points? Or the inverse
(change /home2)?
   Yes, it's the same piece of storage, just appearing at more than
one point in your overall filesystem. Similar to the way that bind
mounts work.
quoted
quoted
So, which is best? Looks like mounting subvolumes is not necessary.
   I would recommend putting nothing in the root of the filesystem
*except* subvolumes. i.e. create a "root" subvolume in / that contains
your root filesystem, and make that the default. Then you can mount
your btrfs root subvolume (i.e. the thing that contains all the other
subvolumes) somewhere like /media/btrfs-root, for purposes of managing
subvolumes.
So you would recommend creating both /root and /home subvolumes, to be
mounted separately, or create /root and /root/home subvolumes?
   The former.
quoted
quoted
like to use nodatasum except for /home, will the following work?

mount -o nodatasum /dev/x /
btrfs subvolume create /home
mount -o datasum,subvol=home /dev/x
   I'd expect that to work, although I haven't tried it myself.
What if I remount the /home subvol into /home2. What happens when I
touch a file through /home (nodatasum) and what happens when I use
/home2 - since both are available at the same time?
   They'll stay in sync with respect to the files written to either
one. I'm not sure what the behaviour of nodatasum is with different
mounts of the same subvolume.

   Hugo.

-- 
=== 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
      --- Try everything once,  except incest and folk-dancing. ---      

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