Having multiple Linux installations on the same disk is not a problem. The installer should get everything right, though this depends on your distribution (which you don't specify). With “automated” distributions such as Ubuntu, you may just need to answer one or two questions; with “hands-on” distributions such as Arch, you may need to configure a couple of things manually.
There's no risk of losing any data as long as you're careful not to tell the installer to overwrite your existing installation (double-check all partition numbers). I recommend deleting /dev/sda7
now, that way you can just tell the installer to install in the free space.
Only one of the distributions will manage the bootloader. It can be either the old one of the new one. Older BIOSes require the bootloader to be near the beginning of the drive; I don't know the exact timeline but if your 500GB drive was sold with your computer.
You can share swap space between installations. This should happen automatically if you tell the installer to use /dev/sda6
as swap space.
You can share home partitions between installations. Here I'm less confident that the installer can do the right thing. Make sure it doesn't reformat /dev/sda5
(if it does, it will ask for confirmation before). If you can't get the installer to do what you want, add an entry for /home
manually to /etc/fstab
on the new installation. Copy the entry from the existing installation, it should look like
/dev/sda5 /home ext4 defaults 0 2
If the installer doesn't add mount points for your existing system, add them yourself to /etc/fstab
. You'll probably want to do that on the existing installation anyway. An entry in /etc/fstab
looks like this:
/dev/sda7 /media/linux2 auto defaults
Replace defaults
by ro
if you want to mount read-only, or by noauto
if you don't want the filesystem to be mounted at boot time but want to be able to mount it with the command mount /media/linux2
. If you want both options, it's a comma-separated list: noauto,ro
. If your installer doesn't add fstab
entries to the new installation, they should be something like
/dev/sda3 /media/linux1 auto defaults
/dev/sda5 /media/linux1/home auto defaults
The two entries should be in this order. You'll need to create the directories /media/linux1
and /media/linux2
. You only need to create /media/linux1/home
if you want to be able to mount /dev/sda5
even when /dev/sda3
is not mounted.
sda4
, 5–7 are called logical partitions) partitions. You need a bootloader in the boot sector, but your existing installation has already taken care of that. You can share swap partitions.. – Gilles 'SO- stop being evil' Feb 19 '11 at 16:00