Building minimal ubuntu 9.04 root filesystem

Monday, March 30 2009 @ 01:04 AM MDT

Contributed by: holla

I switched from loyal debian user to ubuntu after the tremendous success with my HTPC. I'm re-tooling my scripts to use jaunty, ubuntu 9.04. Here are the instructions to create a minimal bootable drive.

Download the desktop install cd and boot (booting off cd will not affect your computer's hard disk install)
Get networking going and open a terminal window.
apt-get install debootstrap
Insert your disk drive, CF or USB drive.
Ubuntu will automount the drive, right click on the drive desktop icon, then eject.
run dmesg to see what device your drive was, mine was sdc
(make sure you have the correct device for this next step)
cfdisk /dev/your_drive_here
Make a swap partition, set type to swap 82
Make a root partition, set type to linux 83
Make the root partition bootable
Write and exit
mkswap /dev/your_swap_partition
mkfs.ext3 /dev/your_root_partition
mount /dev/your_root_partition /mnt
debootstrap jaunty /mnt
mount -t proc /proc /mnt/proc/
chroot /mnt (your prompt should change)
apt-get update
apt-get install linux-image-generic
apt-get clean
exit (your prompt should change)
grub-install --root-directory=/mnt --no-floppy /dev/your_drive_here
chroot /mnt (your prompt should change)
update-grub
passwd root
exit
umount /mnt/proc
reboot the select your drive
/boot/grub/menu.lst may have incorrect values if you get root filesystem panic errors during boot
reboot, stop grub with esc and type these commands
kernel /vmlinuz root=/dev/thedrivepartitionfromthepanicmessage
initrd /initrd.img
boot
login as root
change /boot/grub/menu.lst to fit your drive position

0 comments



http://www.embeddedlinuxinterfacing.com/article.php?story=20090330010448888