Re: Debian 8 and Debian 9 Dual Boot
On Mon, 13 Nov 2017 11:01:27 -0500
Dan Norton <firstname.lastname@example.org> wrote:
> Although I didn't say so, each install would have its own set of
> directories. Please say more about how to mount the other
> installation and share data. How to mount things in another volume
Good advice so far, but to add a bit: all LVM groups will be seen at
boot, and /dev will know about them. See man lvm2 and also here:
https://wiki.debian.org/LVM for complete information about the
commands you have available. There are also numerous tutorials on the
Net which show basic usage of the simpler commands. It's worth having a
look when you have some spare time, as one day you'll need to know some
of this and won't have any spare time.
Look in /etc/fstab for lines beginning /dev/mapper/[volume] which will
be the volumes mounted in the running installation. The 'mapper' is
turning LVM volumes into things which look like partitions for many
To mount the volumes in the non-running installation, you need to add
similar-looking lines to fstab, and don't forget to create directories
somewhere quiet, like /mnt, to mount them on. You will need to add an
option to the entries that the running mounts do not have: if you
don't, systemd will try to mount them on boot, and if it fails, will
abort the boot. No problem if the extra mounts are on a drive that is
always there, but if stored on a second drive which is later removed,
it will kill the machine.
So you want either the option noauto, which tells systemd to ignore the
volume and you will always mount it manually (just mount <mountpoint>
in a terminal will do that, the fstab entry will have all the options
needed), or x-systemd.automount which will also be ignored during boot
but will be automounted when you try to access it. I mount my network
shares with that option, for the same reason (losing one will only put
a huge timeout into boot, but won't actually abort it) and also so that
mounting them will not slow down booting.
Here are a couple of spare LVM volumes on my workstation, one of which I
use only occasionally and always mount manually. You might notice that
the automount point is called oldroot, guess what that is...
/dev/mapper/newerlvm-spare /mnt/spare ext4 rw,user,noauto 0 0
/dev/mapper/newlvm-root /mnt/oldroot ext4 rw,user,x-systemd.automount
If you do mount the non-running system root, which is convenient for
many purposes, do be especially careful where you are in the directory
tree. The directories will look very similar, and it is easy to
misconfigure the wrong system. Years ago, I copied a system to a second
drive, then went into it to adjust the /etc/fstab to the new values it
needed. I managed to edit the wrong fstab, and neither system would
boot... fortunately, that was an easy one to fix.
So yes, it is safer only to mount the data of the other installation,
at least once you have the new one working properly and have duplicated
what you want from the old one.