Sharing SWAP and /home beteween Ubuntu 15.10 and Kali Linux 2.0

5,169

Solution 1

  1. Yes, you can use one swap partition for several Linux operating systems.
    There is an exception, in case want to hibernate, you cannot share a swap partition.

  2. Yes, it is possible but not recommended, better create separate partitions.
    There you can store your personal data and you can access them from every system.

Below an example of a convenient disk partition setup for being used by multiple systems :

enter image description here

enter image description here

As you can see in the screenshots, the data partitions are separated from the system partitions.

They can be accessed from every operating system, in this case from non-Linux systems as well.

sdb is used for operating systems : sdb3 contains the Ubuntu system, sdb4 contains virtual disks.

sda is used for everything external : sda1 contains personal data, sda2 music, photos and videos.

sda3 contains backups of data and operating systems, sda4 (bootable) ISO files and various tools.

This is only a suggestion, of course, you should create partitions suitable for your personal needs.

Solution 2

Sharing swap will mean you can't hibernate but that's the only real downside.

Sharing a common /home can be a bad idea. You have different versions of the same applications writing their settings all over the place. Something is bound to explode at some point.

I'd avoid it and instead set up a shared data partition that you mount and/or symlink into each home to supplant things like ~/Documents, ~/Music, etc.

Share:
5,169

Related videos on Youtube

Severus Tux
Author by

Severus Tux

Updated on September 18, 2022

Comments

  • Severus Tux
    Severus Tux almost 2 years

    I am currently running Ubuntu-15.10 on my machine and I am planning to install KaliLinux alongside Ubuntu. I would like to know 2 things before I proceed.

    (As both Questions are related and similar, I included both in same question)

    1. Can I have Only 1 (current) Swap partition for both?

    Should I create 2 different swap partitions 1 for each? Or can I use the existing Swap partition as a common Swap?

    1. Can I use the same /home Partition for both?

    I have an 25GB separate partition for /home on my Ubuntu. It would be amazing if I could share the same /home for both the O.S so that changes made in one will be reflected in the other

    And I will follow these (if required):

    • I will use the Exact same username if both the O.S
    • I will create one and only one user in both the O.S
    • Permission of /home will be set to 777 always

    I am aware that During the installation of the 2nd OS, if I tick ☑ on /home instructing it to use the current partition, It will be formatted once. But will this effect Ubuntu?

    Note : I am not having an encrypted /home

  • Severus Tux
    Severus Tux over 8 years
    Interesting... :-) Could you please provide more explanation about setting up a shared data partition? or a link.. Thanks :D
  • Oli
    Oli over 8 years
    It's just a partition with files on it. The naming and layout is completely up to you.
  • Rinzwind
    Rinzwind over 8 years
    @oli symlink is bugged with Nautilus (files in Desktop do not get moved to trash when you delete them and error out). Just create 2 homes (1 for each) and change user-dirs.dirs to point to a /data/ partition
  • Joe
    Joe over 8 years
    As Oli says, sharing /home sounds a lot better than it actually is. I tried it between 2 versions of the same distro - kubuntu - and had things go a bit crazy. One other thing to note: /home isn't the only issue. I currently dual boot between 12.04 and 15.04 which use different versions of grub. Every time I get a kernel update in one, it updates a grub menu that the other one doesn't look at. Have to keep fixing it manually or rewriting the mbr.