Sharing partitions between different flavours of Ubuntu
Q I finally built up a computer and installed Ubuntu. I divided my 750GB SATA drive into several partitions: /boot, swap, /, /usr, /local, /var, /home as per the recommendations in Practical Guide to Ubuntu Linux. I'm interested in installing an additional real-time kernel-type Linux such as 64 Studio or Ubuntu Studio for some audio and video projects. Can any of the existing partitions be used by the additional install? Do any packages used in both installs have to be installed into each Linux install? I would expect that /home data would at least be shared. How about /usr, /local and /var? Perhaps it is just my ignorance, but it seems that the differences could potentially be confined to /boot and a configuration file.
A The only two partitions that it is really safe to share are /home and swap. Swap data is temporary anyway and not expected to survive between reboots, so a common swap partition makes a lot of sense. Running a separate home partition is a good idea, because your data survives reinstallation, but it can be a little tricky to share /home between two distros. Because of differences in program versions, and possible conflicts of user IDs, it's not a good idea to share a home directory between two distros, so you're better off using one home partition but a different home directory on that partition for each distro.
You can either use a different username with each distro, or use the same name but a different directory. The convention of using /home/username as the home directory is just that, and is only a default setting, not a requirement. If your username is bryan, you could have home directories of /home/bryan-ubuntu, /home/bryan-studio and so on. Each distro installation is a separate entity: you cannot share installed program and library files between two. Some distros modify programs to suit their own needs, and it is very rare for them to update versions at exactly the same time.
You could share /boot in theory, but it can be a lot of work to set up and maintain, and a separate /boot partition is not really necessary with modern hardware. Using the number of partitions per distro that you are using is sure to exceed the partition limits of the system before long. You have a couple of options here. The simplest is to have a single root partition for each distro, plus common swap and home partitions. Each distro is then a self-contained entity within its own partition. A more flexible option, especially if you want to run multiple distros, is to use the Logical Volume Manager (LVM). This would entail having a small /boot partition for each distro plus a large partition given over to LVM. This would then contain logical 'partitions' for the various distros, as well as /home and swap.
The advantage of this approach is flexibility, volumes can be created, resized and removed on the fly, which is useful when experimenting. Many distros have an option to use LVM during installation. There is another option when experimenting with different distros: virtualisation. You can install VirtualBox on Ubuntu and create virtual machines within that for any distros you would like to experiment with. Only when one convinces you that you want to use it long term do you need to worry about partitioning the disk to install it.
Follow us on Identi.ca or Twitter