Showing posts with label unionfs. Show all posts
Showing posts with label unionfs. Show all posts

Wednesday, May 27, 2009

Restore EeePC from Recovery DVD without unionfs

A few weeks ago, there was a discussion in this thread of the EeeUser Forum on restoring an EeePC from the Recovery DVD image but without union filesystem. At that time, I had modified my Boot Xandros from USB for Dummies nounionfs script for this but I had no time to test it.

Today, since it is public holiday in Hong Kong and I don't need to work, I have finally tested this out and confirmed that this works on my 4G for both the 701 recovery image of my 4G and a 1.6 French iso I have downloaded. I suppose it should also work for all EeePC models.

What this script does:
1) Restore the Recovery DVD image to the 1st SSD (/dev/sda)
2) Copy a new initramfs image (for booting without unionfs) to /boot and modify the grub boot menu (/boot/menu.lst) accordingly
3) fdisk to create 3rd and 4th partition (sda3 and sda4) in /dev/sda (for BIOS update and Boot Booster)
4) Resize /dev/sda1 to fill up the remaining space in /dev/sda

Please note that unlike the default restore script, this script will not format the 2nd SSD (/dev/sdb). So if you have a 900 or later models with 2 SSD, with /home mounted in /dev/sdb1, your personal data will be untouched.


RESTORE STEPS:

1) Put your EeePC Recovery DVD into the DVDROM of your winxp desktop pc, run the Asus BootTool FreeOSTool.exe to create an Asus EeePC System Recovery USB disk as per instructions in your EeePC User Manual or as per this wiki: Howto: USB Restore or read my blog of 2009/6/3 for screenshots and detailed steps.

2) Download initramfs-eeepc-nounionfs-ext3.img compiled by eFfeM and save it to the root folder of the Recovery USB disk
3) Download restore-nounionfs.tgz and extract the files to the root folder of the Recovery USB disk [NB. Do not use winzip to extract the files]
4) Now plug this Recovery USB disk to your EeePC, reboot and press [ESC] at bootup to select the USB disk as 1st boot device
5) Then the script will run, and after user confirmation (Enter "yes"), restore the system to the 1st SSD without union filesystem


NOTE:

  1. If you want to use another initramfs image, say initramfs-eeepc-nounionfs.img for non-journalled ext2 filesystem, you can modify line 8 of the script restore-nounionfs.sh to reflect the change. If, however, you want to use an initramfs image for ext2 filesystem, you should also comment out line 110 of the script.
  2. The script should also allow you to restore to the 2nd SSD, just edit line 6 of restore-nounionfs.sh, but this is untested.

Change Language from French to English

The 1.6 French iso supports both French and US English. You can easily change the locale to English once you have started up. However, the firstrunwizard is in French. So you will need to learn a little French to go through the wizard:

Anglais = English (to select keyboard)
Retour = Back
Suivant = Next
Annuler = Cancel
Nom = Name
Terminer = End

You can forget all other settings (except "user name" and "password") because you will need to run the firstrunwizard again to completely change the system to English.

So after your system has started up. Run /opt/xandros/bin/locale_dialog either from File Manager or in a terminal.

Then select "Anglais (US)" from the pull-down menu, and press "Suivant" (Next).

In the next dialog box, select "Oui" (Yes) to apply the change.

Now the tabbed menu will be changed to English, but the programs menu are still in French. Next you need to delete the hidden file .firstrundone in /home/user. Then on reboot, everything will be in English except Acrobat pdf reader and the French dictionary which you will need to uninstall and install the English version after changing your /etc/apt/sources.list to:
deb http://update.eeepc.asus.com/1.6 common main
deb http://update.eeepc.asus.com/1.6 p701 main
deb http://update.eeepc.asus.com/1.6 en main
[Note: search for "-fr" in synaptic and uninstall them all. Then install "xlex" to get back the English Dictionary. For me, I also install all "-zh-tw" packages (except for firefox3) for Traditional Chinese locales.]

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!