On Sun, Nov 30, 2014 at 09:01:37AM +0530, Shriramana Sharma wrote: > I am confused with this: should I call it the "root subvol" or > "top-level subvol" or "default subvol" or doesn't it matter? Are all > subvols equal, or some are more equal than others [hark to Orwell's > Animal Farm ;-)]?
I try to use "top level" for subvolid=5. "root subvol" is hugely confusing, as it could be one of several things. If you mean the subvol mounted at /, then I call that "/" or "the / subvol". "default subvol" is the one marked as default. This starts out as subvolid=5, but can be set to any other subvol. > And more importantly, is the ID of the root subvol 0 or 5? In the data structures on disk, it's 5. The kernel aliases 0 to mean subvolid 5. > The Oracle guide > (https://docs.oracle.com/cd/E37670_01/E37355/html/ol_use_case3_btrfs.html) > seems to say it's 0 : > > "By default, the operating system mounts the parent btrfs volume, > which has an ID of 0" > > but the BtrFS wiki (and btrfs subvol manpage) reads 5: > > "every btrfs filesystem has a default subvolume as its initially > top-level subvolume, whose subvolume id is 5(FS_TREE)." > > as also the Ubuntu Wiki: > > "The default subvolume to mount is always the top of the btrfs tree > (subvolid=5)." As above, both are correct here. > Now this Oracle page > http://www.oracle.com/technetwork/articles/servers-storage-admin/advanced-btrfs-1734952.html > says: > > "The only clean way to destroy the default subvolume is to rerun the > mkfs.btrfs command, which would destroy existing data." OK, this is actually wrong. It's not the default subvolume if someone's run set-default on the FS. They're correct that you can't delete the top-level subvol. You can't delete the subvol marked as default, either. Assuming (or implying) that the two are the same is just plain wrong. > So from what I've (confusedly) understood so far, 0 refers to the > superstructure (or whatchamacallit) of the entire BtrFS-based contents > of the device(s) and hence cannot be deleted but only reset by a > mkfs.btrfs, but 5 is only the default subvol (mounted when the FS as a > whole is mounted without subvol spec) provided by mkfs.btrfs, and > subvol set-default can have another subvol mounted as default instead, > after which 5 can actually be deleted? You can't delete subvolid=5. It's part of the "fundamental whatchamacallit" of the FS (a good name). Even if you change the default subvol, you still can't delete it. Hugo. -- Hugo Mills | People are too unreliable to be replaced by hugo@... carfax.org.uk | machines. http://carfax.org.uk/ | PGP: 65E74AC0 | Nathan Spring, Star Cops
signature.asc
Description: Digital signature