Difference between revisions of "UDOO boot from sata"

From eLinux.org
Jump to: navigation, search
(Minor edit to clarify something)
Line 93: Line 93:
 
Add instructions on a full SATA only boot.
 
Add instructions on a full SATA only boot.
 
(Currently Impossible due to current uboot, hopefully this will be made possible in a future update)
 
(Currently Impossible due to current uboot, hopefully this will be made possible in a future update)
 +
 +
[[Category:UDOO]]

Revision as of 08:58, 14 November 2013

This guide will show you how to boot your UDOO from an attached SATA drive with the help of a small SD card. NOTE: It is currently not possible to boot without an SD card, it is hoped that this feature will be added in the future.

Prerequisites

  • A SATA drive
  • A SD card
  • A spare PC
  • A Micro USB cable such as one for charging a smart phone

This guide also assumes you have a working linux install for UDOO.

Preparing the drive

You may partition and format the drive however you want, the current builds of uboot support up to ext3 I believe, newer builds may support ext4. I will be using a drive of a single ext3 partition as an example. There are several methods of preparing the SATA drive, some are listed below. NOTE: you only need to do ONE of the following methods.


Using an existing Linux system

Connect your SD and SATA drive to a linux system. I'm using a USB SATA adapter and mounted it and the sd at /sd and /usb just for clarity, but this is upto you. Adjust commands appropriately.

 # cp -rvp /sd/* /usb/

This will copy your SD filesystem to the SATA disk.

Unmount both. Once that is complete, connect the SATA disk to the UDOO and reinsert the SD card.


Extracting a FS tarball

You may use the filesystem tarball from the binaries tab on udoo.org or use your own. Place this tarball on the SATA disk. You can transfer this over the network or wget the file straight onto it.

run the following commands (Assuming /dev/sda1 is mounted at /mnt)

 # cd /mnt
 # tar xvzf tarball_you_just_grabbed.tar

Using dd to flash an image

You can also flash the filesystem using DD. You will need a filessytem img such as the ones provided by UDOO. Make sure your SATA disk is NOT mounted. Flash by doing the following

 # dd if=path/to/fs.img of=/dev/sdb

Using win32diskimager from windows

You can flash any image from windows with win32diskimager. You can get it from its SourceForge page http://sourceforge.net/projects/win32diskimager/

Prepare U-Boot

You will need to connect the UDOO to a PC with a micro USB cable. Make sure to use the micro USB port closest to the corner.

Then open a serial terminal to the new COM port on your PC with a baud of 115200 Reset the udoo and press any key over serial when prompted to cancel the autoboot. If you miss the prompt, you can press reset on the udoo or run the reboot command to reboot.

Now run the following commands to set the boot device

 setenv root root=/dev/sda1
 saveenv

If you do not want it to keep the change upon reboot omit the saveenv line. If you need to revert it to the SD card again, simply use /dev/mmcblk0p1

 setenv root root=/dev/mmcblk0p1

Now run the following to continue booting

 boot

Done!

You should now be booting into the system on the SATA drive. If all goes well you can safely remove almost everything on the SD card. If you do, make sure to leave /boot as U-Boot still loads it.

NOTE!

If you used the udooupdate script to update the uboot version and kernel, you'll probably need to do this on both the SD card that triggers the boot as well as the SATA drive. Use the instructions here to change which filesystem is the root, download and run the update from each.

DO the SATA drive FIRST!!!!

If you only do the SATA drive, you probably will not be able to reboot into the SATA drive until you also update the SD card to match.

TODO

Add instructions on a full SATA only boot. (Currently Impossible due to current uboot, hopefully this will be made possible in a future update)