Hello,
I'd like to boot from a USB stick or lets say boot from SD card and then run from usb stick. What's the easiest and prefererred way to do this?
Thanks for any hint!
Re: Boot from USB stick?
The boot code is read from the sd card so you can't boot from usb stick.
Re: Boot from USB stick?
thank you joan, I understand this. It's enough for me if then the root file system and so on is on the usb stick, so let pi boot from sd card and then let the stick take over. What's the best way to set this up?
Re: Boot from USB stick?
I have no idea.
Might be worthwhile to look through the following sort of thread.
http://raspberrypi.org/phpBB3/viewtopic.php?f=63&t=6685
Might be worthwhile to look through the following sort of thread.
http://raspberrypi.org/phpBB3/viewtopic.php?f=63&t=6685
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6505
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Boot from USB stick?
Use dd or winimage to write the image to the USB stick rather than the sdcard.
Format the sdcard as FAT and copy the files from the FAT partition of the USB stick onto the sdcard (only needs to be about 64M in size).
Change cmdline.txt on sdcard from root=/dev/mmcblk0p2 to root=/dev/sda2
Format the sdcard as FAT and copy the files from the FAT partition of the USB stick onto the sdcard (only needs to be about 64M in size).
Change cmdline.txt on sdcard from root=/dev/mmcblk0p2 to root=/dev/sda2
Re: Boot from USB stick?
dom wrote:Use dd or winimage to write the image to the USB stick rather than the sdcard.
Format the sdcard as FAT and copy the files from the FAT partition of the USB stick onto the sdcard (only needs to be about 64M in size).
Change cmdline.txt on sdcard from root=/dev/mmcblk0p2 to root=/dev/sda2
Could this also be used with a USB HDD of any size too or does the FS have to be FAT ?
(Still waiting for my Pi to arrive so picking up tips until then

Re: Boot from USB stick?
Works awesome and without fiddlign, perfect, thank you!dom wrote:Use dd or winimage to write the image to the USB stick rather than the sdcard.
Format the sdcard as FAT and copy the files from the FAT partition of the USB stick onto the sdcard (only needs to be about 64M in size).
Change cmdline.txt on sdcard from root=/dev/mmcblk0p2 to root=/dev/sda2
Just one problem: raspi-config can't resize the root partition in this case ): Well, gues I have to do this manually or is there an easy way to fix the problem with raspi-config? Thanks

you need to initially boot from the SD card, then the external hdd can take over. FAT only required for the boot partition, for the root ext4 seems to be default.Could this also be used with a USB HDD of any size too or does the FS have to be FAT ?
Last edited by srynoname on Sat Jul 21, 2012 1:05 pm, edited 1 time in total.
Re: Boot from USB stick?
srynoname wrote:Works awesome and without fiddlign, perfect, thank you!dom wrote:Use dd or winimage to write the image to the USB stick rather than the sdcard.
Format the sdcard as FAT and copy the files from the FAT partition of the USB stick onto the sdcard (only needs to be about 64M in size).
Change cmdline.txt on sdcard from root=/dev/mmcblk0p2 to root=/dev/sda2
Just one problem: raspi-config can't resize the root partition in this case ): Well, gues I have to do this manually or is there an easy way to fix the problem with raspi-config? Thanks
Could this also be used with a USB HDD of any size too or does the FS have to be FAT ?[/quoite]
you need to initially boot fromt he SD card, then the external hdd can take over. FAt only required for the boot partition, for the root ext4 seems to be default.
Great thanks alot

-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6505
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Boot from USB stick?
Try:srynoname wrote: Works awesome and without fiddlign, perfect, thank you!
Just one problem: raspi-config can't resize the root partition in this case ): Well, gues I have to do this manually or is there an easy way to fix the problem with raspi-config? Thanks![]()
Code: Select all
cp /usr/bin/raspi-config ~
sed -i 's/mmcblk0p2/sda2/' ~/raspi-config
sed -i 's/mmcblk0/sda/' ~/raspi-config
sudo ~/raspi-config
Re: Boot from USB stick?
Hmm about the resize, guess one could also put image on sd card completely, boot once, resize partition and then image the sd card, copy image to usb stick, clear sd card and put only boot stuff on it.srynoname wrote:Works awesome and without fiddlign, perfect, thank you!dom wrote:Use dd or winimage to write the image to the USB stick rather than the sdcard.
Format the sdcard as FAT and copy the files from the FAT partition of the USB stick onto the sdcard (only needs to be about 64M in size).
Change cmdline.txt on sdcard from root=/dev/mmcblk0p2 to root=/dev/sda2
Just one problem: raspi-config can't resize the root partition in this case ): Well, gues I have to do this manually or is there an easy way to fix the problem with raspi-config? Thanks
Edit: doms way also sounds quite well, will test it later. I forgot raspi-config is a script, not a binary application

-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: Boot from USB stick?
The method should work just as well (well, almost) if it was a binary...srynoname wrote:Edit: doms way also sounds quite well, will test it later. I forgot raspi-config is a script, not a binary application
P.S. You could reduce the sed to a single invocation, like this:
sed -E 's/mmcblk0p?/sda/'
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)
Re: Boot from USB stick?
thank you both, tried it with doms "original commands" and it worked fine!
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6505
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Boot from USB stick?
No, the second replace doesn't have the p in. (Although I'm sure there exists a single line version).Joe Schmoe wrote: P.S. You could reduce the sed to a single invocation, like this:
sed -E 's/mmcblk0p?/sda/'
Re: Boot from USB stick?
Actually Joes version will replace mmcblk0 to sda and mmcblk0p2 to sda2 in one line. It will also replace mmcblk0p1 to sda1 and so on.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6505
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Boot from USB stick?
You are quite right.kadamski wrote:Actually Joes version will replace mmcblk0 to sda and mmcblk0p2 to sda2 in one line. It will also replace mmcblk0p1 to sda1 and so on.
-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: Boot from USB stick?
Yes. "man re_format" should tell you all about these things.
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)
Re: Boot from USB stick?
Thank you 'dom'.dom wrote:Use dd or winimage to write the image to the USB stick rather than the sdcard.
Format the sdcard as FAT and copy the files from the FAT partition of the USB stick onto the sdcard (only needs to be about 64M in size).
Change cmdline.txt on sdcard from root=/dev/mmcblk0p2 to root=/dev/sda2
I was very easy to boot from SD card and then operate from pendrive:).
So now I have added sdhci-bcm2708.missing_status=0 sdhci-bcm2708.sync_after_dma=0 and started long term tests to see if different webcams works more stable with rpi.
I hope that SD card is now only used for boot and system will not turn randomly to read-only - on SD card IO errors. Am I right?
-
- Posts: 6
- Joined: Thu Dec 06, 2012 6:55 am
Re: Boot from USB stick?
Sadly, I can't get this to work.
I followed the directions, but I get a kernel panic.
When I make a new NORMAL sd card the cmdline.txt contains this:
dwc_otg.speed=0 dwc_otg.lpm_enable=0 root=/dev/ram0 init=/sbin/init console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1
Do I need to let it completely install to sd card (including all the network updates and all that), & then mod the cmdline file..then make the usb go thru the whole network updates and all that again??
I followed the directions, but I get a kernel panic.
When I make a new NORMAL sd card the cmdline.txt contains this:
dwc_otg.speed=0 dwc_otg.lpm_enable=0 root=/dev/ram0 init=/sbin/init console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1
Do I need to let it completely install to sd card (including all the network updates and all that), & then mod the cmdline file..then make the usb go thru the whole network updates and all that again??
Re: Boot from USB stick?
there are plenty of other posts about moving the rootfsMrWareWolf wrote:Sadly, I can't get this to work.
I followed the directions, but I get a kernel panic.
When I make a new NORMAL sd card the cmdline.txt contains this:
dwc_otg.speed=0 dwc_otg.lpm_enable=0 root=/dev/ram0 init=/sbin/init console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1
Do I need to let it completely install to sd card (including all the network updates and all that), & then mod the cmdline file..then make the usb go thru the whole network updates and all that again??
but basically
take a working SD card
and a blank USB drive [flash or HD]
duplicate the 2nd partition on the SD card to a partition on the USB drive
i.e.
dd bs=1M conv=sync,noerror if=/dev/mmcblk0p2 of=/dev/sda1
^ alter your if and of to whatever is correct for you
edit
/boot/cmdline.txt to be
dwc_otg.lpm_enable=0 root=/dev/sda1 rootfstype=ext4 elevator=deadline rootwait
[alter what is /dev/mmcblk0p2 to be /dev/sda1or what your new drive is it will not be
root=/dev/ram0
]
reboot and your away
also
http://www.raspberrypi.org/phpBB3/viewt ... 66&t=10998
Last edited by RaTTuS on Fri Mar 22, 2013 12:30 pm, edited 1 time in total.
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe
WARNING - some parts of this post may be erroneous YMMV
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe
- duberry
- Posts: 379
- Joined: Mon Jan 28, 2013 10:44 pm
- Location: standing on a planet that's evolving. And revolving at nine hundred miles an hour
Re: Boot from USB stick?
any one know if someone posted instructions/info needed to boot from usb without sd card ?
i found this https://twitter.com/TeamRaspi/status/313721902906613760
i found this https://twitter.com/TeamRaspi/status/313721902906613760
Raspberry Pi Team @TeamRaspi 18 Mar
Today I got the Raspberry Pi model A booting with no sdcard! It's booting its code from USB (from a model B!)
lend me your arms, fast as thunderbolts, for a pillow on my journey.
If the environment was a bank, would it be too big to fail
so long; and thanks for all the pi
If the environment was a bank, would it be too big to fail
so long; and thanks for all the pi
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6505
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Boot from USB stick?
Note the following message:duberry wrote:any one know if someone posted instructions/info needed to boot from usb without sd card ?
i found this https://twitter.com/TeamRaspi/status/313721902906613760Raspberry Pi Team @TeamRaspi 18 Mar
Today I got the Raspberry Pi model A booting with no sdcard! It's booting its code from USB (from a model B!)
you cannot boot from a mass storage device, only from a host (ie plug it into your PC and boot it directly). But it's still cool!
-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: Boot from USB stick?
Dom,
Are you saying that there is (at least a little bit) some credence to the claim on twitter?
The CW has always been that, despite what anyone says, you can't boot the Pi w/o an SD card.
FWIW, not that I see any real utility in this idea (I'm in the "But isn't it cool?" camp), how would one go about booting the Pi from the USB port (connected to another PC)? (That is, if there is anything to this at all...)
Are you saying that there is (at least a little bit) some credence to the claim on twitter?
The CW has always been that, despite what anyone says, you can't boot the Pi w/o an SD card.
FWIW, not that I see any real utility in this idea (I'm in the "But isn't it cool?" camp), how would one go about booting the Pi from the USB port (connected to another PC)? (That is, if there is anything to this at all...)
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6505
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Boot from USB stick?
That twitter post is Gordon (gsh), so is true.Joe Schmoe wrote: Are you saying that there is (at least a little bit) some credence to the claim on twitter?
The CW has always been that, despite what anyone says, you can't boot the Pi w/o an SD card.
FWIW, not that I see any real utility in this idea (I'm in the "But isn't it cool?" camp), how would one go about booting the Pi from the USB port (connected to another PC)? (That is, if there is anything to this at all...)
The model A Raspberry Pi can be booted from a USB *host* (like a PC) running the correct software.
Not sure if this will prove useful to anyone yet.
Re: Boot from USB stick?
If the model A could be booted from a PC (ideally a Debian Linux system) via USB, that could make some of the bare metal testing a lot less tedious without all the switching of the SD card. Just compile appropriate image on PC and boot Pi via USB.
I expect it wouldn't be worth the effort to set up for the few people who would use it though.
I expect it wouldn't be worth the effort to set up for the few people who would use it though.
Re: Boot from USB stick?
Really great - it works -
the job I've done:
1. raspdebian on the sdcard
2. put the sd card and the usb stick formated in ext4 - 1 partition -in the computer ( linux )
it gives :
- /dev/sdb1 ( boot ) and /dev/sdb2 for the sd
- /dev/sdf1 on the usb stick
3. dd bs=1M conv=sync,noerror if=/dev/sdb2 of=/dev/sdf1 ; sync
4. change root=/dev/mmcbl... into root=/dev/sda1
CARE WITH THE POINT 3 : AFTER of= YOU MUST PUT THE PARTITION OF THE USB STICK - NO ERROR ALLOWED.
the job I've done:
1. raspdebian on the sdcard
2. put the sd card and the usb stick formated in ext4 - 1 partition -in the computer ( linux )
it gives :
- /dev/sdb1 ( boot ) and /dev/sdb2 for the sd
- /dev/sdf1 on the usb stick
3. dd bs=1M conv=sync,noerror if=/dev/sdb2 of=/dev/sdf1 ; sync
4. change root=/dev/mmcbl... into root=/dev/sda1
CARE WITH THE POINT 3 : AFTER of= YOU MUST PUT THE PARTITION OF THE USB STICK - NO ERROR ALLOWED.