Ubuntu on Sun Fire X2200

At HTG we have been using Sun servers for hosting your websites and apps, and we’ve been happy with them once they are up and running. Getting them there has been a little bit of a battle at times. To make our lives easier for future installs, and for anyone else out there who wants to run Ubuntu on the X2200 servers (and presumably others with the Nvidia FakeRaid), here is our guide for installation.

There may be some holes here - if you find some, leave a comment and we’ll get it updated!
Partition the disk with fdisk

fdisk /dev/mapper/

Mount the real partitions of the disk to the /target directory

mkdir /target
mount -t ext3 /dev/mapper/nvidia_[tab complete this one] /target
mkdir /target/boot
mount -t ext2 /dev/mapper/nvidia_[tab complete this one] /arget/boot

Add the extra mount points

mkdir /target/dev
mount –bind /dev /target/dev
mkdir /target/proc
mount -t proc proc /target/proc
mkdir /target/sys
mount -t sysfs sysfs /target/sys

Install the boostrap program, and the get system set up

apt-get -y install debootstrap
debootstrap edgy /target

Copy hosts & sources.list to chrooted environment

cp /etc/apt/sources.list /target/etc/apt
cp /etc/resolv.conf /target/etc
cp /etc/hosts /target/etc

Now to the chroot

chroot /target

Once in the chrooted jail, open another terminal (outside of the jail) and remount special filesystems:

mount –bind /dev /target/dev
mount -t proc proc /target/proc
mount -t sysfs sysfs /target/sys

To get rid of the missing locale messages:

locale-gen en_US.UTF-8

Now install dmraid

apt-get update && apt-get install -y dmraid

Now install ubuntu-standard

apt-get -y install ubuntu-standard

Install grub

apt-get install -y grub

Install the kernel - answer yes to the symlink question, and no to the abort question

apt-get install -y linux-server

Add a new user

useradd [you]
passwd [you]

Now for some grub setup - this gets a bit involved….

mkdir /boot/grub
cp /lib/grub/x86_64-pc/* /boot/grub/.
ls /dev/mapper
grub

Tell grub what device to use for hd0

device (hd0) /dev/mapper/[Device name from ls command above - NOT PARTITION]

Set the root partition - this is the partition number of the boot partition, starting with the number 0!

root (hd0,0)

And now the grub setup

setup (hd0)

We’re done inside the grub prompt

quit

Now run Ubuntu’s command to update grub

update-grub

Before editing the menu.lst file, copy the name of the RAID drive again!
Now we need to update the menu.lst file to reflect the dmraid setup.

vim /boot/grub/menu.lst

Going down the file - leave leading #’s as they are commands to the update-grub program:

  1. change # kopt_2_6=root=/dev/hda1 to # kopt_2_6=root=/dev/mapper/[root partition]
  2. change # groot=(hd0,0) to be the correct boot partition
  3. set # lockalternative=false to true
  4. If /boot is on its own partition, remove the /boot/ directory names from the kernel and initrd lines
  5. make sure the root= portion of the kernel lines point to the root partition of the RAID array
  6. Save the file - optionally, you can set a password (please use an md5 hash!)

Update the initramfs file!

update-initramfs -c -k `ls /lib/modules`

Update the fstab file - the easiest way to do this is to copy one from another system, or suffer through handwriting one without any guidance.

To install vmware-server, you will also need to install ia32-libs

3 Responses to “Ubuntu on Sun Fire X2200”

  1. A. Karl Kornel Says:

    Interesting. I’m looking into purchasing an X2200 M2, which would just be running Ubuntu 6.06, and I’ve been wondering: Do you really have to use the NVidia fakeRaid feature? Could it be deactivated, and (a) the drives treated as individual drives, or (b) software RAID (md) be used instead?

  2. Wyatt Says:

    No, you don’t have to use the fakeRAID feature; however, we wanted to leave the ‘hardware’ do the work for us on the RAID side of things. Out of the box, Linux will see both drives on the system and you can treat them as individual drive or you could use the md software RAID solution if you wanted to.

  3. Tomaz Says:

    This example lacks two important things. One needs to use command “pwconv” after useradd/passwd, otherwise things fail because of lack of shadow password.

    The other thing is “savedefault” option in /boot/grub/menu.lst. Grub does not handle writing to md devices and this command fails with something like “file not found” because it can not write to fake raid.

    Other than that it is perfect. Works like a charm.

Leave a Reply