Skip to contentSkip to conversation

R: Re: Subvolumes and /proc/self/mountinfo

DISCUSSION Goffredo Baroncelli <[email protected]> 1 participant 1 message Jun 20, 2012 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hi All,

Quoted 7 lines

----Messaggio originale----
Da: [email protected]
Data: 20/06/2012 8.31
A: "H. Peter Anvin"<[email protected]>
Cc: <[email protected]>
Ogg: Re: Subvolumes and /proc/self/mountinfo

Quoted 6 lines
Quoted 5 lines · H. Peter Anvin

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.

Quoted 18 lines
Quoted 2 lines

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.

Quoted 3 lines

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

Quoted 8 lines
Signature · 6 lines
-- 
Fajar
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html