- Installation on external flash drive: overview
- Installing on SD cards or external flash drives
- Booting external media
The limited storage capability of the Asus Eee PC is not adequate to keep multiple operating systems on the internal flash drive. An SD or SDHC card (which can always stay in the built in card reader) or a USB stick can be a very convenient medium to install another system and extended storage. This wiki page gives you instructions how to do that.
This version of the page depends very much on the current versions of kernel, installer and the like; details could change in the future. Please edit as needed.
RobertEpprecht - This versions is based on Eee 701 models. Newer models have another disk layout. Please give details if you try with other models. The page was written for 2.6.24 kernels and tested succsessfully with the new 2.6.26 kernel version.
Tim_Auton - The default IO scheduler is cfq. There seems to be pathological behaviour on USB flash and SD cards with this scheduler - it's slow and far from fair. Till this is fixed, use another scheduler. Deadline appears to be the most effective. Add the kernel parameter "elevator=deadline" to the kernel line in grub/menu.conf to use deadline as the default. Setting the fifo_batch parameter also helps interactive response - batching reads or writes is good for minimising seeks, but is irrelevant for flash with its constant access time. "echo 1 > /sys/block/sdX/queue/scheduler/iosched/fifo_batch".
ManfredWassmann - CHECK THIS: from what I googled you should use the noop scheduler with SSD's (flash, SD cards etc.)
A system on an external flash medium can be convenient and very usable. There are some drawbacks, of course:
- A system on a USB stick or SDHC card will be slower than on internal flash. Speed depends on internal Eee hardware and the type of medium you use.
- Never take out the card or stick before shutdown is complete; with a stick this could happen unintentionally. Do not ask for a reboot (instead of shutdown) and remove the media between shutdown and automatic reboot.
- Some people had problems with the internal card reader. It is possible that newer models do not have this problem any more or that it was caused by (non Debian) software or BIOS. Please report your experience. (I am using a system on a SDHC card very intensively and did not see any problems so far.)
Installation is not difficult, but device names keep changing in a very confusing way. (See 389881). If you are doing it for the first time, the following step by step recipe tries to avoid this confusion.
For lvm or crypto, you may need to add rootdelay=10 to the kernel command line; see 366175 for details.
Installation on external flash drive: overview
The installation process is pretty much straightforward. Read ../Install before proceeding. The main difference to a normal installation is that you need to manually fix the bootloader configuration and /etc/fstab. Device names do move around in a very confusing way. So here is a very detailed recipe to avoid confusion and to show how to fix the faulty bits after running the installer. Sorry if it sounds overly complicated.
- Precautions should be taken that you will not suspend such a system.
Installing on SD cards or external flash drives
- Put the stick with the installer in the USB port on the left side.
Press <F2> to enter in the bios and disable bootboster, <F10> to save and exit - DavideCalcagnile.
Press <esc> while booting and select the stick to boot from.
- Now put the SD or SDHC card into the built in reader. If you want to install to a USB stick put that one in the second USB port on the right side, the first is closest to the plug ac.
Start installation until partitioning. Select manual partitioning.
RobertSchuettler] On our Eee-PC 701 there was a problem recognizing the SD card during installation (16GB Transcend if that matters). The only available disks showing up for partitioning were the internal one and the USB device that the installer itself bootet from. My (easy enough) solution was to take the SD card out of the internal reader and stick it into the USB-reader that came with the card, then re-detect disks and voila. Maybe this helps someone. Remember to check (and probably edit) /etc/fstab if you do this though.
Alexandru] It seems that if one puts first the root device (SDHC or USB) and after that the installation media, the root device problem does not appear at all (no need to modify /etc/fstab). All one needs is to change grub's menu.lst to point (hd0,0) for the SDHC / USB device with root filesystem and (hd1,0) for internal SSD.
When I tried, I first enter in BIOS boot settings and changed devices settings (2-nd item) to show SDHC card at the first line and the internal SSD at the second line. After that, I changed the boot devices priority (1-st item) to boot from the installation USB-flash.
RalfEngels] There are several people reporting problems with the internal SD card reader. The symptoms are: stopping of the installation two thirds through. IO errors reported for the drive. The partition is mounted read-only and remounting does not help. File system corruption.
- These problems are caused partly by the SD-card reader, temperature, core voltage and an old bios.
This post goes into details: http://forum.eeeuser.com/viewtopic.php?id=19216
- Also the Bios 0802 is reported to solve the problem.
XTaran - Other SD card reader problems (throwing I/O errors, access is hanging) or hanging fdisk or hanging grub os-detect can be caused by the BIOS setting "OS Installation". It seems as if must be set to "finished" to make the SD card reader behave properly. See also https://bugs.launchpad.net/ubuntu-eeepc-kernel/+bug/301932/comments/12
Partitioning a SD card or USB stick and mounting it
Spot the device you want to install to: the internal card reader is easy to find, the stick might show a brand label, size or something else from which you can tell which stick is which. If you have no clue, then assume the installer stick is on /dev/sdb1 and the target stick on /dev/sdc1 (if you did put it into the USB ports I told you to).
Write the name of the device down (It's very likely /dev/sdc1 with the current installer on a Eee 701). You will need that device name later to know where to install the bootloader.
On a pristine stick or card you will see one fat partition, select and delete it.
DavideCalcagnile - This step is not present in the installation with the image ...eeepc.img (16MB network-based installer image)
select the ext2 file system because the ext3 file system with journalling is not working properly in some cases
bootable flag does not exist as an option
- noted that to proceed with the partitioning
Rudy X. Desjardins - Note, if you follow the preceding suggestion of using ext2 (vs. ext3), you must
ommit the commit=120 option when editing fstab later, as the commit option is specific to ext3 filesystems and if left in, will
- cause the system to fail remounting your final root fs as read-write. If you see a lot of failed startup scripts for your default
- runlevel (probably 2), and/or an error from the 'final' mount command, this is likely the culprit.
Now you will see free space. Select that, and create a new primary partition. Accept the default size to use the whole medium. You could leave space for a swap partition, but on a flash device it might be quite reasonable not to have a swap partition. The installer will protest, but you can safely proceed without. (If your machine allows it, you should consider adding more RAM instead.)
Filesystem default ext3 is fine. Select mount option noatime (relatime does not work yet).
I would set a volume label like eeeSDcard or eeeStick.
Set the bootable flag.
- Select 'Done setting up partition' and 'Finish partitioning and write changes to disk'.
- The installer starts to protest that you should have a swap partition, but you can safely continue without. There will be more warnings about missing swap later on, so just keep your own opinion.
Installing the GRUB bootloader on an SD card or an USB stick
Now let the installer do its thing until it wants to write the GRUB bootloader. Stop now. Do not install the GRUB bootloader in the MBR.
To install the bootloader on your external media you have to give the name of the device as the installer sees it during installation. So install it to the device (without partition number) you wrote down in the partitioner. On a 701 Eee model it will probably be /dev/sdc (*NOT* /dev/sdc1).
You can double check this by switching to console 2 (press <ctr> + <alt> + <F2> and then <return>) and use the 'mount' command. It's the device where /target is mounted (without partition number). Switch back to the installer by pressing <ctr> + <alt> + <F1>.
You install GRUB on a device like /dev/sdc but this will show up as /dev/sdb when the system gets booted. Don't get confused, it is confusing.
Fixing GRUB configuration and /etc/fstab
Continue until the installer wants to reboot, but don't do that yet. We must correct the faulty disk and device names in /boot/grub/menu.lst and /etc/fstab first. You can do that inside the installer now, or you can decide to let the installer finish and mount the media somewhere else to fix things there before rebooting the Eee. Next steps show how to do it in the installer.
Switch to console 2 (<ctr> + <alt> + <F2>).
The root of the installed system is mounted under /target during the instal. So if you edit the files during installation make sure to edit the copy in the /target/ hierarchy! The other files in the root filesystem are in the ramdisk and will be gone when you´ll reboot. Make a security copy, something like
cp -a /target/boot/grub/menu.lst /target/boot/grub/menu.lst.INSTALLER.back cp -a /target/etc/fstab /target/etc/fstab.INSTALLER.back
Check and edit the drive letter in /target/etc/fstab. / should be mounted on /dev/sdb1 (not /dev/sdc1)
nano /target/etc/fstabit should look like this:
/dev/sdb1 / ext3 noatime,errors=remount-ro 0 1
Or even better, see http://www.cyrius.com/debian/nslu2/linux-on-flash.html
/dev/sdb1 / ext3 noatime,commit=120,errors=remount-ro 0 1
Edit /target/boot/grub/menu.lst. The external media root should be on (hd0,0). Scroll down until you see the entries for the installed system, it looks similar to this:
## ## End Default Options ## title Debian GNU/Linux, kernel 2.6.26-1-686 root (hd2,0) kernel /boot/vmlinuz-2.6.26-1-686 root=/dev/sdc1 ro quiet initrd /boot/initrd.img-2.6.26-1-686 ... ### END DEBIAN AUTOMAGIC KERNELS LIST
Now change to 'root (hd0,0)' and '/dev/sdb1'. On a EeePC 701 it looks like:
title Debian GNU/Linux, kernel 2.6.26-1-686 root (hd0,0) kernel /boot/vmlinuz-2.6.26-1-686 root=/dev/sdb1 ro quiet initrd /boot/initrd.img-2.6.26-1-686 title Debian GNU/Linux, kernel 2.6.26-1-686 (single-user mode) root (hd0,0) kernel /boot/vmlinuz-2.6.26-1-686 root=/dev/sdb1 ro single initrd /boot/initrd.img-2.6.26-1-686
The internal flash drive should be on (hd1,0) and /dev/sda(x). So for default xandros on the internal drive you would edit the entries (farther down) to look something like this:
# This entry automatically added by the Debian installer for an existing # linux installation on /dev/sda1. title Normal Boot (on /dev/sda1) root (hd1,0) kernel /boot/vmlinuz-22.214.171.124-eeepc quiet rw vga=785 irqpoll root=/dev/sda1 initrd /boot/initramfs-eeepc.img ...
Now we must correct the entries for update-grub. They look like comments in the first part of the same file. Edit the device in the kernel options to /dev/sdb1.
# kopt=root=/dev/sdb1 ro
and GRUBs root to (hd0,0)
Now change back to console 1 (<ctr> + <alt> + <F1>) and let the installer reboot.
See Booting external media for methods how to boot later.
Note by Kai Martens: On Eee PC 900 /dev/sdb will be the internal solid state harddrive. While all the (hd2,0) instances mentioned above must still be altered to (hd0,0), the /dev/sdc1 instances should not be altered to /dev/sdb1 (neither in fstab, nor in menu.lst). If it is rebooted with /dev/sdb1 after loading the kernel there will be three messages that mount failed and then the message that there is no file /sbin/init - your cue that you got the (hdx,y) stuff right (found the kernel and ram image), but the /dev/sdxy stuff wrong...
Note by RGM: if your primary partition is Windows XP then you may need to add a map (hd1) (hd0) command in addition to modifying the root entry.
map (hd1) (hd0) rootnoverify (hd1,0) savedefault chainloader +1
Note by Marcos Talau: I had problems with the device names on 701. I recommend the use of labels for GRUB and fstab.
Fixing uswusp configuration
- If you have made a swap partition on your medium, you will probably see:
resume: libcrypt version: 1.4.0 resume: Could not stat the resume file: '/dev/sdc2' ...That's uswusp configured on a wrong device name asking for the right one. Just ignore the question and boot. Then do as root:
aptitude purge uswusp aptitude install uswuspOn next boot you won´t be asked again.
Change the scripts under /etc/acpi so that they never do suspend. Otherwise you do risk integrity of your filesystem, and you will see damage on files opened to write. If you're like me and have the habit of saving your work very often or let your applications do that for you, you can use the following hack for this which just does shutdown instead of suspend. It dosn't even ask, who would answer the question when you just closed the lid anyway? Edit /etc/acpi/actions/suspend.sh
#!/bin/sh # do nothing if package is removed [ -d /usr/share/doc/eeepc-acpi-scripts ] || exit 0 if (runlevel | grep -q ) || (pidof '/sbin/shutdown' > /dev/null); then exit 0 fi shutdown -h now
Probably we will have a better method of avoiding suspend, see 474531.
Booting external media
First you have to set the Boot Device Priority in the BIOS. Press <F2> after power on to set BIOS parameters. The following settings seem appropriate:
1st Boot Device [Removable Dev.] 2nd Boot Device [HDD:SM-SILICONMOTI] 3rd Boot Device [ATAPI CD-ROM]
By pressing the <esc> key after power on, you can select the device to boot from.
Booting from SDHC card
If you have your system on an SD card that you always leave in the slot, you might want to boot from it directly. The card must be in the slot for the BIOS to show this option. Press <F2> after powering on to see the BIOS. Go to the boot tab. If the card is in the slot, you will find the option > Hard Disk Drives. Change the card reader to be the first drive. (Leave Boot Device Priority as shown above.) From now on the Eee will boot from your card without having to press <esc>.
- Attention: If you ever boot without the card the BIOS will silently revert this setting.