Partitioning advice for dual boot with Windows XP and two separate Linux installations

Main goals is to have/being:

  • Windows XP
  • Main Linux installation
  • "Some other" Linux installation which I am currently experimenting with.
  • All three OS installations completely separate (at least to begin with). I won't share /home between my Linux installations, as it might be that some applications I'm using are of different versions and thus have different config files in my $HOME.
  • Able to wipe the current Windows XP installation and install a previous image of it later on, to enjoy a fresh Windows system.
  • Able to change my experiment Linux installation into some other distribution.
  • Creating a sensible partitioning scheme for this which fits my 120.0 GB hard drive. Appended info: It's for a laptop with a relatively weak CPU and no hardware viritualization support, so adding a HDD isn't an option nor is running a full fledged OS in a VM.

Why:

  • I've not used Windows for maybe 10 months. I'm not about to start using it extensivly, but it might come in handy from time to time if I need to run some Windows only software.
  • My main Linux installation is Ubuntu, which I do like a lot. At the same time I do feel that some things could be improved (it contains an exceptionally old version of Awesome in it's latest LTS offering and I tend to think that a rolling release system would be more convenient to use). Due to this I would like to explore the other distributions which are out there...
  • My experiment Linux installation should just be for testing things out. I would like to try a couple of different distributions (my first is Arch Linux) and try to configure them. It's mostly for playing around and experimenting. If I find something I like it might replace my main Linux installation later on.

Questions and thoughts:

  • How would you suggest I partition my hard drive? My idea is having Windows XP and my experimental Linux installation on one partition each. And maybe spread out my main Linux installation over multiple partitions if there is a benefit to it. Will all Linux distributions be happy to live in a single partition?
  • Do you see any problem in writing over my current Windows XP with an older image later on? I guess it shouldn't mess up the partitioning table or the MBR, but I'd like a second opinion.
  • What about the installation of different distributions on the experimental part of my hard drive? (The part I saved for experimental installs of Linux.) Any problems you foresee?
  • I was thinking of using Clonezilla for the imaging. I need to image individual partitions as that's what I need to restore as well. I'm sending/receiving the images from my home server, so they need not be stored on the 120 GB hard disk. Any comments on this? Will I have to make a note of the partitioning scheme on paper in case the partition table accidentally should be damaged to be able to restore the partitions?
  • What else should I think about when planning this setup?

Solution 1:

Having done (almost) exactly this for several years on my laptop (I never replaced my Windows install with a fresh one, though), here are some comments I have:

  1. This should work just fine.
  2. Linux has no problem living on a single partition, I did it all the time with my small experimental install which in my case was Ubuntu as I run a Redhat Enterprise clone (Scientific Linux) as my primary OS. For your main install you may want to break it up into a few different partitions (e.g. /boot, /, /home, /usr/local) according to your preferences.
  3. The partitions I used were 25GB for Windows, 10GB for my "experimental" Linux, and the remaining disk for my main Linux (I have a 120GM hard drive as well). Depending on the size of your existing Windows installation and what you want for your experimental partition you can adjust these as needed. You might want a little more in the experimental Linux partition if you want to install a bunch of stuff to play with.
  4. The main issues you'll run into is every time you want to install a new OS on one of the partitions, it will want to update the MBR so that the computer boots from the newly installed OS. I worked around this by first installing Windows, then installing my primary Linux OS. Next I saved the MBR to disk and thumbdrive (i.e. dd if=/dev/sda of=orig.mbr -bs 512 -count 1) Then, whenever you install the secondary Linux you just rewrite the MBR back to the disk and update the menu.txt in the /boot/grub directory to include the reference to your new partition.
  5. I'm not sure about what the exact procedure is for installing a previous image of the windows partition. If you can just write to the disk without going through the install process, there shouldn't be any issue. If you have to reinstall and Windows overwrites the MBR you'll need a boot disk to get back into Linux (and LiveCD would work) and rewrite the MBR that you saved to restore you dual boot capability.
  6. You can share swap partitions between the two Linux installs.

The laptop in question for me was Intel Core Duo 2GHz with 2GB RAM and 120GB HD. Here is the exact partition table I used but the details aren't that important, it's just to give you an idea:

  • Dell utility partition (90MB)
  • Windows Partition (25GB)
  • /boot (100MB)
  • Logical partition (rest of the disk) containing
    • / (10 GB)
    • /usr/local (8 GB)
    • swap partition (4 GB)
    • /home (~55 GB)
    • experimental partition (10 GB)

It may not have been the best (most optimal) partitioning scheme and opinions vary widely on what partitions to create, but it worked just fine for me.

Solution 2:

---How would you suggest I partition my hard drive?

  • Partition 1 - windows - majority of disk
  • Partition 2 - Linux_Main - Sized based on number of apps to be installed
    • 6g minimum install for modern top5 distros
    • 10g "full desktop x install"
    • 16g java and development desktop
  • Partition 3 - Linux_Test
  • Partition 4 - Swap - equal to ram

Shared data for the linux installs to be kept on the windows partition.

---Will all Linux distributions be happy to live in a single partition?

Yes. As long as you use "standard" filesystems and features. Don't use EXT4 yet. The main benefits of partitioning linux systems are security and mitigating out of disk errors. Neither happen magically just from partitioning. Better to learn on a single partition and then create multiple partitions when you understand why and what else needs to be done to take advantage of the added complexity. Many people/companies have multiple linux partitions which serve no purpose other than to waste more slack space. When you use multiple partitions you'll create them based on security and usage patterns.

  • Boot partition - doesn't need to be mounted during use, saves a trivial amount of ram. It can be slightly more secure in protecting the kernel from being overwritten. It doesn't make sense for security unless compiling your own kernel instead of using the standard modular kernel. The hacker would just load a module to hack the kernel. It's much easier than replacing the kernel and forcing a reboot/kernel reload.
  • Read only partitions - /bin /usr - protects against out of disk and rootkit overwrite of binaries. You must not allow union file systems, remounts, symlinks, etc. or the security benefits are minimal.
  • Read/write configuration - "etc" - doesn't grow excessively, many systems can be replicated with a base install, updates, then restoring the etc directory.
  • Read/write high volume growth directories - /var/log, /var/cache, /var/spool - mitigates out of disk errors due to excessive logging during error conditions.
  • Read/write system data - mysql, webroot and similar
  • Read/write user configuration - hidden home directories containing preferences
  • Read/write user data - home/download, home/documents, home/pictures, ...
  • Read only shared data - Company manuals, templates, install iso's, service packs
  • Read/write shared data - project directories, group directories, department directories
  • As the company grows you may want to create separate partitions for each managed app for easy restriction of rights and auditing for different support personnel. Mail, database, web server, accounting, ...

And if this seems complex, it's actually overly simplified. Use a single partition or the distributions partitioning recommendation until you're sure you know why you want something different.

---Do you see any problem in writing over my current Windows XP with an older image later on?

Activation maybe, otherwise no.

---What about the installation of different distributions on the experimental part of my hard drive? ...Any problems you foresee?

Don't use LVM, EXT4 or other "new" file systems. Always use custom partitioning during linux installs and install into either Linux_main or Linux_test as needed.

---I was thinking of using Clonezilla ...

No problems here. Use custom/expert mode Clonezilla for highest compression to save space.

---Will I have to make a note of the partitioning scheme on paper in case the partition table accidentally should be damaged to be able to restore the partitions?

I've never needed to with many multi-boot systems. How/why would the partition table be damaged without damaging data in the partitions? This usually happens from jumping into a automatic install using the whole disk and the partition info alone probably won't help by the time you notice the problem. You shouldn't be doing potential partition modifications without backing up first. (adding a disk, re-partitioning, installs, etc.)

---What else should I think about when planning this setup?

Never share home partitions from different linux versions or distributions, share data only. I solve mangled home directory problems often for other people who try to do this. Other than transient cache data your home preference data should never be a significant size to matter. Therefore there is no benefit to sharing it, only potential problems using mismatched versions of preferences and binaries. Do share the data portion of your home directories.

Install grub into the 1st sector of each linux's partition. Then install a third grub in the MBR and chainload to the two partition grubs. This way kernel updates will always be reflected in the menus and the MBR will never be messed with during updates or re-installs. (Except for a windows re-install when you'll need to replace the MBR grub and edit the chainloader menu options for the two linux partitions again. Just do a web search for grub chainload. There are many howto's online to do this type of setup. I have development QA testing systems with 12 or more distributions (6x2 32bit and 64bit) to test against on a single drive. These are used for hardware testing of devices not supported in virtualization.

Solution 3:

Just a little warning: Many Linuxes defaults to use LVM partitioning when installing, but Windows XP will not install on a hard disk that contains LVM partitions (I suppose reapplying an XP image is OK, though I've never tried that).