User:Donaldaudric/Booting from USB Device: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
This page explains how to boot from a USB device.
This page explains how to boot from a USB device. You will need an XO-1 and a USB device of at least 1 GB.


== Caveats ==
== Caveats ==
Line 7: Line 7:


This part will remove all data from your XO.<br />
This part will remove all data from your XO.<br />
1. Go to [http://download.laptop.org/xo-1/os/official] and click on the build you want.<br />
1. Go to [http://download.laptop.org/xo-1/os/official http://download.laptop.org/xo-1/os/official] and click on the build you want.<br />
2. Save os***.img.fs.zip onto the top directory of the thumb drive as fs.zip.<br />
2. Save os***.img.fs.zip onto the top directory of the USB device as fs.zip.<br />
3. Save os***.img onto the top directory of the thumb drive.<br />
3. Save os***.img onto the top directory of the thumb drive.<br />
4. Power off your XO.<br />
4. Power off your XO.<br />
Line 17: Line 17:
== Part Two: The Thumb Drive ==
== Part Two: The Thumb Drive ==


1. Open a terminal either by opening terminal, activity or by doing ctrl-alt-group (the group key is the<br /> one with three circles). Press enter. If you opened terminal activity, type<br />
This part will come tomorrow.
<code>su</code><br />
and press enter.
2. Remove the partition table from the USB device:<br />
<code>dd if=/dev/zero of=/dev/sda bs=512 count=8</code><br />
3. Partition the USB device:<br />
<code>parted /dev/sda mkpart primary fat16 0 50MB ; parted /dev/sda mkpart primary ext2 50MB <size> ; parted /dev/sda set 1 boot on</code><br />
where <size> is the size of your USB device<br />
4. Create filesystems on the USB devices:<br />
<code>mkdosfs /dev/sda1 ; mkfs.ext4 -L OLPCRoot /dev/sda2</code><br />
5. Mount your filesystems:<br />
<code>mkdir /mnt/USB1 /mnt/USB2<br />
mount /dev/sda1 /mnt/USB1 ; mount /dev/sda2 /mnt/USB2</code><br />
6. Copy boot data onto the boot partition:<br />
<code>cp /boot /mnt/USB1</code><br />
7. Make all the empty OS directories on your other partition:<br />
<code>cd /mnt/USB2 ; mkdir boot bootpart home media mnt ofw opt proc srv sys</code><br />
8. Copy the OS to the thumb drive:<br />
<code>cp /bin . ; cp /dev . ; cp /etc . ; cp /lib . ; cp /sbin . ; cp /security . ; cp /tmp . ; cp /usr . ; cp /var . ; cp /versions .</code><br />
9. Edit the boot scripts:<br />
<code>rm /versions/boot/current/boot/olpc.fth ; nano /versions/boot/current/boot/olpc.fth</code><br />
10. Type:
<code>\ OLPC boot script<br />
" u:\boot\initrd.img" expand$ to ramdisk<br />
" ro root=LABEL=OLPCRoot" expand$ to boot-file<br />
" u:\boot\vmlinuz" expand$ to boot-device<br />
boot</code><br />
11. Press ctrl-X and press y to save changes.
12. Reboot your XO.

== Contacting Me ==

If there is anything wrong with this, you can contact me. My information is at the [[User:Donaldaudric#Contacting Me|bottom of my wiki page.]]

Revision as of 19:16, 27 July 2011

This page explains how to boot from a USB device. You will need an XO-1 and a USB device of at least 1 GB.

Caveats

This process will remove all data from your XO and the USB device.
To my knowledge, this was only tested by me on build 10.1.3, and it does NOT work on build 10.1.2.
Your USB stick will be mostly formatted in EXT4, which is not a good format for FLASH storage such as USB sticks.
My method works only on XO-1s.

Part One: On your XO

This part will remove all data from your XO.

    1. Go to http://download.laptop.org/xo-1/os/official and click on the build you want.
2. Save os***.img.fs.zip onto the top directory of the USB device as fs.zip.
3. Save os***.img onto the top directory of the thumb drive.
4. Power off your XO.
5. Hold down the game keys of your XO as you power it on. Release the game keys when prompted to.
6. The XO will show some text on the screen. If all goes well, you should see blocks on the screen. Wait
for the XO to prompt you for your name.
7. If the XO says "Boot failed", the USB device may not have had enough time to initialize. Power off,
then power on again with the game buttons pressed. This time, hold them for a few seconds after the message
appears. If your USB device has a light, wait until the light goes on before releasing the game
keys. If that does not work, then either the USB device was prepared incorrectly or your firmware is out
of date.

Part Two: The Thumb Drive

    1. Open a terminal either by opening terminal, activity or by doing ctrl-alt-group (the group key is the
one with three circles). Press enter. If you opened terminal activity, type

su
and press enter.

    2. Remove the partition table from the USB device:

dd if=/dev/zero of=/dev/sda bs=512 count=8

    3. Partition the USB device:

parted /dev/sda mkpart primary fat16 0 50MB ; parted /dev/sda mkpart primary ext2 50MB <size> ; parted /dev/sda set 1 boot on
where <size> is the size of your USB device

    4. Create filesystems on the USB devices:

mkdosfs /dev/sda1 ; mkfs.ext4 -L OLPCRoot /dev/sda2

    5. Mount your filesystems:

mkdir /mnt/USB1 /mnt/USB2
mount /dev/sda1 /mnt/USB1 ; mount /dev/sda2 /mnt/USB2

    6. Copy boot data onto the boot partition:

cp /boot /mnt/USB1

    7. Make all the empty OS directories on your other partition:

cd /mnt/USB2 ; mkdir boot bootpart home media mnt ofw opt proc srv sys

    8. Copy the OS to the thumb drive:

cp /bin . ; cp /dev . ; cp /etc . ; cp /lib . ; cp /sbin . ; cp /security . ; cp /tmp . ; cp /usr . ; cp /var . ; cp /versions .

    9. Edit the boot scripts:

rm /versions/boot/current/boot/olpc.fth ; nano /versions/boot/current/boot/olpc.fth

    10. Type:

\ OLPC boot script
" u:\boot\initrd.img" expand$ to ramdisk
" ro root=LABEL=OLPCRoot" expand$ to boot-file
" u:\boot\vmlinuz" expand$ to boot-device
boot

    11. Press ctrl-X and press y to save changes.
    12. Reboot your XO.

Contacting Me

If there is anything wrong with this, you can contact me. My information is at the bottom of my wiki page.