I would like to have several linux OS (OpenSuSE, Mint, Ubuntu) inside the same btrfs partition. It is flexible and uses snapshots in a very comfortable way.
I installed OpenSuSE leap 16.0 and after installation, following AI advice on internet, I did the following:
Opened my terminal to become root.
Created a temporary mount directory: mkdir /mnt/btrfs-root
Mounted the Btrfs device root: mount -o subvolid=5 /dev/MY_DRIVE_PARTITION /mnt/btrfs-root
Went to the mounted root: cd /mnt/btrfs-root
Ran the mv command to rename the folder: mv @ @OpenSuSE
Edited /etc/fstab to replace all @ with @openSuSE
Updated the grub configuration: grub2-mkconfig -o /boot/grub2/grub.cfg
Updated the initrd to pick up the new filesystem layout: dracut --regenerate-all --force
Left the temporary root: cd /
Umounted: /mnt/btrfs-root
Rebooted
It worked.
I still have a working OpenSuS Leap 16.0E, now residing under the new subvolume named @OpenSuSE.
It seems to me that I might now add another OS to a new btrfs subvolume that would be named @Mint. But the question is: how? If I install Mint in the same partition as where OpenSuSE resides, not formatting it, will this installation create the now ‘vacant’ subvolume @ that I can edit to become @Mint like I did after the installation of OpenSuSE Leap 16.0?
This is very much like poking the sleeping bear in its cave. Or rather, hitting it hard over the head with a baseball bat just to see what will happen.
The result won’t be nice. I see a very angry bear and lots of guts and gore in the future.
I don’t think what you intend to do can work even in theory. The same root filesystem for different distros? Mixing kernels, executable binaries and configuration files from them all? Seriously? I see no reason why this should work.
Sure you can experiment; it’s your machine. But don’t expect it to work. Even if it should - against all odds - boot, consider system maintenance; mixing package updates from different distros using different tools will multiply the problems.
I am going a bit further than Stefan: this is a ridiculous idea, and doomed to fail big time. Would I trust any data to live on such a system? I am not even gonna answer that.
YOU install other OS into the BTRFS subdirectory???
Don’t think that will work in any case OTHER os may or may not support BTRFS in any case are expecting to be in their own partitions on a subdirectory and the BIOS would not see them in any case
Everything. From boot until whatever else. It simply cannot work. I don’t wanna use my brain to think of all that would go wrong, it would explode tonight.
You would need to rewrite the complete OS to work.
Simple example:
Program xy expects its libraries under /usr/lib
Now you modify your path to /distribution-gaga/usr/lib and /distribution-othergaga/usr/lib for your other OS on the same partition.
Result: program xy will no longer start/work as the path /usr/lib no longer exists and it can’t find needed libraries on any of your OS.
You would need to modify EVERY SINGLE link in 100% of every application. You would need to rebuild 100% of all packages to adapt to the new file paths. Good luck.
My fstab (for a few lines) looks like this: UUID=a29717f0-0d51-47ec-b4a6-bbd8d181f31f / btrfs defaults 0 0 UUID=a29717f0-0d51-47ec-b4a6-bbd8d181f31f /var btrfs subvol=/@OpenSuSE/var 0 0
I think it explains why it will indeed not work.