(4th Apr, 2014 12:00 AM)Killerbee Wrote: [ -> ]@mk01
The big question here is: is "/home" part of "/" when used on one single partition?
According to xbian's btrfs-auto-snapshot configuration not
According to me ...........
imagine BTRFS as a two layer storage provider.
- one layer works with base storage providers (disk, partition, file ...) - working with just one partition or consolidating more of them while building ONE new flat virtual storage.
- second one is using this virtual storage - space - to allow us to create a filesystem. and because at layer one it took from us the possibility of "separation", sub-volumes were introduced what allows us to create literally a filesystem within a filesystem.
in praxis this means:
- you don't care and don't bother with the issues of repartitioning (shrinking, expanding, splitting, merging)
- adding new "free space" can be so easy as saying to btrfs "take /dev/sdd"
- creating new "separated" storage for another OS is so easy as creating new sub-volume with one command on existing filesystem
- removing the OS again is question of one command (removing the subvolume) while the before allocated space is immediately put back to "common" pool
all this is not quite visible (clear) to user with BTRFS as BTRFS is trading implementation simplicity for user space tools easy of use and variability. in ZFS it is all very fast and easy to understand.
and now to the "root" and "home" and "one partition" story (finally!)
so in XBian we have (mostly) one device (partition) in use. so we create a "common" btrfs partition on it. now you will ask how we separate userdata from system - we create two sub-volumes, one called root and second called home. on this level it is exactly as before with two partitions. for system boot "root" is used. then /home partition (home sub-volume) is mounted to /home. reformating "root" partition means deleting and creating "root" sub-volume. the same for "home".
but we will never face problem of root being initially too small or home being initially too small. they simply share the "common" space so during development we don't need to bother us or the user with discussions how we would like to do it or the user would like it.
another example of use would be - how to install second OS in parallel ? normally you need second storage (SD, USB disk, etc). or you need to bother with repartitioning - or worst case removing all and reinstalling with different setup. with XBian you simply use existing BTRFS "space" while creating new sub-volume.
BTRFS unfortunately displays sub-volumes as directories. this is why initially there is confusion. if you mount XBian filesystem you see just folders, root, home... but in deep BTRFS this are sub-volumes which are (to some extent) separated from each other. so Raspbian would be installed in three steps:
- creation of new subvolume root/raspbian
- deploying system to this subvolume
- booting from same storage (/dev/sda1 for instance) with different mount option (subvol=root/raspbian).
((there is much more to tell about anyhow - and what was told is very much simplified. some aspects have been not considered at all - to avoid confusion))
there is even a "bootloader" with XBian which allows you to choose what you want to boot (including separate kernels etc). once it will be at least "preliminary" tested and we have at least basic doc/wiki for the "traditional" functions, this should be introduced to the user/community.
I call it "it will come the day".
(4th Apr, 2014 01:54 AM)dharmabm Wrote: [ -> ]btrfs is a bit hard to wrap you head around, particularly for someone who knows a bit about traditional filesystems. it is kind of like LVM in a sense, but not. both '/' and '/home' are considered subvolumes, somewhat as if you setup your traditional linux with seperate partitions for '/' and '/home' (or '/boot', or '/var'). honestly i don't completely understand it myself yet, but the more i learn about it the more sense it makes.
if you have this level of knowledge or imagination then quite fast answer to help you is exactly how btrfs is doing it.
btrfs is one big metadata tree (so N-array tree). sub-volume is another N-array tree attached to the first one. or going to start - one big N-array tree with "volume" property (which is splitting the "one big" into more "bigs" - providing thus "separation" )