All of lore.kernel.org
 help / color / mirror / Atom feed
* R: Re: Subvolumes and /proc/self/mountinfo
@ 2012-06-20 12:02 Goffredo Baroncelli <kreijack@libero.it>
  2012-06-20 15:37 ` H. Peter Anvin
  0 siblings, 1 reply; 16+ messages in thread
From: Goffredo Baroncelli <kreijack@libero.it> @ 2012-06-20 12:02 UTC (permalink / raw)
  To: hpa, cwillu; +Cc: helmut, linux-btrfs

HI all,

>----Messaggio originale----
>Da: hpa@zytor.com
>Data: 20/06/2012 5.22
>A: "cwillu"<cwillu@cwillu.com>
>Cc: <helmut@hullen.de>, <linux-btrfs@vger.kernel.org>
>Ogg: Re: Subvolumes and /proc/self/mountinfo
>

>
>The concept of what is the "root" and what is the "path" is
>straightforward for lesser filesystems: the root of the filesystem is
>defined by the root inode, and the path is a unique sequence of
>directories from that root.  Note that this is completely independent of
>how the filesystem was mounted when the boot loader was installed.

For the aim of the discussion, I would like to highlight a small difference 
between the path of the subvolume and the subvolume-id.
The latter is the specific subvolume, the former is a "functional" reference
to this subvolume.

For example, in my root btrfs I have two two subvolumes: __active (the root 
filesystem of my system) and (__rollback the last "good" copy)

If I swap (via a rename) __active and __rollback, in the next boot my system
uses a "good" copy of the root filesystem. This is a simple way to swap 
two subvolumes, without involving the boot logic

Instead if I had tracked the subvolume-id, to swap the root filesystem I 
would have update the boot logic.

I suspect that could exists other cases where it is preferable to track the 
subvolume-id instead the path. However what I would highlight it is the two
ways aren't equal.

BR
G.Baroncelli


^ permalink raw reply	[flat|nested] 16+ messages in thread
* R: Re: Subvolumes and /proc/self/mountinfo
@ 2012-06-20 12:10 Goffredo Baroncelli <kreijack@libero.it>
  0 siblings, 0 replies; 16+ messages in thread
From: Goffredo Baroncelli <kreijack@libero.it> @ 2012-06-20 12:10 UTC (permalink / raw)
  To: list, H. Peter Anvin; +Cc: linux-btrfs

Hi All,

>----Messaggio originale----
>Da: list@fajar.net
>Data: 20/06/2012 8.31
>A: "H. Peter Anvin"<hpa@zytor.com>
>Cc: <linux-btrfs@vger.kernel.org>
>Ogg: Re: Subvolumes and /proc/self/mountinfo
>
>On Wed, Jun 20, 2012 at 10:22 AM, H. Peter Anvin <hpa@zytor.com> wrote:
>> a. Make a snapshot of the current root;
>> b. Mount said snapshot;
>> c. Install the new distro on the snapshot;
>> d. Change the bootloader configuration *inside* the snapshot to point
>>   to the snapshot as the root;

Or (as I wrote in an another replay), let the bootloader to start a subvolume 
identified by a path, and  swapping the subvolume via a simple rename.

>> e. Install the bootloader on the snapshot, thereby making the boot
>>   block point to it and making it "live".
>
>
>IMHO a more elegant solution would be similar to what
>(open)solaris/indiana does: make the boot parts (bootloader,
>configuration) as a separate area, separate from root snapshots. In
>solaris case IIRC this is will br /rpool/grub.
>
>A similar approach should be implementable in linux, at least on
>certain configurations, since if you put /boot as part of "/" (thus,
>also on btrfs), AND you don't change the default subvolume, AND the
>roots are on their own subvolume, the paths to vmlinuz and initrd on
>grub.cfg will have subvols name in it. So it's possible to have a
>single grub.cfg having several entries that points to different
>subvols. So you don't need to install a new bootloader to make a
>particular subvol live, you only need to select it from the boot menu.
>
>I'm doing this currently with ubuntu precise, but with
>manually-created grub.cfg though. Still haven't found a way to manage
>this automatically.

My /boot directory is an ext4 filesystem. During a "grup-update", I added an 
hook in the scripts which generates some entries for grub.cfg on the basis of 
the subvolumes which exist. Every entry is equal to the
default one but the options rootflags=subvol=<subvol>. So at the boot I can 
select different root (typicalli the default one and the one before an
aptitude update/upgrade)


Br
G.Baroncelli
>
>-- 
>Fajar
>--
>To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



^ permalink raw reply	[flat|nested] 16+ messages in thread
* R: Re: Subvolumes and /proc/self/mountinfo
@ 2012-06-20 11:51 Goffredo Baroncelli <kreijack@libero.it>
  0 siblings, 0 replies; 16+ messages in thread
From: Goffredo Baroncelli <kreijack@libero.it> @ 2012-06-20 11:51 UTC (permalink / raw)
  To: chris.mason, H. Peter Anvin; +Cc: linux-btrfs

HI all,

>----Messaggio originale----
>Da: chris.mason@fusionio.com
>Data: 20/06/2012 1.49
>A: "H. Peter Anvin"<hpa@zytor.com>
>Cc: "linux-btrfs@vger.kernel.org"<linux-btrfs@vger.kernel.org>
>Ogg: Re: Subvolumes and /proc/self/mountinfo
>

>> b. Are there better ways (walking the tree using BTRFS_IOC_TREE_SEARCH?)
>> to accomplish this than using /proc/self/mountinfo?
>
>Not yet, but I'm definitely open to adding them.  Lets just hash out
>what you need and we'll either go through Kay's stuff or add ioctls for
>you.

Chris, what about adding a /sys/btrfs/<fs-uuid>/<subvol-id> interface ?

For example under

/sys/btrfs/<fs-uuid>

we can list the devices which btrfs uses

under 

/sys/btrfs/<fs-uuid>/<subvol-id> 

we can show/set the subvolume properties (like RO, compres....)

>
>-chris
>--
>To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



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

end of thread, other threads:[~2012-06-21 17:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-20 12:02 R: Re: Subvolumes and /proc/self/mountinfo Goffredo Baroncelli <kreijack@libero.it>
2012-06-20 15:37 ` H. Peter Anvin
2012-06-20 16:34   ` Goffredo Baroncelli
2012-06-20 17:41     ` H. Peter Anvin
2012-06-20 18:06       ` Goffredo Baroncelli
2012-06-20 19:15         ` Helmut Hullen
2012-06-20 20:22           ` Goffredo Baroncelli
2012-06-20 21:49         ` H. Peter Anvin
2012-06-21  5:47           ` Goffredo Baroncelli
2012-06-21 11:46             ` Martin Steigerwald
2012-06-21 17:05               ` Goffredo Baroncelli
2012-06-21 13:38             ` H. Peter Anvin
2012-06-21 17:05               ` Goffredo Baroncelli
2012-06-21 17:11                 ` H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2012-06-20 12:10 Goffredo Baroncelli <kreijack@libero.it>
2012-06-20 11:51 Goffredo Baroncelli <kreijack@libero.it>

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.