Page 1 of 2

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 6:56 pm
by Feakster
I know the Pi has to boot from an SD card, but does anyone know how to set up the Pi so that it boots from the SD card, then switches to running from the USB stick? I know it's possible because I remember seeing someone from the foundation saying they used a similar layout in one of their videos. It also might help to speed things up a little.

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 7:19 pm
by Feakster
... Or better still, has anyone thought to create a universal bootloader SD card image that automatically tells the SoC to look on USB card for the filesystem (whatever distro it may be)?

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 7:26 pm
by rogerdean
Yes, I'd like to move / and swap to a USB hard drive. Any advice appreciated...

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 7:43 pm
by jbeale
Edit the cmdline.txt to show root =dev/sda1 instead of root=mmcblk0p2
from http://www.raspberrypi.org/for.....lash-drive

Does this work? Of course you need to have a correctly formatted, partitioned, and all needed files setup on the memory stick or USB HDD connected to the 1st USB port.

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 8:01 pm
by Feakster
Would burning the same debian squeeze image to the USB stick as is on the SD card work with the above command line? One would presume that once the SoC had been re-directed to the USB stick everything else would then be redundant on the SD card?

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 8:22 pm
by jbeale
Feakster said:


Would burning the same debian squeeze image to the USB stick as is on the SD card work with the above command line? One would presume that once the SoC had been re-directed to the USB stick everything else would then be redundant on the SD card?



I would presume so, but I do not have a Pi myself to try it.

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 8:40 pm
by rogerdean
I'm trying it out now, but presumably we'd need to use not -

Edit the cmdline.txt to show root =dev/sda1 instead of root=mmcblk0p2

but -

Edit the cmdline.txt to show root =dev/sda2 instead of root=mmcblk0p2

Will report back...

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 8:51 pm
by rogerdean
No, doesn't like it much. Boot hangs at -

scsi 0:0:0:0: Direct-Access   Kingston DataTraveler G3    1.00 PQ: 0 ANSI: 0 CCS

And I can't get my USB hard drive to pick up at all, even when hot-plugging into a booted GUI. Separate issues though I guess

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 8:57 pm
by rogerdean
Ok, got it working! You need the new kernel from here -

https://github.com/raspberrypi/firmware ... kernel.img

Oh that's a lot quicker

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 9:32 pm
by Feakster
rogerdean said:


I'm trying it out now, but presumably we'd need to use not -

Edit the cmdline.txt to show root =dev/sda1 instead of root=mmcblk0p2

but -

Edit the cmdline.txt to show root =dev/sda2 instead of root=mmcblk0p2

Will report back...


How do you edit the "cmdline.txt"? I can't find the file.

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 9:35 pm
by rogerdean
There are 2 partitions on your SD card, you need to find the smaller one (79MB) both cmdline.txt and kernel.img are there

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 9:47 pm
by Feakster
I'm guessing mine was sda1... It's hung in exactly the same place as yours.

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 9:49 pm
by rogerdean
Did you replace kernel.img? That's what fixed it for me

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 10:16 pm
by Feakster
rogerdean said:


Did you replace kernel.img? That's what fixed it for me


I replaced the kernel.img file with the github one before trying it. Reflashing my SD card now to try again. I currently don't have any other linux systems to swap out individual files other than the pi. My gfx card's fried on my laptop which was dual-booted with fedora. Makes it all rather time-consuming.

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 11:04 pm
by le4thab
right

debian freshly written to sd card and to flash drive.inserted sd and boots fine.edited cmdline.txt to show root=dev/sda2 on sd card.new kernel.img from github replaced old kernel on sd and flash drive and nothing!!!

tbh as a noob i am unsure as to where to turn now!

quick edit...

i get the slightest flicker of ok light above the power light like it is trying to boot then nothing!

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 11:23 pm
by le4thab
edited kernel_emergancy.img to kernel.img and got it too boot but seems to stick at

"sda 0:0:0:0: [sda] no caching mode page present

sda 0:0:0:0: assuming drive cache:write through

sda 0:0:0:0: attached SCSI remoable disk"

and thats it!

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 11:41 pm
by Feakster
le4thab said:


right

debian freshly written to sd card and to flash drive.inserted sd and boots fine.edited cmdline.txt to show root=dev/sda2 on sd card.new kernel.img from github replaced old kernel on sd and flash drive and nothing!!!

tbh as a noob i am unsure as to where to turn now!

quick edit...

i get the slightest flicker of ok light above the power light like it is trying to boot then nothing!


I'm in the same sort of boat as you. Just tried "root=dev/sda1" with no success. I'm going to try "root=dev/sda2" now. I had it connected through a USB hub before. Not sure whether it makes a difference or not. rogerdean got it working via this method so it must be possible.

Yours probably hangs on the identification of your flash drive, like mine does. That's what it did just now anyhow. You'll have to re-flash your SD card now unless you have a some other linux system in your home. If you do, you can just re-edit the cmdline.txt file back to what it was before.

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 11:42 pm
by Feakster
le4thab said:


edited kernel_emergancy.img to kernel.img and got it too boot but seems to stick at

"sda 0:0:0:0: [sda] no caching mode page present

sda 0:0:0:0: assuming drive cache:write through

sda 0:0:0:0: attached SCSI remoable disk"

and thats it!


Mine hangs at the identification of the USB stick...

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 11:45 pm
by Feakster
rogerdean said:


Ok, got it working! You need the new kernel from here -

https://github.com/raspberrypi/firmware ... kernel.img

Oh that's a lot quicker


Did you do anything else other than the kernel update from github & the "cmdline.txt" file edit? Is it just the "root=xxxxx" statement that needs to be edited?

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Thu May 10, 2012 11:48 pm
by Feakster
rogerdean said:


Ok, got it working! You need the new kernel from here -

https://github.com/raspberrypi/firmware ... kernel.img

Oh that's a lot quicker


... & are you using Arch Linux or Debian Squeeze?

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Fri May 11, 2012 6:39 am
by rogerdean
Squeeze. Sounds like you folks are doing exactly what I did. The mysteries of Pi. Good luck...

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Fri May 11, 2012 11:16 am
by Feakster
Squeeze. Sounds like you folks are doing exactly what I did. The mysteries of Pi. Good luck...

Did you update the kernel on both the USB & SD? Would updating the kernel on the USB make a difference, because I did both? I am somewhat clutching at straws now. Might even try without the GitHub new kernel to see if that makes a difference.

Is it much faster?

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Fri May 11, 2012 11:19 am
by rogerdean
I updated the kernel just on the SD, because that's the booting partition. The small boot partition on the USB stick won't be used at all, I think.

It was indeed much faster for a couple of boots, then I get constant freezing and swap access, so it's not quite the end of the road yet!

Re: Booting from the SD card, but using a USB stick to run the OS & store the file system

Posted: Sat May 12, 2012 1:49 pm
by rogerdean
Ok, I've done it. The secret was, as in so many places on these forums, that my power supplies (cellphone chargers) just weren't giving enough power for the portable hard drive. I had 3, one powering the Pi, one powering the USB hub, and one powering the hard drive through a split cable. Not good enough.

Then I tried using my laptop USB port as an additional power supply for the hard disk, and all was well. So, the steps are -

1) find a way to get enough power to the USB hard drive

2) write the squeeze image to both hard drive and to your SD card

3) on the small partition of the SD card, modify cmdline.txt as described above

4) on the small partition of the SD card, replace kernel.img with the one from github as above

5) plug it all in and off you go!

It's hugely faster, feels more like a real (very old) computer. Good luck

Re: Booting from the SD card, but using a USB stick to run t

Posted: Sat May 12, 2012 9:39 pm
by Hexxeh
Be careful when updating the kernel, you also need to copy across the matching modules. rpi-update (http://hexxeh.net/?p=328117855) will do this for you, but if you're doing it by hand, you'll need to remember to do it yourself when updating kernel.img