Differences between revisions 12 and 13
Revision 12 as of 2008-04-07 10:05:10
Size: 9576
Editor: ?RobertEpprecht
Comment: Shutdown before removing medium. Internal card reader problems. Formatting.
Revision 13 as of 2008-04-07 16:25:34
Size: 10612
Editor: ?RobertEpprecht
Comment: re-factoring, formating and some new stuff.
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
The limited storage capability of the eeepc is not adequate to keep multiple operating systems on the internal flash drive. A SD or SDHC card (which can stay forever in the built in card reader) or and usb stick can be a very convenient way to install another system and extended storage. This wiki page gives you a recipe how to do that. Use at your own risk! The limited storage capability of the eeepc is not adequate to keep multiple operating systems on the internal flash drive. A SD or SDHC card (which can stay forever in the built in card reader) or and USB stick can be a very convenient way to install another system and extended storage. This wiki page gives you instructions how to do that.
Line 11: Line 11:
 * A system on a usb stick or SDHC card will be slower than on internal flash. Speed depends on internal eeepc hardware and the type of medium you use.  * A system on a USB stick or SDHC card will be slower than on internal flash. Speed depends on internal eeepc hardware and the type of medium you use.
Line 15: Line 15:
 * 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.) Try at your own risk.  * 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.)
Line 17: Line 17:
 * There is a real gotcha if you want to use suspend on such a system. Suspending can do damage to a filesystem mounted on on a usb device. This affects both usb sticks and the built in card reader. So *don't* use suspend on such a system. This might change in the future, but don't count on it. See Bug:468213.  * There is a real gotcha if you want to use suspend on such a system. Suspending can do damage to a filesystem mounted on on a USB device. This affects both USB sticks and the built in SD/SDHC card reader. So *don't* use suspend on such a system. This might change in the future, but don't count on it. See Bug:468213.
Line 19: Line 19:
 * Installation is not difficult, but version device names keep changing in a very confusing way. If you are doing it the first time the following step by step instructions tries to avoid this confusion.  * So while there is some risk of destroying a filesystem on an USB medium, you should be able to avoid damage.

 *
Installation is not difficult, but version device names keep changing in a very confusing way. If you are doing it the first time the following step by step recipe tries to avoid this confusion.
Line 24: Line 26:
== Installing on external flash drives == == Installing on SD cards or external flash drives ==
=== Starting installation ===
Line 29: Line 32:
 1. 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 one that is closer to the display.  1. 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 one that is closer to the display.
Line 31: Line 34:
 1. Start installation until partitioning. Select manual partitioning.  1. Start installation until partitioning. Select '''manual''' partitioning.
=== Partitioning a SD card or USB stick and mounting it ===
 1. 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).
Line 33: Line 38:
 1. 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 is on /dev/sdb1 and the target stick on /dev/sdc1 (if you did put it in the USB ports I told you to).  1. Write the '''name of the device''' down (It's very likely to be /dev/sdc1 with the current installer). You will need that device name later to know where to install the bootloader.
Line 35: Line 40:
 1. Write the name of the device down (It's very likely to be /dev/sdc1 with the current installer).  1. On a pristine stick or card you will see one '''fat partition''', select and '''delete it'''.
Line 37: Line 42:
 1. On a pristine stick or card you will see one fat partition, select and delete it.  1. 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 savely proceed without. (If your machine allows it, you should consider to put more RAM instead.)
Line 39: Line 44:
 1. Now you will see free space. Select that, and create a new primary partition. Accept the default size to use the whole medium.  1. Filesystem default '''ext3''' is fine. Select mount option '''noatime''' (relatime does not work yet).
Line 41: Line 46:
 1. Filesystem default ext3 is fine. Select mount option noatime.  1. I would set a '''volume label''' like eeeSDcard or eeeStick.
Line 43: Line 48:
 1. I would set a volume label like eeeSDcard or eeeStick.

 1. Set the bootable flag.
 1. Set the '''bootable flag'''.
Line 49: Line 52:
 1. The installer thinks you should have a swap partition, but you can savely continue without. (There will be more warnings about missing swap).  1. The installer starts to protest you should have a swap partition, but you can savely continue without. (There will be more warnings about missing swap later on, just keep your own opinion...).
Line 51: Line 54:
 1. 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. === Installing the GRUB bootloader on an SD card or an USB stick ===
Line 53: Line 56:
 1. To install the bootloader on your external media you have to give the name of the device like the installer sees it during installation. So install it to the device (without partition number) you wrote down in the partitioner. Probably it will be /dev/sdc (*NOT* /dev/sdc1).
 You can double check this by switching to console 2 (press <ctr> + <alt> + <F2> and then <ret>) and use the mount command. It's the device where /target is mounted (without partition number).
  * 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. ;-)
 1. 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.
Line 57: Line 58:
 1. 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 eeepc. Next steps show how to do it from the installer.  1. To install the bootloader on your external media you have to give '''the name of the device like the installer sees it during installation'''. So install it to the device ('''without''' partition number) you wrote down in the partitioner. Probably it will be '''/dev/sdc''' (*NOT* /dev/sdc'''1''').
  * You can double check this by switching to console 2 (press <ctr> + <alt> + <F2> and then <ret>) and use the 'mount' command. It's the device where /target is mounted ('''without''' partition number).
  * 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. ;-)

 1.
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 eeepc. Next steps show how to do it in the installer.
Line 61: Line 66:
 1. The files show up as mounted under /target. Make a security copy, something like  1. The files show up as mounted under /target. Make a '''security copy''', something like
Line 66: Line 71:

1. Check and edit the drive letter in /etc/fstab. / should be mounted on /dev/sd'''b'''1 (not /dev/sd'''c'''1)
 1. Check and edit the '''drive letter in /etc/fstab'''. / should be mounted on '''/dev/sdb1''' (not /dev/sd'''c'''1)
Line 80: Line 84:
 1. Edit /boot/grub/menu.lst. The external media should be on (hd'''0''',0). Scroll down until you see the entries for the installed system, something like  1. Edit '''/boot/grub/menu.lst'''. The external media '''root''' should be on (hd'''0''',0). Scroll down until you see the entries for the installed system, something like
Line 90: Line 94:
 Now change to 'root (hd'''0''',0)' and '/dev/sd'''b'''1'. With my kernel version it looks like:  Now '''change''' to 'root (hd'''0''',0)' and '/dev/sd'''b'''1'. With my kernel version it looks like:
Line 101: Line 105:
 The internal flash drive should be on (hd'''1''',0) and /dev/sd'''a'''(x). So for default xandros on the internal drive you would edit the entries (farther down) to look something like:  The '''internal''' flash drive should be on (hd'''1''',0) and /dev/sd'''a'''(x). So for default xandros on the internal drive you would edit the entries (farther down) to look something like:
Line 111: Line 115:
 Now we must correct the entries for update-grub. Edit the device in the kernel options to /dev/sd'''b'''1  Now we must correct the entries for '''update-grub'''. Thy look like comments in the first part of the same file. Edit the device in the kernel options to /dev/sd'''b'''1
Line 115: Line 119:
 and root to (hd'''0''',0)  and GRUBs root to (hd'''0''',0)
Line 120: Line 124:
 1. Now change back to console 1 (<ctr> + <alt> + <F1>) and let the installer reboot.  1. Now change back to console 1 (<ctr> + <alt> + <F1>) and let the installer '''reboot'''.
Line 122: Line 126:
 1. You can boot by pressing <esc> after power on, or if you boot from SD card you can change hd priority in the bios, and boot directly from the card.  1. For later booting see: [#booting Booting external media]
=== Inhibiting suspend ===
 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.
Line 124: Line 130:
 1. Change the scripts under /etc/acpi so that they never do suspend. If you're like me and have the habbit of saving your work very often or let your applications do that for you, you can use my personal hack for this: I just do shutdown instead of suspend. I don't even ask, who would answer the question when you just closed the lid? I have edited /etc/acpi/actions/suspend.sh  If you're like me and have the habbit 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'''
Line 135: Line 143:
[[Anchor(booting)]]
Line 136: Line 145:
 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 appropriete:  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 appropriete:
Line 143: Line 152:
 By pressing the <esc> key after power on you can select the device to boot from.  By pressing the '''<esc>''' key after power on you can '''select the device to boot from'''.
Line 146: Line 155:
 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.) Now the eeepc will boot from your card without the need of pressing <esc>.
 * Attention: If you ever boot without the card the bios will silently revert this setting.
 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 eeepc will boot from your card without the need of pressing <esc>.
 * Attention: If you ever boot without the card the BIOS will silently revert this setting.

?TableOfContents

Introduction

The limited storage capability of the eeepc is not adequate to keep multiple operating systems on the internal flash drive. A SD or SDHC card (which can stay forever in the built in card reader) or and USB stick can be a very convenient way 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 and details will probably change in the future. Please edit, when things change.

Drawbacks

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 eeepc 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.)
  • There is a real gotcha if you want to use suspend on such a system. Suspending can do damage to a filesystem mounted on on a USB device. This affects both USB sticks and the built in SD/SDHC card reader. So *don't* use suspend on such a system. This might change in the future, but don't count on it. See 468213.

  • So while there is some risk of destroying a filesystem on an USB medium, you should be able to avoid damage.
  • Installation is not difficult, but version device names keep changing in a very confusing way. If you are doing it the first time the following step by step recipe tries to avoid this confusion.

Installation on exteral flash drive: overview

  • The installation process is pretty much straightforward. See ["DebianEeePC/HowTo/Install"]. The main difference to a normal installation is caused by the fact that bootloader configuration (and sometimes /etc/fstab) are faulty and must be corrected. 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

Starting installation

  1. Put the stick with the installer in the USB port on the left side.
  2. Press <esc> while booting and select the stick to boot from.

  3. 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 one that is closer to the display.
  4. Start installation until partitioning. Select manual partitioning.

Partitioning a SD card or USB stick and mounting it

  1. 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).

  2. Write the name of the device down (It's very likely to be /dev/sdc1 with the current installer). You will need that device name later to know where to install the bootloader.

  3. On a pristine stick or card you will see one fat partition, select and delete it.

  4. 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 savely proceed without. (If your machine allows it, you should consider to put more RAM instead.)

  5. Filesystem default ext3 is fine. Select mount option noatime (relatime does not work yet).

  6. I would set a volume label like eeeSDcard or eeeStick.

  7. Set the bootable flag.

  8. Select 'Done setting up partition' and 'Finish partitioning and write changes to disk'.
  9. The installer starts to protest you should have a swap partition, but you can savely continue without. (There will be more warnings about missing swap later on, just keep your own opinion...).

Installing the GRUB bootloader on an SD card or an USB stick

  1. 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.

  2. To install the bootloader on your external media you have to give the name of the device like the installer sees it during installation. So install it to the device (without partition number) you wrote down in the partitioner. Probably it will be /dev/sdc (*NOT* /dev/sdc1).

    • You can double check this by switching to console 2 (press <ctr> + <alt> + <F2> and then <ret>) and use the 'mount' command. It's the device where /target is mounted (without partition number).

    • 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. ;-)

  3. 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 eeepc. Next steps show how to do it in the installer.

  4. Switch to console 2 (<ctr> + <alt> + <F2>)

  5. The files show up as mounted under /target. 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
  6. Check and edit the drive letter in /etc/fstab. / should be mounted on /dev/sdb1 (not /dev/sdc1)

      nano /etc/fstab
    it 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
  7. Edit /boot/grub/menu.lst. The external media root should be on (hd0,0). Scroll down until you see the entries for the installed system, something like

    ## ## End Default Options ##
    title           Debian GNU/Linux, kernel 2.6.24-1-686
    root            (hd2,0)
    kernel          /boot/vmlinuz-2.6.24-1-686 root=/dev/sdc1 ro quiet
    initrd          /boot/initrd.img-2.6.24-1-686
    ...
    ### END DEBIAN AUTOMAGIC KERNELS LIST

    Now change to 'root (hd0,0)' and '/dev/sdb1'. With my kernel version it looks like:

    title           Debian GNU/Linux, kernel 2.6.24-1-686
    root            (hd0,0)
    kernel          /boot/vmlinuz-2.6.24-1-686 root=/dev/sdb1 ro quiet
    initrd          /boot/initrd.img-2.6.24-1-686
    title           Debian GNU/Linux, kernel 2.6.24-1-686 (single-user mode)
    root            (hd0,0)
    kernel          /boot/vmlinuz-2.6.24-1-686 root=/dev/sdb1 ro single
    initrd          /boot/initrd.img-2.6.24-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 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-2.6.21.4-eeepc quiet rw vga=785 irqpoll root=/dev/sda1
    initrd          /boot/initramfs-eeepc.img
    ...

    Now we must correct the entries for update-grub. Thy 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)

    # groot=(hd0,0)
  8. Now change back to console 1 (<ctr> + <alt> + <F1>) and let the installer reboot.

  9. For later booting see: [#booting Booting external media]

Inhibiting suspend

  • 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 habbit 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

    # do nothing if package is removed
    [ -d /usr/share/doc/eeepc-acpi-scripts ] || exit 0
    if (runlevel | grep -q [06]) || (pidof '/sbin/shutdown' > /dev/null); then
        exit 0
    fi
    shutdown -h now

    Probably we will have a better method of doing this, see 474531.

?Anchor(booting)

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 appropriete:

    1st Boot Device        [Removable Dev.]
    2nd Boot Device        [HDD:SM-SILICONMOTI]
    1st Boot Device        [ATAPI CD-ROM]

Common case

  • 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 eeepc will boot from your card without the need of pressing <esc>.

  • Attention: If you ever boot without the card the BIOS will silently revert this setting.