Ubuntu on a usb disk and Debian in a chroot

Sunday, October 23rd 2005

Now, I have long been interested in Ubuntu (who hasn't), and it is exciting to follow the revitalisation of Debian in the wake of Ubuntu.

I am a diehard Debian fan, and have previously only tried the Ubuntu Live disk. But yesterday this changed. I write this from a Ubuntu install on an external usb harddrive. My Debian installation is still thriving on the internal harddrive, in fact I use a lot of programs and documents from it.

Let me show you.

Installing Ubuntu: The Struggle

Using my Ubuntu 5.04 Hoary disc, I had no problems installing on the external harddrive (a 300GB Maxtor OneTouch II). But it did not boot. All I got was the error message:

USB Mass Storage support registered
pivot_root: No such file or directory
/sbin/init: 428: cannot open dev/console: no such file
Kernel Panic - not syncing: Attempted to kill init!

Clearly not good. And the pivot_root: No such file or directory message strongly suggested the cause: the ubuntu root partition was not found.

The solution

Luckily, this is swiftly remedied:

  • re-boot from the Ubuntu install disc, this time supplying the parameter rescue

  • when asked, mount the correct root file system (the one on the external drive)

  • type mount -t proc proc /proc

  • mount your boot partition if you have one

  • Add "ehci_hcd", "ohci_hcd", "ide_disk" and "usb_storage" to "/etc/mkinitrd/modules":

    echo -e "ehci_hcd\nohci_hcd\nide_disk\nusb_storage\n" >> /etc/mkinitrd/modules
    
  • Open /etc/mkinitrd/mkinitrd.conf and increase the variable DELAY from 0 to 10

  • Create the new initrd:

    mkinitrd -o /boot/initrd.img-[kernel version]-usb [kernel version]
    

Now, you can try out the new initrd from grub, and if it works you can edit /boot/grub/menu.lst to make it permanent.

Running Debian within Ubuntu

Setting up what is called a chroot, I am able to run all the programs from the Debian installation even though I've booted Ubuntu. And it's not just Debian: The same technique would've let me run any other Linux or BSD.

Here's how:

  • mount the debian partition: sudo mount /dev/hda6 /mnt/debian

  • mount proc: sudo mount -t proc proc /mnt/debian/proc

  • mount tmp: sudo mount --bind /tmp /mnt/debian/tmp. Why do we mount tmp? Because we need it to run X clients, graphic progams, from within the chroot.

  • Fix networking:

    sudo mv /mnt/debian/etc/resolv.conf /mnt/debian/etc/resolv.conf.old; 
    sudo cp /etc/resolv.conf /mnt/debian/etc
    
  • Now you can enter the chroot:

    sudo chroot /mnt/debian /bin/bash
    

Voila! You're "running Debian"! There's one thing left before you can start your graphic programs: since the graphic server is started by Ubuntu and not Debian, you need to import the so-called Magic Cookie. I'm sure there are other ways to do this, but here's a simple one:

In a Ubuntu shell, type: xauth list. This will list the "Cookies". Add these by typing in a Debian shell:

xauth add [paste line from Ubuntu shell here]

I recommend cutting-and-pasting the cookies, so typing errors don't bite you.

Now, try to run a graphic program, like xclock or qtorrent. Does it work?

Proceratium google

Saturday, October 22nd 2005

I guess being a verb is cool, but you know you've hit the sweet spot when someone names a species after you. Thus, the google ant

Flåttfeber

Tuesday, October 18th 2005
Jeg har fått flåttfeber. Drittsekken kaller seg *Rickettsia africae* og har gnagd hull på min høyre legg. Legen sa at jeg skulle kjøre den gode gamle mølla på den (anti-biotika) og holde meg i ro i 10 dager. Helt i ro. Ligge-i-senga i ro. Fysj. Litteratur: * [MSIS-rapport nr. 9, 2000 (Nasjonalt Folkehelseinstitutt)][1] - Under **Afrikansk flått-tyfus** (!) [1]: http://www.fhi.no/eway/default0.asp?pid=223&oid=0&e=0&trg=Area_4397&MainArea_4320=4392:0:15,1411:0:0:0:4320;4389;::0:0:0&ContentArea_4392=4397:0:15,1411:0:0:0:4320;4392;::0:0:0&Area_4397=4470:26906::0:4396:44:4320;4392;4397;::10:0:0

Gamlelandet, Langnestunnellen og bar overkropp

Tuesday, October 18th 2005

Rutiner. Og særlig morgenrutiner. Isj.

Jeg har aldri vært noe særlig hypp på morgener. Men så kom min stjerneseng inn i livet, og hun hadde med seg ønske om å stå opp tidlig og høre på P2s "Nyhetsmorgen". Lenge fikk hun drive med det uforstyrret, men etterhvert ble jeg også mer og mer glad i den heseblesende, informasjonspakkede sendingen hver morgen.

Og det har ikke endret seg - selv om vi nå bor 34 grader syd, på den sørlige tuppen av det afrikanske kontinent - takket være Nrks nettradio.

I dag hørte vi at Langnestunnelen er stengt på grunn av arbeid av noe slag. Jeg aldri blitt så glad for å høre vegnyheter som da. Hva sier dette om nyhetskriteriene?

Så sant, så sant

Thursday, October 13th 2005

Jeg har alltid likt slate.com, selv om jeg ikke har lest den så ofte. I dag leste jeg en velskrevet og akkurat passe tøff artikkel. Det ga en god følelse.