EDIT 2008/9/9: I have worked out a new initramfs image which should work for all Eeepc models, i.e. for both unionfs and aufs. The download location and package name is still the same.
EDIT: I have put the latest instructions in this webpage: http://fire.prohosti...nux/bootusb.htm . Also added variation of steps for no unionfs here.
This is a re-write of the steps for Windows users (and Linux newbies) to built Xandros on USB from your desktop with Puppy Linux live CD. This is especially for those who have already installed Windows on the SSD of your eeepc, so you are opt to do it on your desktop with a Puppy Linux live CD.
Booting the stock distro from USB flash disk has been reported to be working good for the simple desktop. But for the advanced desktop on USB flash disk, some people have reported problem. So be conservative on this. There have been some issue reported for booting from SD in built-in card reader: sometimes the SSD filesystem become read only. But if you are just browsing, then it is no problem.
WHAT YOU WILL NEED
1) A desktop PC that supports booting from CD.
2) A DVD ROM on your desktop PC.
3) The Asus P701L.gz image file of the stock distro (from the rescue DVD that comes with your eeepc).
4) A Puppy Linux live CD ISO image which you can download from here: puppy-3.01-seamonkey.iso and burn into a bootable CD. Here is the puppy-3.01-seamonkey.iso.md5.txt for verifying md5 checksum.
5) A target USB device where you want to install your Xandros on USB. It can be any SD, or SD or CF card in a card reader, USB flash disk or USB hard disk partitions of at least 4G size.
We will need to built 2 partitions: the SYSTEM partition (2.5G) and the USER partition (around 1.5G, can be more or less). They can be on separate drives. All we need to do is to identify them with a volume label to be specified in the menu.lst config file of GRUB (the default boot loader). Here I have used the volume labels SYSTEM_USB and USER_USB respectively. Feel free to change to whatever you like, but remember to change them also in your partitions and GRUB menu.lst accordingly.
For those who are not familiar with Linux operations or those who want to live an easy life, I have hosted a package of the 4 necessary files available for download eeepc-bootusb.tgz. [EDIT 2009/8/16: Changed download link to www.mediafire.com.]
You can just copy them to the relevant locations in your Xandros on USB filesystem:
- initramfs-usb-eeepc.img > copy to /mnt/sdx1/boot/
- menu.lst > copy to /mnt/sdx1/boot/grub/
- formatuser.sh > copy to /mnt/sdx1/sbin/
- scanuser.sh > copy to /mnt/sdx1/sbin/
where /mnt/sdx1 is the path where your USB device is mounted by Puppy Linux (check in Pmount, the Puppy Mount Monitor). But do not uncompress the archive in Windows so as to preserve the file attributes. Otherwise, you will need to give exec permissions to the scripts formatuser.sh and scanuser.sh or it will not run.
EXPLANATION OF LINUX TERMINOLOGY
In Linux, each disk and each partition on the disk is treated as a device. For example, the SSD in eeepc is known as /dev/sda (by the stock distro), and the second hard disk (SD0, the built-in card reader) is /dev/sdb. The first partition of the first hard disk is /dev/sda1, and the second partition is /dev/sda2, and so on.
USB flash disk will usually be registered by the kernel of the stock distro as /dev/sdc. If you have more than one USB storage device plugged in, then it may varies. Also for some multi-card reader, I have experience coming up to /dev/sdg with the eeepc.
SATA, SCSI and USB disks are all known as /dev/sdx. For IDE hard disks, they are known as /dev/hda, hdb, hdc and so on. The complication here is that Puppy Linux sees the devices differently. It sees the SSD of eeepc as /dev/hdc, and SD0 (the built-in card reader) as /dev/sda. So do not mix up, verify by looking at their volume label, sizes and file types in Pmount: The SSD is "SILICONMOTION SM223AC" and the built-in card reader is "USB2.0 CardReader SD0".
2) Running Linux commands
Although Puppy Linux has lots of GUI tools, but some advanced operations still need to be done on the command line. See this wiki: guide to terminal for more information.
3) The mknod command
The mknod command creates device special files. Some arguments need to be specified running this command. The arguments we need here are:
-m set permission modes. We are using 644 (rw-r--r--) for SYSTEM partition because it is mounted read only and 660 (rw-rw----) for USER partitions read/write
b - specify as a block device (hard disk).
major - major device number = 8 for SCSI disk driver
minor - minor device number (0 = /dev/sda, 16 = /dev/sdb, 32 = /dev/sdc ...)
You can refer to the manual page of this command for more details here.
PUPPY LINUX SPECIFIC INSTRUCTIONS
1) Mount/umount a drive
On the desktop of Puppy Linux, there is a "drives" icon. Click on that will launch Pmount, the Puppy Mount Monitor
On startup of Pmount or when you click [Refresh], Pmount will scan your computer and list all drives. Click on the rightmost icon that looks like a disk will mount that partition. The icon will then turn green and show the mounting point and partition size on the left together with a "folder" icon.
[NB. If your desktop is too small, and not all the drives are seen. You can press [Alt] + Mouse left click on the Pmount window to drag it up.]
2) File Manager
Open the default file manager of Puppy Linux (Rox-filer) by clicking on the "folder" icon in pmount for that drive.
Open a terminal from file manager by [Right click] > Window > Terminal Here
4) Edit Text file
Edit a text file by [Right click] on the file > File 'xxxxx' > Open As Text
5) Drag and Copy files
Copy files between 2 windows of Rox-filer by drag and drop
6) Create New Directory
Create a new directory by [Right Click] on empty space > New > Directory
[NB. In the steps here, I have used /dev/sdx for the target device where you want to install your Xandros on USB. Check the correct device name in Pmount and substitute them in the commands accordingly.]
1) Copy the Asus P701L.gz image file of the stock distro from the rescue DVD and put it somewhere on the hard disk of your desktop PC.
2) Put the Puppy Linux live CD into your CDROM and boot your desktop with it. You may need to enter BIOS to change the boot sequence. During the boot process, you will have to answer a few questions:
(i) Options - just [Enter]
(ii) Keyboard - choose your national keyboard
(iii) Display Driver (Xorg or Xvesa) - Any will do
(iv) Display resolution - 1024x768 should do for most modern desktop PC
3) Click on the "drives" icon on the desktop of Puppy Linux to launch Pmount. Mount the device where you have copied the P701L.gz image file.
4) In Pmount, open file manager by clicking on the "folder" icon for the device where you have copied the P701L.gz file. Navigate into the folder with the image file.
5) Open a terminal and run this command to extract the P701L.gz image to the target device. Replace sdx with the correct device name as you can see in Pmount. [Caution: Umount the target device first]
gunzip -c P701L.gz | dd of=/dev/sdxThis will copy the MBR and the SYSTEM partition to the target drive (/dev/sdx).
6) Change the volume label of the SYSTEM partition, SYSTEM_USB for me or any for your choice. Open a terminal and run this command:
e2label /dev/sdx1 SYSTEM_USB7) Start cfdisk and create the USER partition on remaining space of USB device
Menu > System > Pdisk Partition Manager > sdx > cfdisk
New > Primary > Enter > Write > "yes" > Quit
[NB. Pressing [Enter] after selecting [Primary] will use all the remaining space for your USER partition. If you have a 8G SD, you may want to specify the size and reserve some space for another fat32 data partition.]
8) Open a terminal and format the new partition to ext3 filesystem with this command:
mke2fs -c -L USER_USB /dev/sdx2 tune2fs -j /dev/sdx2Change USER_USB in this command if you choose a different volume label.
You may also do it with GParted Partition Manager :
Menu > System > GParted Partition Manager
It has a graphical interface and is quite straightforward. But lots of steps compared with the command line!
9) [Refresh] in Pmount and mount /dev/sdx1 (click the rightmost "drive icon"). Then open file manager for that drive (click the leftmost "folder icon"). Navigate into the folder /mnt/sdx1/boot.
10) Mount the device where you have downloaded the 4 files. Open file manager for that drive and navigate to the folder where you have put them. Drag and drop the file "initramfs-usb-eeepc.img" to the other window of /mnt/sdx1/boot.
11) Navigate into the folder /mnt/sdx1/sbin. Then drag and drop the files "scanuser.sh" and "formatuser.sh" you have downloaded here.
12) Navigate into the folder /mnt/sdx1/boot/grub, drag and drop the file "menu.lst" you have downloaded here.
13) Run a filesystem check on your partitions before you reboot. For me, the easy way is to do it on the command line. Open a terminal and run these commands:
umount /dev/sdx1 e2fsck -c /dev/sdx1 umount /dev/sdx2 e2fsck -c /dev/sdx2Or you can do it with GParted partition manager:
- Menu > System > GParted partition manager
- Select /dev/sdx on the top right (Maximize the window if you can't see it)
- Highlight the line /dev/sdx1
- Partition > Check
- Highlight the line /dev/sdx2
- Partition > Check
- Edit > Apply all operations
[NB. Umount the partitions with Pmount before running filesystem check.]
14) Now your Xandros on USB is ready for use. Plug it into your eeepc, press [Esc] at startup and select USB: USB2.0 Card Reader SD0 or USB Storage Device as first boot device.
FOR THE ADVENTUROUS
For the adventurous, you may want to build the init RAM filesystem image from scratch. Here are the modified steps:
9) Create a new directory "temp" in /mnt/sdx1/boot. This is where you will extract the original initramfs iimage.
10) Navigate into the new folder /mnt/sdx1/boot/temp, open a terminal and extract the initramfs image with this command:
gunzip < ../initramfs-eeepc.img | cpio -i11) Edit the file "init". Replace its content with that on this thread.
13) Navigate into the folder /mnt/sdx1/boot/temp/modules. Open another file manager window of the same drive and navigate into the folder /mnt/sdx1/lib/modules/126.96.36.199-eeepc/kernel/drivers/usb. Look for the files usbcore.ko, ehci-hcd.ko, uhci-hcd.ko, libusual.ko and usb-storage.ko in the different sub-folders. These are the kernel modules you will need to boot from USB device. Drag and copy them here.
14) Navigate into the folder /mnt/sdx1/boot/temp/dev. Open a terminal and create the necessary devices for mounting the root filesystem during startup with the mknod command:
mknod -m 644 sdb1 b 8 17 mknod -m 660 sdb2 b 8 18 mknod -m 660 sdb3 b 8 19 mknod -m 644 sdc1 b 8 33 mknod -m 660 sdc2 b 8 34 mknod -m 660 sdc3 b 8 35 mknod -m 644 sdd1 b 8 49 mknod -m 660 sdd2 b 8 50 mknod -m 660 sdd3 b 8 51 mknod -m 644 sde1 b 8 65 mknod -m 660 sde2 b 8 66 mknod -m 660 sde3 b 8 67 mknod -m 644 sdf1 b 8 81 mknod -m 660 sdf2 b 8 82 mknod -m 660 sdf3 b 8 83 mknod -m 644 sdg1 b 8 97 mknod -m 660 sdg2 b 8 98 mknod -m 660 sdg3 b 8 99 mknod -m 644 sdh1 b 8 113 mknod -m 660 sdh2 b 8 114 mknod -m 660 sdh3 b 8 11515) Now you can pack the initramfs image. Navigate into the folder /mnt/sdx1/boot/temp, open a terminal and run this command:
find | cpio -H newc -o | gzip -9 > ../initramfs-usb-eeepc.img16) Navigate into the folder /mnt/sdx1/boot/grub. Edit the file menu.lst, and replace its content as per this thread. If you choose to use your own volume labels for the SYSTEM and USER partitions, change them in these lines:
kernel /boot/vmlinuz-188.8.131.52-eeepc ... root=label:SYSTEM_USB USERLABEL:USER_USB ...
17) Navigate into the folder /mnt/sdx1/sbin. Edit the files "scanuser.sh" and "formatuser.sh". Replace their content as per this thread.
18) Continue as per step 13 above to run a filesystem check before you reboot.
Edited by albkwan, 16 August 2009 - 03:03 PM.