Lumière is a system I built a couple of months ago to be a pure Linux-only machine. I haven’t done much with her, but it’s time to change that. As I’ve posted before, I really wanted to run different distros through their paces in order to weigh their pros and cons. However, I also wanted to have a system that I could actually use, so I decided to do a multiboot system with shared /home partitions.
Last night, I decided to start off easy and add Linux Mint (Felicia) on top of Ubuntu (Intrepid Ibex). Now I say that this is easy since Linux Mint is actually a modified version of Ubuntu (which also happens to be a modified version of Debian). Since Linux Mint and Ubuntu share a similar structure, all the user and group IDs would be the same. This means that setting up a shared /home partition would be much simpler.
I also wanted to use Linux Mint since it has been highly recommended to me many times.
I didn’t know how to do this on my own since I’m still so new with running Linux for a desktop, so I used this very helpful guide: Dual boot with two Linux, using the same home directory. This guide uses Debian Etch and Mandriva rather than Ubuntu and Linux Mint, but all the instructions seemed to match any combination of distros that I’d like to use.
In fact, doing the installation was even easier than the instructions as I didn’t have to mess with any syncing of user and group IDs. My process went as follows:
- I booted from my Linux Mint disk and ran the installation program once the live desktop loaded.
- I did everything as normal until I reached the “Prepare disk space” step of the installer. Since this step is for setting up the partitions and I wanted to share the /home partition, I need to do some work.
- I selected the Manual option and clicked Forward.
- I have two drives: /dev/sda and /dev/sdb. /dev/sdb is the drive I want since that’s where Ubuntu is installed while /dev/sda is merely for storage. I selected the unpartitioned space on /dev/sdb, created a new partition, selected a mount point of /, and selected an ext3 format. I then edited the /dev/sdb5 partition, which is my /home partition, and set it to a mount point of /home. I also have a swap partition, /dev/sdb4, so I edited it and set it to my swap.
- After making these changes, I clicked Forward.
- On the “Who are you?” step, I supplied the same username and password as I had used for Ubuntu. I don’t believe that this is necessary as just the IDs have to match, but I did this nonetheless.
- I continued the rest of the installer as normal until I reached the “Ready to install” step. I clicked “Advanced…” and selected to have the boot loader installed on /dev/sdb7, my newly created / partition, rather than on the /boot partition.
- I then completed running the installer.
- Going back to the instructions in the guide, I rebooted the system into Ubuntu.
- I opened the /boot/grub/menu.lst file and modified it by adding the following at the very bottom:
title Linux Mint
root (hd1,6)
chainloader +1I emboldened some of the text to point out the truly important part to get right. I remember cringing when I first saw this a few years back, and it still doesn’t look friendly.
Basically, Grub uses different drive and partition identifiers than Linux uses. The first number represents the drive while the second number represents the partition.
Linux starts naming my drives sda, sdb, sdc, etc, Grub starts naming my drives hd0, hd1, hd2, etc. Notice that the letter is now a number and rather than starting at 1, it starts at 0. Similarly, the partitions also start at 0 rather than 1. So in my system, /dev/sdb7 is actually hd1,6 to Grub. You can find a lengthier description at Grub Terminology.
- After I saved this change, I rebooted, hit ESC to bring up Ubuntu’s boot menu (you have to do this quickly as it just gives you 3 seconds by default), and selected my new Linux Mint option.
That should be the end of the story, but I ran into a problem. When I got to Linux Mint’s Grub menu and selected a boot option, I received the following error:
GRUB Error 22: No such partition
I was very disheartened when I saw this since problems with boot partition/Grub configuration haunted me during my earliest attempts to run Linux. I decided to power through this problem since I needed to learn how to handle these situations at some point.
I went back to the menu selection screen for Linux Mint, edited the default option (pressed ‘e’ while that option was highlighted), and looked at the information. I knew that I had the correct partition, and I double-checked to ensure that I did the count starting at 0 rather than count starting at 1. Everything checked out. I don’t have any reasoning to explain what I did, but I had a hunch and took a stab at it. I had the following configuration:
title Linux Mint, kernel 2.6.24-16-generic
root (hd1,6)
kernel /boot/vmlinuz-2.6.24-16-generic root=/dev/sdb7 ro quiet
initrd /boot/initrd.img-2.6.24-16-generic
I then changed it to the following:
title Linux Mint, kernel 2.6.24-16-generic
root (hd0,6)
kernel /boot/vmlinuz-2.6.24-16-generic root=/dev/sdb7 ro quiet
initrd /boot/initrd.img-2.6.24-16-generic
Amazing! It’s booting up. That’s when I hit the next major snag. Linux Mint itself failed to load and complained about a missing partition. “What in the world?” I thought. I rebooted and edited the boot option again. That’s when I saw it. The partition was also referenced in the kernel option. So, I made one more change:
title Linux Mint, kernel 2.6.24-16-generic
root (hd0,6)
kernel /boot/vmlinuz-2.6.24-16-generic root=/dev/sda7 ro quiet
initrd /boot/initrd.img-2.6.24-16-generic
Note: I removed splash
from the end of the kernel
option in order to make the data fit nicely on the page.
I booted from this newly-modified set of options, and after a couple of minutes, I was greeted with a friendly login screen. When I logged in, I was very surprised. In the midst of fixing all those boot errors, I forgot what the point of all this was. When the desktop loaded, I was looking at nearly the exact same desktop as I had on Ubuntu. The shared /home partition worked beautifully.
So, what was the problem that I had and why did my fix work? Ubuntu and its Grub loader saw my OS drive as the second drive in the system, so that drive was treated as /dev/sdb (or hd1). However, Linux Mint and its Grub loader saw the same drive as the first drive and named it /dev/sda (or hd0). My hunch was that they somehow saw the drives differently and changed hd1,6 to hd0,6 and /dev/sdb7 to /dev/sda7. I still don’t know why this is, but I’m going to keep digging. When I have an answer, I’ll post it here.
As for Linux Mint, I’m going to test it out over the next couple of days. Expect to see some posts about it soon.
Did I help you?
I also have a dual boot Ubuntu Jaunty & Mint7 using the same home directory.
I had Jaunty installed first and then installed Mint7 just as you say. I thought that there might be problems, but so far I can boot either and everything seems fine. The only exception are the Min Menu & a few utilities unique to each which show up as Applet not found.
Originally I tried installing Mint with its home on / then changing fstab to make home the same as on Jaunty. This did work but a few things did not work. In particular the bash terminal did not pick any login or profile scripts. I have read that Jaunty & Mint handle these differently. I used webmin to set up the home directories identically.
All the problems were solved when I did a fresh install of Mint7 giving the original home directory and selecting the first user to be 1000, which it is by default. By the way, it is the user number that matters, not the user name. If you do ose webmin be very careful, you can wreck your system if you don’t know what you are doing.
I am replying because I have seem a few post suggesting that it is dangerous to share the same home folder. This is true, but Min7 & Jaunty are both Ubuntu 904 and it seems to work. I do not know what would happen if I had installed Mint first then Jaunty. Maybe other people would be kind enough to share their experiences. I find that Mint’s multimedia works out of the box and Ubuntu, specially amd64 has been a real pain to get working on my Samsung Q210.
Thanks for sharing your results Ian. I’m glad that everything is working well for you.