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

From OLPC
Jump to navigation Jump to search
 
(11 intermediate revisions by the same user not shown)
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 ==

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


== Part One: On your XO ==
== Part One: On your XO ==


This part will remove all data from your XO.<br />
This part will remove all data from your XO.<br />
You may need to do steps 1 - 3 on an computer with a full-featured web browser; however, the firefox that comes with GNOME in the newer XO releases is fine for this as well.<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 />
3. Save os***.img onto the top directory of the thumb drive.<br />
2. Save os***.img.fs.zip onto the top directory of the USB device as fs.zip.<br />
4. Power off your XO.<br />
3. Save os***.img onto the top directory of the thumb drive.<br />
4. Power off your XO.<br />
5. Hold down the game keys of your XO as you power it on. Release the game keys when prompted to.<br />
6. The XO will show some text on the screen. If all goes well, you should see blocks on the screen. Wait<br /> for the XO to prompt you for your name.<br />
5. Hold down the game keys of your XO as you power it on. Release the game keys when prompted to.<br />
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.<br />
7. If the XO says "Boot failed", the USB device may not have had enough time to initialize. Power off,<br /> then power on again with the game buttons pressed. This time, hold them for a few seconds after the message<br /> appears. If your USB device has a light, wait until the light goes on before releasing the game<br /> keys. If that does not work, then either the USB device was prepared incorrectly or your firmware is out<br /> of date.
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 ==
== Part Two: The Thumb Drive ==


This part will come tomorrow.
This part will set up the USB device and tell the XO to boot from it.<br />
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 />
su<br />
and press enter.<br />
2. Remove the partition table from the USB device:<br />
dd if=/dev/zero of=/dev/sda bs=512 count=8<br />
3. Partition the USB device:<br />
parted /dev/sda mkpart primary fat16 0 50MB ; parted /dev/sda mkpart primary ext2 50MB <size> ; parted /dev/sda set 1 boot on<br />
where <size> is the size of your USB device. (i.e. 4GB)<br />
4. Create filesystems on the USB devices:<br />
mkdosfs /dev/sda1 ; mkfs.ext4 -L OLPCRoot /dev/sda2<br />
5. Mount your filesystems:<br />
mkdir /mnt/USB1 /mnt/USB2<br />
mount /dev/sda1 /mnt/USB1 ; mount /dev/sda2 /mnt/USB2<br />
6. Copy boot data onto the boot partition:<br />
cp /boot /mnt/USB1<br />
7. Make all the empty OS directories on your other partition:<br />
cd /mnt/USB2 ; mkdir boot bootpart home media mnt ofw opt proc srv sys<br />
8. Copy the OS to the thumb drive:<br />
cp /bin . ; cp /dev . ; cp /etc . ; cp /lib . ; cp /sbin . ; cp /security . ; cp /tmp . ; cp /usr . ; cp /var . ; cp /versions .<br />
9. Edit the boot script:<br />
rm /versions/boot/current/boot/olpc.fth ; nano /versions/boot/current/boot/olpc.fth<br />
10. Type:<br />
\ 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<br />
11. Press ctrl-X and press y to save changes.<br />
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.]]

Latest revision as of 20:41, 28 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.
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.
You may need to do steps 1 - 3 on an computer with a full-featured web browser; however, the firefox that comes with GNOME in the newer XO releases is fine for this as well.
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

This part will set up the USB device and tell the XO to boot from it.
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. (i.e. 4GB)
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 script:

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.