The Lynx, The Leopard, and The MBP Part 2

So with partition plans in hand from the previous post I reboot using my Snow Leopard DVD and using this post as a guideline I repartition the HDD into 4 partitions then resize them accordingly. The first partition is formatted as OSX Extended with Journaling enabled with a size of 50GB, which is to house the OSX install. The second partition is set OSX Extended with Journaling disabled and a size of 240GB, which is to house all of the shared data. The third and fourth partitions need to be 25GB and 5GB respectively but both will be set up by the Ubuntu install so for now they get formatted as msdos/fat partitions. Then I continue with the install stripping out any optional fluff I can find (Printer Drivers and extra languages namely) and let the install go. Thought I’d note here that after the install was done and all the latest updates applied the Snow Leopard install took up about 12GB, but I plan on installing XCode later which will take up a good sized chunk. I also wanted to use rEFIt rather than having to hold down the alt key anytime I reboot to get to my Ubuntu install (given that I’d like to use it as the default), so I ran the Installer Package for that before rebooting to do the Ubuntu install.

After that it’s time to reboot using the Live CD and this time choose “Install Ubuntu 10.04″. Again, using this article as a guideline I go through the install of Ubuntu. Nothin’ fancy during the install process except for the partitioning, which I chose to do manually. The only things that need to be modified are the last two partitions. The 25GB one should be set as Ext4 for its type and should be flagged to be formatted and mounted at “/”. The 5GB one should be set to “Use as: Swap”. Other than that it’s defaults all the way down.


DiskUtil after both installs have been completed

After that install finishes, I’m able to boot into either OS just fine and I get a nice little GUI splash screen to pick which one I want to boot to each time I reboot. I like that, but I want the auto boot timeout to be a bit quicker, so I boot into OSX and

sudo vim /efi/refit.conf

and change the first line there to

timeout 3

I also want Linux to be the default OS so I go to the bottom of the file and change the default_selection to

default_selection L

Now I want to set up the shared partition so that both OSX and Ubuntu can have symlinks set up to point to the same data, residing on the shared partition. Here’s my basic process for this.

  1. Mount the drive in Ubuntu (see here for help with that)
  2. Create the User folder and all of the subfolders that will need to be shared (Documents, Music, Pictures, etc) on the Shared drive.
  3. Delete the corresponding folders in ~ (making sure to move anything from them to their shared equivalent first)
  4. Create the symlinks in ~ to replace them:
    ln -s /mnt/shared/rarana/Documents ~

After this I had some problems with permissions due to the OSX user and the Ubuntu user having different UID’s. This article took care of that for me. Basically I had to go force Ubuntu to assign my user the UID and GID that the default OSX user uses (501:20).

The last thing I want to take care of while still in Ubuntu is GRUB. It sucks that when I pick Linux in rEFIt, it then sends me to the MBR Partition which I then get a GRUB prompt and have to choose Linux a second time. Since I know that everytime I choose this partition I’m going to be booting into Ubuntu, I want GRUB to shut up and leave me alone. To make that happen:

sudo vim /etc/default/grub

and make sure these 3 lines read like this:

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true

noting that the hidden timeout line has been uncommented. Then

sudo vim /etc/grub.d/30_os-prober

and comment out the if statement:

 if [ "x${found_other_os}" = "x" ] ; then

and its corresponding fi (hint: its the outermost if statement in the adjust_timeout() function).

After saving that file run

sudo update-grub

to generate a new Grub Config file.

After that the only thing left to do for now is boot into OSX and replace the User’s folders with symlinks to the Shared Partition (which should already be mounted automatically).

Next time I’ll talk about some minor tweaks to getting things running the way I’m used to and probably porting over all my backed up data.

Helpful Links

The Lynx, The Leopard, and The MBP Part 1

So I’m a total ‘nix newb and it’s high time I resolved that. And the only way I can think of to do so is to put it on my everyday use machine in a way that I can make myself use it everyday as my main OS. So I’ve done my research and I’m going to dual boot my MBP with Ubuntu 10.04 Lucid Lynx (64-bit desktop version) with OSX 10.6 Snow Leopard. I’m going to set up a shared partition which will hold all of my data (Music, Pictures, Movies, Code, etc) which will be accessible (read/write) from both OS’s, and I will give Ubuntu an honest try and only boot into OSX when absolutely necessary. I figured this adventure would be a good time to start the ol’ blog back up (rather, start it anew since I lost all my old posts :P ) and document my journey for posterity and all that.

So to start, some information about what I’ve got currently. I’m using a Macbook Pro 5,1 (found by running

sysctl hw.model

from a Terminal in OSX) 2.8GHz Core2 Duo, 4GB RAM with a 320GB HDD, with about 200GB of it currently used. First step, of course, is to back that up so I can get back to what I’ve got if I muff this whole thing up. After that I’ll burn a cd with Ubuntu 10.04 LTS 64-bit Desktop and boot into Ubuntu from the Live CD to verify there’s no glaring hardware/driver issues and that this whole thing might be worth doing.

Next I’ll need to take inventory of what all that data is so I can figure out how much space to give each of my partitions. So browsing through my disk I find the following:

  • /Applications – 4.5GB
  • /Developer – 7.9GB
  • /Library – 9.2GB
  • /System – 4.8GB
  • /Users/rarana – 177.2GB
    • ~/Documents – 23.2GB
    • ~/Library – 23.4GB
      • ~/Library/MobileSync – 2.3GB
      • ~/Library/Caches – 709MB
      • ~/Library/iTunes – 702MB
      • ~/Library/Steam – 17.9GB
    • ~/Movies – 5GB
    • ~/Music – 110.5GB
    • ~/Pictures – 11GB

The OSX partition will need to have enough room for /Applications, /Developer, /Library, and /System. The Applications folder should shrink a bit in size as when I do the fresh install I’ll be trimming some fat. Probably by about the amount that the ~/Library folder will add to it (Steam will probably not be added, at least not with all of the games I have installed there currently, which drops the size of that folder by 17GB). So, around 26GB for that partition to hold what it currently holds. With a 320GB HDD, I’d like to be able to give it plenty of padding so I’ll call that one at about 45GB.

The System Requirements for Ubuntu 10.04 say it should take about 15GB, again I’d like to give myself some padding so I’ll give it 25GB. Ubuntu also needs a swap partition, which, since I have 4GB of RAM, 5GB should be more than sufficient.

The shared partition will need to contain ~/Documents, ~/Movies, ~/Music, and ~/Pictures, as well as about 4GB of code and data that I have spread across several folders that I didn’t want to list out. So that’s about 153GB that will need to go to the shared partition at least. With 75GB taken by the two OS’s I’m left with 245GB so that should cover it :)

With my data all backed up and partitioning all planned out, I’m off to go make it happen. Check out the next post to see my notes on actually implementing these plans.

Useful Links