hi, i''m working on an initrd hook [http://aur.archlinux.org/packages.php?ID=33376] to support non-volatile system rollbacks (promoting a temporary rollback snapshot to the new active/default). when the system is installed to the default/"." subvolume (as many users probably initially do), it is more difficult/messier to manage system state; there are empty folders in each "child" snapshot where a subvolume used to exist (this seems like BUG to me, dir should not exist?) in the default subvolume. these grow/vary with time. to work around this and for cleaner implementation, i''ll intend to permanently boot a named subvolume [__active] (though its contents may be swapped out). ultimately, i have to tell the user to manually remove the old junk (/usr, /etc, /var, etc...) from the default subvolume (since its really in the /__active subvolume) moving along to a question... can the default subvolume be swapped/removed/renamed/popped/shifted? what would have been useful, would be the ability to generate an empty, parent subvolume to _contain_ the current one, and rename it to __active. btrfs gives rise to a "subroot" structure; the structure beneath the root. is something like this possible or can be added? an alternative idea i had was "promoting" a subvolume to be the new root, and anything "above" the new root is lost/forgotten. then i could create the subroot structure in a subvol, snapshot the default subvol to where i want it, and promote the subvol to be the new root. like a permanent pivot_root/chroot. great stuff, C Anthony -- 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
Hi, > moving along to a question... can the default subvolume be > swapped/removed/renamed/popped/shifted? I think "btrfs subvolume list; btrfs subvolume set-default <id> <path>" does what you need. - Chris. -- Chris Ball <cjb@laptop.org> One Laptop Per Child -- 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
On Wed, May 19, 2010 at 9:20 AM, Chris Ball <cjb@laptop.org> wrote:> Hi, > > > moving along to a question... can the default subvolume be > > swapped/removed/renamed/popped/shifted? > > I think "btrfs subvolume list; btrfs subvolume set-default <id> <path>" > does what you need. > > - Chris.maybe i''m missing something or not being clear. take the following setup for the "." subvol: / /etc /usr /lib if i snapshot / to /__active i now have: / /etc /usr /lib /__active i now "btrfs subvolume set-default <whatever_the_internal_id_is_for_active> /"... what happens to the directories /usr, /etc, and /lib that _still_ exist in the "." subvol? it''s my understanding that setting the default subvol DOES NOT actually do anything except negate the need to use the "subvol=<id>" mount option... the "." subvolume still exists, still can be mounted independently, still has files in it, and still is a parent the the now default __active subvol and thus CANNOT be removed. can i be confirmed on this reasoning? it seems to me that the original subvolume is somewhat immutable in its location and relation to other, "child" subvolumes. it''s the only one that cannot be "placed" into a different subvolume; it MUST be the ultimate parent. am i off base here or misinterpreting what "set-default" actually does (Arch is still on 2.6.33, i can''t use set-default yet so i admit i haven''t really played with it yet)? i wouldn''t think that simply setting a new default is the same as setting a new top-level subvolume; am i wrong? C Anthony -- 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