0

I'm planning to install Debian on my server. I would like to design the partitioning scheme in such a way, that I could install one or more other *nix distributives on that. So, reading many articles I think this scheme could be a good one for the initial idea of multi-boot:

/grub
/swap
/LVM VG1 (for OS1) ->
            /boot (LV1)
            /     (LV2)
            /tmp  (LV3)
            /var   ...
            /var/log
            /home
/LVM VG2 (for OS2) ->
            /boot
            /
            /tmp
            /var
            /var/log
            /home
... (other distros)
/LVM VG0 (for data) ->
            /data (LV1)

But I'm confused a little bit now: what should be the labels for these partitions (unique or not) and what should be the mounting points looking as (/home (OS1) mounted to /home as well as /home (OS2)...)?

2
  • Not a full answer but a quick comment: (1) there is no reason to make separate LVM PVs and VGs for each OS. This just costs you flexibility by making hard boundaries on the amount of space each takes. If they're all various Linux distributions, just use a single PV&VG and each OS gets its own LVs (2) For casual use, you really don't need to have separate /, /tmp, /var, etc... Just make a / for each OS. Perhaps make a single shared /home if you want to share home directories between OSes. (3) you can actually share /boot between OSes if you oversize it, but it's cleaner if you don't
    – Celada
    Nov 12, 2012 at 3:04
  • thank you for the comments! I edited the question: - VGs for OSes and for Data - each OS has its own /boot partition
    – static
    Nov 12, 2012 at 3:08

3 Answers 3

0

Creating a volume group for each distro defeats the purpose of LVM. Create one volume group and use lvcreate to create partitions for your distros. To avoid confusion, use the OS name as a label for the logical volumes.

E.g.:

lvcreate -L 2G -n gentoo-root
lvcreate -L 8G -n gentoo-usr
lvcreate -L 2G -n debian-root
lvcreate -L 8G -n debian-usr

Use one "real" partition for /boot that is shared between all distros and handle it manually and one "real" partition for swap. Use one logical /tmp for all distros, or use ramfs with a size of about 200mb for that. /home should probably be shared by all distros as well. Apart from that, I think that /usr and /var could be a separate partition for each, but not /var/log. If you have some special-purpose file-structures with many small files, than creating separate partitions for those may be useful too. In most cases though, It's really not necessary to worry so much about this. Especially when all you want to do is try out some distros. It's often far more convenient to create one root partition for each distro and be done with it. It's really up to the user how much complexity they are willing to manage.

Summary:

separate logical volumes per distro

/     ~ 2gb
/usr  ~ 4-12gb 
/var  ~ 1-7gb

common lvs

/home
/tmp     (optional, this can be part of /)
/usr/doc (save space)
/usr/man (may be a bad idea for dissimilar distros)
/var/log (use syslog-ng to create distro-folders)

special purpose (many small files)

/usr/portage (gentoo "packges")
0

From my understanding of LVM, provided the logical volumes are in separate volume groups, the names don't have to be unique (because the VG name is prepended to the LV name). I tend to label my logical volumes with the name of the folder I expect to mount, or a terse description of what the LV will contain if there will be multiple directories in there (i.e. root for an LV which holds /).

I'm not sure what you meant by "what should be the mounting points looking as". Do you mean your fstab mounts? Those would go something like;

/dev/VG1/root    /       <fstype>     defaults    0      0    (and so on, fstab junk)
/dev/VG1/usr     /usr    <fstype>     defaults    0      0

... other system-specific LV's ...

/dev/VG0/data    /data    <fstype>     <options>     fstab-junk

Where VG1 changes between your above noted OSes and VG0 remains constant as /data.

I'm also not sure why you need a whole separate LV for /var/log?

0

With respect to Ярослав Рахматуллин's answer above: if you share a single swap file between multiple OS's be aware of the fact that hibernation is done in the swap file -- so booting a different OS than the hibernated one would destroy the hibernated session.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .