NEED HELP! Can't Boot From A USB Disk!

Post Reply
thejanglytemblor
Posts: 3
Joined: Tue Dec 31, 2013 3:07 am
languages_spoken: english (US)
ODROIDs: odroid u3, and i wish i had the xu.
Contact:

NEED HELP! Can't Boot From A USB Disk!

Unread post by thejanglytemblor » Fri Jan 31, 2014 2:39 pm

i, for a couple weeks now, have been trying to get my odroid to boot from a usb drive. i have an old 60GB disk, and would prefer to use that than a micro sd or emmc card due to the fact that my hard drive can read/write 3x faster than my micro sd card. i tried instructions from several sites, including the official one on the odroid.us website. however it, as well as several other pages, are outdated. id like a detailed description on how to move the root partition to my hard drive. i am somewhat a noob at the terminal, so the instructions need to be specific. on the raspberry pi, moving the root partition to a hard drive was simple. my main pc is running ubuntu 13.10 unity, and the odroid u3 is going to be running the official xubuntu 13.10 image. any help will be appreciated. i really hope i dont have to keep reposting.
carl: "this tastes funny"
fred: "check the bottle!"
narrator: the bottle says "genuine badger milk!"

Vort
Posts: 153
Joined: Fri Nov 22, 2013 10:04 pm
languages_spoken: english
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by Vort » Fri Jan 31, 2014 6:08 pm

Search the forums with key "rootfs" in topics only
like this:
http://forum.odroid.com/search.php?keyw ... mit=Search

thejanglytemblor
Posts: 3
Joined: Tue Dec 31, 2013 3:07 am
languages_spoken: english (US)
ODROIDs: odroid u3, and i wish i had the xu.
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by thejanglytemblor » Sat Feb 01, 2014 3:38 am

thanks for the reply, but this doesn't really help. :( all the results i found were either for the odroid X series, or have tons of typos and seem very confusing. the bad grammer doesn't help. i now understand that i need to change some settings in initramfs and recompile it, as well as edit the boot.scr and recompile. but i'm still very confused. like i said, i'm a beginner at the terminal. what would i do in order to recompile the initramfs and boot.scr in the official ubuntu 13.10? i already have a micro usb cable, so i could use that, or if possible, i could use the terminal on the odroid. please check the commands before you post!
carl: "this tastes funny"
fred: "check the bottle!"
narrator: the bottle says "genuine badger milk!"

suriyan
Posts: 473
Joined: Wed Jun 26, 2013 2:41 pm
languages_spoken: english
ODROIDs: odroid-u2/xu-e/u3/x2/xu3/c1
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by suriyan » Thu Feb 06, 2014 3:03 am

I checked on the xubuntu-13.10-desktop-armhf_odroidu_20140107.img.xz image that you are using.
It has a FAT 1st parittion and the rootfs in the second partition.
In the FAT partition it has these files:
boot*, zImage, uInitrd
If you look at the boot.scr file ithas these contents (with some header in the first few bytes)
-----------------
boot.scr for X with HDMI auto-pr
setenv initrd_high "0xffffffff"
setenv fdt_high "0xffffffff"
setenv bootcmd "fatload mmc 0:1 0x40008000 zImage; fatload mmc 0:1 0x42000000 uInitrd; bootm 0x40008000 0x42000000"
setenv bootargs "console=tty1 console=ttySAC1,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro mem=2047M"
boot
--------------
so, firstly, the root=UUID=e139ce78-9841-40fe-8823-96a304a09859 should change to root=/dev/sda1, assuming that your USBdrive will have that device name.

All these are done on the SD card.
Now assuming you have a correct boot.scr in the SD card which points root=/dev/sda1, the next problem is that once the kernel is loaded with the uInitrd, it does not have the usb storage modules in uInitrd, nor is it compiled into the kernel. Hence, it shall fail to recognize /dev/sda1 and hence all your efforts so far are in vain.
One way is to update the uInitrd and give if the usb storage related modules, or recompile the kernel with usb storage support.

I hope this gives you some pointers. If you want more details, feel free to respond here, and I can walk you through this.

Vort
Posts: 153
Joined: Fri Nov 22, 2013 10:04 pm
languages_spoken: english
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by Vort » Sat Feb 08, 2014 6:28 pm

Since no reply till now I'd like to ask for help with the same request thanks to suriyan being so kind.
suriyan wrote:I hope this gives you some pointers. If you want more details, feel free to respond here, and I can walk you through this.
I've done it on the Raspberry Pi and it was simple: pointing in boot.scr to rootfs on /dev/sdaX and dd /dev/rootfs to /dev/sdaX, IIRC, and reboot.

So the question is how should I
suriyan wrote:update the uInitrd and give it the usb storage related modules
?
I plan to use one of the minimal (Ubuntu)Linux images posted here elsewhere.

I have only a basic knowledge on Linux.
Thanks in advance.

suriyan
Posts: 473
Joined: Wed Jun 26, 2013 2:41 pm
languages_spoken: english
ODROIDs: odroid-u2/xu-e/u3/x2/xu3/c1
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by suriyan » Sun Feb 09, 2014 8:01 am

Hello Vort,
On the Odroid too you have to do that first step that you mentioned -> dd the root file system to the USB partition and modify the root= in boot.scr. I would also recommend using root=LABEL=<whatever>. That way no matter which USB port you use or how many USB drives you have it shall boot off the correct partition.

The extra thing (as of now, but am sure it will be fixed soon) that you need to do is to modify the initrd.
The steps are as below: (Do it on the Odroid you are modifying as teh kernel modules will be already present and at the right versions)
0. #> cp /media/boot/uInitrd /media/boot/uInitrd.org
1. #> cp /media/boot/uInitrd /root/
2. #> cd /root/
3. #> dd if=uInitrd of=initrd.gz bs=1 skip=64
4. #> gunzip initrd.gz
5. #> mkdir tmp; cd tmp
6. #> cpio -id < ../initrd
7. #> mkdir -p lib/modules/<kernel version>/kernel/drivers/usb/storage
8. #> mkdir -p lib/modules/<kernel version>/kernel/drivers/scsi
9. #> cp /lib/modules/<kernel version>/kernel/drivers/usb/storage/usb-storage.ko lib/modules/<kernel version>/kernel/drivers/usb/storage/
10. #> cp /lib/modules/<kernel version>/kernel/drivers/scsi/sd_mod.ko lib/modules/<kernel version>/kernel/drivers/scsi/
11. #> cp /lib/modules/<kernel version>/kernel/drivers/scsi/scsi_mod.ko lib/modules/<kernel version>/kernel/drivers/scsi/
12. #> depmod -b ./ -a
13. #> find . | cpio --create --format='newc' > /media/boot/initrd
14. #> gzip /media/boot/initrd
15. #> mkimage -A arm -O linux -T ramdisk -C gzip -a 0x0 -e 0x0 -n initramdisk -d /media/boot/initrd.gz /media/boot/uInitrd

In the above, substitute <kernel version> for the number you see there. Possibly 3.8.13.14

Now uInitrd should have the modules for booting from USB storage. A reboot now should work.

Thanks
- Suriyan

Vort
Posts: 153
Joined: Fri Nov 22, 2013 10:04 pm
languages_spoken: english
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by Vort » Sun Feb 09, 2014 3:24 pm

Thank you so much!

Starting this soon.
I see you are online so I'd ask about dd-ing:
On Rpi (under Debian) moving the rootfs to usb-external storage was a matter of dd-ing /dev/root to /dev/sda1.
Since there's no /dev/root in this install (linaro_ubuntu_13.05_server_U2.img) how should I dd the rootfs to /dev/sda1?

Thank you.
Last edited by Vort on Sun Feb 09, 2014 3:48 pm, edited 1 time in total.

suriyan
Posts: 473
Joined: Wed Jun 26, 2013 2:41 pm
languages_spoken: english
ODROIDs: odroid-u2/xu-e/u3/x2/xu3/c1
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by suriyan » Sun Feb 09, 2014 3:42 pm

Vort wrote: Now should I do
dd if=/ of=/dev/sda1
.
Hello Vort,
if=/ will not work. dd works on files (and hence devices).

I would suggest you dd the image, you have say - debian...img to the SD card and the USB drive to start with. Make sure that the USB drive and the SD card - the data in them, is worthless to you, cause you will be overwriting stuff on it.

Using the above, you already have the root fs on both the SD card and the USB drive and hence posibly the root fs will be /dev/sda2.
- Suriyan

Vort
Posts: 153
Joined: Fri Nov 22, 2013 10:04 pm
languages_spoken: english
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by Vort » Sun Feb 09, 2014 3:50 pm

Thank you again!

Yes it doesn't work on /, says it's a directory.

I am with linaro_ubuntu_13.05_server_U2.img and I'll follow your suggestion.

Will report may be soon :)

BTW I edited my previous post while you were answering.
Last edited by Vort on Sun Feb 09, 2014 3:52 pm, edited 1 time in total.

suriyan
Posts: 473
Joined: Wed Jun 26, 2013 2:41 pm
languages_spoken: english
ODROIDs: odroid-u2/xu-e/u3/x2/xu3/c1
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by suriyan » Sun Feb 09, 2014 3:52 pm

Thinking more on it, I am assuming the current root fs is sitting on /dev/mmcblkp02.
If it is so, then you could do dd if=/dev/mmcblkp02 of=/dev/sda1 bs=1M
where mmcblkp02 is root fs on the SD card (current boot) and /dev/sda1 is the USB drive (future rootfs)
Please verify the device names and numbers please!

- Suriyan

Vort
Posts: 153
Joined: Fri Nov 22, 2013 10:04 pm
languages_spoken: english
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by Vort » Sun Feb 09, 2014 3:53 pm

suriyan wrote:Thinking more on it, I am assuming the current root fs is sitting on /dev/mmcblkp02.
If it is so, then you could do dd if=/dev/mmcblkp02 of=/dev/sda1 bs=1M
where mmcblkp02 is root fs on the SD card (current boot) and /dev/sda1 is the USB drive (future rootfs)
Please verify the device names and numbers please!

- Suriyan
Yep!
Starting it right now :)

suriyan
Posts: 473
Joined: Wed Jun 26, 2013 2:41 pm
languages_spoken: english
ODROIDs: odroid-u2/xu-e/u3/x2/xu3/c1
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by suriyan » Sun Feb 09, 2014 3:57 pm

Vort wrote: Since there's no /dev/root in this install (linaro_ubuntu_13.05_server_U2.img) how should I dd the rootfs to /dev/sda1?
Commands such as mount, df etc shall give you the device mounted on /. Also blkid -o list gives a more precise information.
If you have booted up and have plugged in the USB drive (with a partition that you have created), get the output of blkid -o list.

Vort
Posts: 153
Joined: Fri Nov 22, 2013 10:04 pm
languages_spoken: english
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by Vort » Sun Feb 09, 2014 3:58 pm

Vort wrote: Yep!
Nope! ;)
Though fdisk -l reports there is /dev/mmcblk0p2
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 4096 266239 131072 b W95 FAT32
/dev/mmcblk0p2 266240 11532287 5633024 83 Linux
dd doesn't want to see it:
root@odroid-server:/dev# dd if=/dev/mmcblkp02 of=/dev/sda1 bs=1M
dd: opening '/dev/mmcblkp02': No such file or directory
root@odroid-server:/dev#
I'll think n this.

Vort
Posts: 153
Joined: Fri Nov 22, 2013 10:04 pm
languages_spoken: english
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by Vort » Sun Feb 09, 2014 4:01 pm

I'm sorry, but it works. :D
There was simply a typo mmcblkp02<->mmcblk0p2

Thank you so much!
I hope I'll be fine now.

Vort
Posts: 153
Joined: Fri Nov 22, 2013 10:04 pm
languages_spoken: english
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by Vort » Wed Feb 19, 2014 4:37 pm

I am sorry for the huge delay but I come with good news. :)

I did what suriyan described but U3 got stuck on dim blue LED so no kernel running.

When I was editing boot.scr I saw it is not an usual text file.
I edited it to point to /dev/sda1 with the internal file editor of mc as I did it successfully on Raspberry PI earlier. And I realised this could be wrong in the case of U3.
It has to be compiled, am I right?

So I simply took the example boot-thumb.scr from
http://odroid.us/mediawiki/index.php?ti ... _Odroid-U2
and copied it over /media/boot/boot.scr replacing the stock file.

Reboot :o ... a-a-and :? ... success! :D
odroid@odroid-server:~$ mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/kernel/debug type debugfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
/dev/mmcblk0p1 on /media/boot type vfat (rw)
odroid@odroid-server:~$
Thank you suriyan and osterluk for your help! :)

suriyan
Posts: 473
Joined: Wed Jun 26, 2013 2:41 pm
languages_spoken: english
ODROIDs: odroid-u2/xu-e/u3/x2/xu3/c1
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by suriyan » Thu Feb 20, 2014 2:09 am

Good to know Vort!
Vort wrote: When I was editing boot.scr I saw it is not an usual text file.
I edited it to point to /dev/sda1 with the internal file editor of mc as I did it successfully on Raspberry PI earlier. And I realised this could be wrong in the case of U3.
It has to be compiled, am I right?
You are right. For the stock u-boot in U2/U3 it works with only boot.scr which is a special u-boot script file. You have to run mkimage as listed in osterrluk's wiki.
The XU's stock u-boot reads u-boot.ini and u-boot.scr - preferiing the ini file over the scr file. The ini file is plain text.
- Suriyan

Vort
Posts: 153
Joined: Fri Nov 22, 2013 10:04 pm
languages_spoken: english
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by Vort » Thu Feb 20, 2014 3:56 am

Thanks again!
I tried this with a USB-stick and now connected the self-powered HDD to U3.
By the way I measured the voltage on the USB connector of detached HDD - gives 0.01V - no danger for the U3 - attached the HDD to U3 - success :)

3dfx
Posts: 8
Joined: Thu Aug 07, 2014 12:48 am
languages_spoken: english
ODROIDs: Odroid-U3
Location: Bulgaria
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by 3dfx » Sat Aug 16, 2014 10:28 pm

Please excuse me for bringing up an old thread but I seem to be a little bit lost.
My kernel version is 3.8.13.26 and there are no usb-storage.ko, sd_mod.ko and scsi_mod.ko files in /lib/modules/3.8.13.26/kernel/drivers/usb and */scsi.

EDIT: OK, I was actually having version 3.8.13.23 on my SD card. After updating that to 3.8.13.26 (from ubuntu-14.04.1lts-lubuntu-odroid-u-20140814.img.xz) the system booted fine from the USB HDD. Obviously that version has all needed modules already included.

sihorton
Posts: 13
Joined: Wed Mar 27, 2013 6:54 am
languages_spoken: english
ODROIDs: u2
Location: Sweden
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by sihorton » Tue Nov 11, 2014 6:48 am

I am following the tutorial on booting from external usb drive in the march odroid magazine. I am also missing the usb-storage.ko, sd_mod.ko and scsi_mod.ko files in /lib/modules/.../kernel/drivers/usb/storage and */scsi.

i have 3.8.13.23 kernel (from http://odroid.in/ubuntu_14.04lts/ubuntu ... 604.img.xz) and 3.8.13.26 kernel (from http://odroid.in/ubuntu_14.04lts/ubuntu ... 814.img.xz) on an odroid u2. i ran the odroid utility and updated the kernel (now 3.8.13.28) but this version also does not include the modules in /lib/modules/.../kernel/drivers/usb/storage and */scsi.

is there anywhere I can download or extract these modules from to get usb boot support?

suriyan
Posts: 473
Joined: Wed Jun 26, 2013 2:41 pm
languages_spoken: english
ODROIDs: odroid-u2/xu-e/u3/x2/xu3/c1
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by suriyan » Tue Nov 11, 2014 8:12 am

Hi sihorton,
As mentioned in the earlier post by 3dfx, if you have kernel 3.8 13.28 you do not need the modules as they are already in the kernel explicitly.

sihorton
Posts: 13
Joined: Wed Mar 27, 2013 6:54 am
languages_spoken: english
ODROIDs: u2
Location: Sweden
Contact:

Re: NEED HELP! Can't Boot From A USB Disk!

Unread post by sihorton » Tue Nov 11, 2014 6:15 pm

Ah thanks for pointing that out for me, I misread the earlier post.

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 2 guests