Sunday, September 14, 2008

Dual-Booting EeePC on Ubuntu and Debian

Hardware

My new Eee PC (I call it kpeeepb) came with a variant of Debian Linux installed, ASUS-branded Xandros. Two problems: I don't like branding, and if you follow the instructions on the EEE Wiki called "Pimp My EEE", you wind up with a brick that (while it can still read Word documents) hasn't got any disk space left for user modifications.

Unacceptable, I bought a memory card just so I could mod the thing out, now I've got Ubuntu installed on it but until recently I had mucked the thing up so I couldn't boot without using a USB Key. I don't know. I've got it fixed now so Grub is installed on the main system disk, and you can actually boot the XFS root on my memory card if you want to use the basic Ubuntu Netbook Remix.

I'd rather have Debian EeeOS on the main disk, so you can actually boot the system without a memory card. I was kind of hoping to use that memory card for carrying movies around with me, and if I could keep a backup of my own modifications with a pretty small footprint. The installation instructions call for an already working Linux system on the host computer, the backup Ubuntu System OS is on the memory card. I will need that if I turn it into a brick.

As long as I can boot GRUB, I should be able to enter these commands with the memory card in and expose a working Linux system:
grub> root (hd1,1)
grub> kernel (hd1,0)/vmlinuz-2.6.24-21-eeepc root=/dev/sdb2
grub> initrd (hd1,0)/initrd.img-2.6.24-21-eeepc
grub> boot
I've entered those commands and the wheels are turning... sdb has been recognized in only 731 jiffies... next my system is booted, and ready to overwrite the main system disk according to the instructions.

Oh no! I put the root filesystem specifier on the wrong line, initrd booted but the kernel couldn't find a root filesystem, and the grub process dumped me out to the busybox prompt. I thought I would mount my filesystems and poke around just to see what happened.

Well, I forgot to unmount them, and apparently ext2fs is just that fragile!
grub> kernel(hd1,0)/
Error 2: Bad file or directory type
So, I'm going to have to take a detour on these instructions. Ready to wipe my USB key completely, lets install eeeos_beta2 on the key and boot from that. There we can run e2fsck and find out what happened to my /boot partition on the memory card.

If that exercise was any indication of my luck, I'm going to need more than one solution for independent backup.

gunzip -dc eeeos_beta2.img.gz | sudo dd of=/dev/DEV

On IRIE, the DEV here is /dev/sdf1 for the first partition on my Kingston 4GB Data Traveler. Depending on phases of the moon (or, what device gets plugged in first) this is either (hd1):/dev/sdb or (hd2):/dev/sdc on the Eee. Once the system is up and running from the stick, I can copy the beta2.img file to the main system disk and complete the installation instructions normally.

Wait... I can still fix it without the stick! I had the foresight to copy the newer 2.6.24 kernel from Ubuntu system onto the Xandros root on sda1. My kernel is still hanging out somewhere I can get at it. I should still be able to boot. Phew!

Oh well, of course I will be overwriting it soon enough... don't forget to fsck sdb1 first chance you get, it really needs the cleanup after that mess.

Commentary

I surely won't need these instructions again. The machine is a rock. It's not going to need another reformat, once I installed Debian. Maybe a new set of menus... but that can wait until I learn some UI programming.
D'oh, so I really hosed that ext3 partition somehow. I think it's best to leave the booting to the system disk. Here's what you need to get strapped into Xandros, or whatever is the main system on disk sda1:
root (hd0,0)
kernel /vmlinuz root=/dev/sda1
initrd /initrd.img
boot


Looks like it's Ubuntu today.

Homework List

Today is C#/Haskell day. There is an assignment each from last week that needs review, and an assignment each for next week that needs new code. Systems Programming assignment was not completed, I think it's due this coming week... one Physics WebAssign each week and the first has already been lost to inattention.

Chemical Literature: the first submission of my Bibliography (using the Professor's template) is due TONIGHT at 11:59PM on RIT's myCourses website.

1 comment:

yebyen said...

I wish there was a progress indicator for dd. The key is still blinking; it's not ready yet.