Saturday, March 21, 2009

Restore from USB and change unionfs to aufs

Restoring from USB, what I want to do extra this time is to convert unionfs into aufs (another union filesystem) because aufs is known to be more stable, less buggy than unionfs, and has already become the standard in later EeePC models. Since I am not sure if aufs is compatible with unionfs, I decided to restore from USB and do it from the very beginning.

To convert unionfs to aufs, what I need is:
1) A kernel with aufs support (Download: linux-image-2.6.21.4-eeepc_17_i386.deb)
2) A initramfs image from 900 or later models
3) an Asus EeePC System Recovery USB disk

The first step, of course, is to restore from USB. Since this is already covered in ch 6-9 of your Eee PC 701 User's Manual, I won't go into detail here (Update: You can read my blog of 2009/6/3 for screenshots and detailed steps).

Actually before I do the USB restore, first I edit the file /boot/grub/menu.lst in the Asus EeePC System Recovery USB disk to allow it to show the boot menu, with a choice to boot into debug mode.

STEPS:
1) Edit /boot/grub/menu.lst with your favourite editor. [NB. Do not use Windows notepad to edit this file. If you edit it in Windows, do not save it in MS-DOS style (CR+LF). It has to be saved in Unix style (LF).]
2) Comment the line #hiddenmenu (to show the boot menu)
3) Change boot delay time to "timeout=3" or more
4) Duplicate the boot entry and add a kernel parameter XANDROSCDDEBUG=y to the end of the kernel line as below:

title Asus Eee PC (debug mode)
root (0x80,0)
kernel /boot/vmlinuz quiet rw vga=normal irqpoll root=/dev/ram0 XANDROSCDBOOTDEBUG=y
initrd /boot/initrd.gz


Then, after the USB restore is completed, instead of booting into default xandros and run the First Run Wizard, I reboot again with the Asus EeePC System Recovery USB disk and this time select "debug mode".

Now I mount and chroot to sda1 to install linux-image-2.6.21.4-eeepc_17_i386.deb I have downloaded earlier. This package includes the kernel and modules for EeePC 900 model which has support for aufs.

mount /dev/sda1 /mnt
chroot /mnt
cat /proc/partitions


The last command will show you the device name of your Asus EeePC System Recovery USB disk. For example, in my case, it is /dev/sdc1. Now I need to mount it and install linux-image-2.6.21.4-eeepc_17_i386.deb.

mkdir /mnt/sdc1
mount -t vfat /dev/sdc1 /mnt/sdc1
dpkg -i /mnt/sdc1/linux-image-2.6.21.4-eeepc_17_i386.deb


You will see some warning messages about updating kernel, etc. Use the [TAB] key to select and [Enter] to continue. When you are done, then we copy the initramfs image from 900 or later models to /boot of sda1, backup the original:

cd /boot
mv initramfs-eeepc.img initramfs-eeepc.img.orig
cp /mnt/sdc1/initramfs-eeepc.img /boot


[NB. Alternately, if you don't have access to an initramfs image from 900 or later models, you can modify the original initramfs image of the 701 4G yourself following this wiki: Rebuilding initramfs, edit the init script to replace the line with the word "unionfs" to:]
mount -t aufs -o br:/mnt-user:/mnt-system none /mnt

Finally, exit from chroot mode, umount drives and reboot.

exit
cd /
umount -a
reboot


Now, you have a brand new system with the less buggy aufs.

Enjoy!

No comments:

Post a Comment