User avatar
Feakster
Posts: 35
Joined: Sun Jan 22, 2012 10:41 pm

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

Thu May 10, 2012 6:56 pm

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.

User avatar
Feakster
Posts: 35
Joined: Sun Jan 22, 2012 10:41 pm

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

Thu May 10, 2012 7:19 pm

... 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)?

rogerdean
Posts: 21
Joined: Tue Apr 17, 2012 7:40 pm

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

Thu May 10, 2012 7:26 pm

Yes, I'd like to move / and swap to a USB hard drive. Any advice appreciated...

User avatar
jbeale
Posts: 3350
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

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

Thu May 10, 2012 7:43 pm

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.

User avatar
Feakster
Posts: 35
Joined: Sun Jan 22, 2012 10:41 pm

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

Thu May 10, 2012 8:01 pm

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?

User avatar
jbeale
Posts: 3350
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

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

Thu May 10, 2012 8:22 pm

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.

rogerdean
Posts: 21
Joined: Tue Apr 17, 2012 7:40 pm

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

Thu May 10, 2012 8:40 pm

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...

rogerdean
Posts: 21
Joined: Tue Apr 17, 2012 7:40 pm

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

Thu May 10, 2012 8:51 pm

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

rogerdean
Posts: 21
Joined: Tue Apr 17, 2012 7:40 pm

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

Thu May 10, 2012 8:57 pm

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

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

Oh that's a lot quicker

User avatar
Feakster
Posts: 35
Joined: Sun Jan 22, 2012 10:41 pm

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

Thu May 10, 2012 9:32 pm

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.

rogerdean
Posts: 21
Joined: Tue Apr 17, 2012 7:40 pm

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

Thu May 10, 2012 9:35 pm

There are 2 partitions on your SD card, you need to find the smaller one (79MB) both cmdline.txt and kernel.img are there

User avatar
Feakster
Posts: 35
Joined: Sun Jan 22, 2012 10:41 pm

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

Thu May 10, 2012 9:47 pm

I'm guessing mine was sda1... It's hung in exactly the same place as yours.

rogerdean
Posts: 21
Joined: Tue Apr 17, 2012 7:40 pm

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

Thu May 10, 2012 9:49 pm

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

User avatar
Feakster
Posts: 35
Joined: Sun Jan 22, 2012 10:41 pm

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

Thu May 10, 2012 10:16 pm

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.

le4thab
Posts: 52
Joined: Fri Jan 06, 2012 10:55 pm

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

Thu May 10, 2012 11:04 pm

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!

le4thab
Posts: 52
Joined: Fri Jan 06, 2012 10:55 pm

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

Thu May 10, 2012 11:23 pm

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!

User avatar
Feakster
Posts: 35
Joined: Sun Jan 22, 2012 10:41 pm

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

Thu May 10, 2012 11:41 pm

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.

User avatar
Feakster
Posts: 35
Joined: Sun Jan 22, 2012 10:41 pm

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

Thu May 10, 2012 11:42 pm

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...

User avatar
Feakster
Posts: 35
Joined: Sun Jan 22, 2012 10:41 pm

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

Thu May 10, 2012 11:45 pm

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?

User avatar
Feakster
Posts: 35
Joined: Sun Jan 22, 2012 10:41 pm

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

Thu May 10, 2012 11:48 pm

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?

rogerdean
Posts: 21
Joined: Tue Apr 17, 2012 7:40 pm

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

Fri May 11, 2012 6:39 am

Squeeze. Sounds like you folks are doing exactly what I did. The mysteries of Pi. Good luck...

User avatar
Feakster
Posts: 35
Joined: Sun Jan 22, 2012 10:41 pm

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

Fri May 11, 2012 11:16 am

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?

rogerdean
Posts: 21
Joined: Tue Apr 17, 2012 7:40 pm

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

Fri May 11, 2012 11:19 am

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!

rogerdean
Posts: 21
Joined: Tue Apr 17, 2012 7:40 pm

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

Sat May 12, 2012 1:49 pm

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

Hexxeh
Posts: 91
Joined: Thu Apr 05, 2012 3:07 pm
Contact: Website

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

Sat May 12, 2012 9:39 pm

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

Return to “General discussion”

Who is online

Users browsing this forum: No registered users and 35 guests