14 Apr 2007 (Sat)

10:33:24 # Life Booting from USB disks and why that's interesting. I've decided I wanted to try running Debian on nc4000 (laptop PC by HP). I didn't want to erase what is already there, so I needed some external USB HDD to do that. Since I didn't feel like hunting around for a USB CD-ROM drive and creating bootable USB, or configuring PXE, I decided to install using qemu to install to the USB HDD and use that installation on the machine. It was surprisingly simple. I connected my USB-HDD to my desktop machine, which recognized the disk as /dev/sda, and I used qemu to install Debian on it. qemu -hda /dev/sda -cdrom XXXX -boot d. Note that you really need kqemu or kvm for speed. Then, I selected LVM, and installed. After initial reboot within qemu, I changed the kernel to a 686 kernel since a k7 kernel was installed, but that's the only package I changed. After reconnecting the USB HDD to nc4000, I managed to boot from the USB disk. Initially, it failed to boot since vgscan ran before USB disk was recognized, and could not find the root device. Looking at the source, I found initramfs will probably re-try after 3 minutes. But reading further, I found that the timing can be improved by specifying rootdelay= boot option to the kernel. I specified rootdelay=15 for the kernel option in grub, and voila, it found the root filesystem on LVM. The /boot filesystem was /dev/hda1 inside qemu, but it is now /dev/sda1 on the nc4000; and boot stopped at fsck on /dev/hda1. It was trivial to fix after dropping into the command-line. LVM is able to work around device name change, which is nice to know. For the graphics card, qemu and nc4000 have different cards, and I had to dpkg-reconfigure xserver-xorg. Okay, so I have Debian running on my notebook via USB HDD, now what ?

Junichi Uekawa

$Id: dancer-diary.el,v 1.91 2006/06/15 15:14:10 dancer Exp $