How to boot the raspberry pi quickly.
i am not getting the correct solution.
Re: Fast boot raspberry pi
What is quickly?
1minute? 1 second?
1minute? 1 second?
- DougieLawson
- Posts: 40835
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: Fast boot raspberry pi
How quickly is quickly?
What services do you expect to be active to consider that your RPi has booted?
Is this running as a server, as a controller for a robot or as a desktop machine?
Have you looked at raspbian-ua-netinst to get Raspbian running in a very minimal configuration?
What services do you expect to be active to consider that your RPi has booted?
Is this running as a server, as a controller for a robot or as a desktop machine?
Have you looked at raspbian-ua-netinst to get Raspbian running in a very minimal configuration?
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Re: Fast boot raspberry pi
How fast do you need to boot, and what can you afford to not have running once booted? Generally removing stuff start needs to start up improves boottime. I think someone has got a Pi to boot Linux in 4s by removing lots of stuff.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Re: Fast boot raspberry pi
I need to boot in 30 sec, it contains web service and java program.
Re: Fast boot raspberry pi
How long does it take now then?
My pi is very close tp 30 secs without tuning.
My pi is very close tp 30 secs without tuning.
Re: Fast boot raspberry pi
shuckle wrote:How long does it take now then?
My pi is very close tp 30 secs without tuning.
it takes 56 seconds.
- DougieLawson
- Posts: 40835
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: Fast boot raspberry pi
Forget getting it running fast as soon as you say "Java".enpboss wrote:I need to boot in 30 sec, it contains web service and java program.
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
- Richard-TX
- Posts: 1549
- Joined: Tue May 28, 2013 3:24 pm
- Location: North Texas
Re: Fast boot raspberry pi
If you need a fast boot get a Beaglebone black. It boots in about 10 seconds.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip
Re: Fast boot raspberry pi
Or just do on the Pi whatever is done to achieve that. If jamesh's recollection is correct then equally fast boot up times on a Pi should be possible but it does depend on exactly what the boot process needs to do.Richard-TX wrote:If you need a fast boot get a Beaglebone black. It boots in about 10 seconds.
I think, on balance, it would be better to do that, stay with the Pi, benefit the Pi community while retaining their help in achieving that goal, than going to a different board and losing the help the Pi community can offer.
Re: Fast boot raspberry pi
Running a systemd system I get to the point the kernel starts to run user mode processes in about 2.5 seconds, but I think that's misleading because the kernel is still running its bootstrap. On the same kernel (3.18.3) with OpenRC I get to the magic "Freeing unused kernel memory" at 5.5seconds. (That happens at 3.3s on the systemd system.)
Both the test systems are overclocked:
arm_freq=1000
core_freq=500
sdram_freq=500
over_voltage=6
It you need faster than 2.5s to running user mode programs then I think I can be pretty sure you need something other than Linux. RISC OS is a probable solution.
If you are OK with 5s then you can probably make things work by tuning what happens in both the initrd (if you chose to use one) and whatever it exec's. In principle you can build a very high performance, very robust, system using just busybox and whatever you need in hand-crafted programs.
John Bowler
Both the test systems are overclocked:
arm_freq=1000
core_freq=500
sdram_freq=500
over_voltage=6
It you need faster than 2.5s to running user mode programs then I think I can be pretty sure you need something other than Linux. RISC OS is a probable solution.
If you are OK with 5s then you can probably make things work by tuning what happens in both the initrd (if you chose to use one) and whatever it exec's. In principle you can build a very high performance, very robust, system using just busybox and whatever you need in hand-crafted programs.
John Bowler
Re: Fast boot raspberry pi
I have 7 seconds with a fairly stock archlinux on pi.Richard-TX wrote:If you need a fast boot get a Beaglebone black. It boots in about 10 seconds.
I use it with the raspicam camera, so that 7 seconds is from rainbow boot to end of startup ( and first picture taken)
Android app - Raspi Card Imager - download and image SD cards - No PC required !
Re: Fast boot raspberry pi
http://www.raspberrypi.org/forums/viewt ... 80#p657429mahjongg wrote:The "fastest booting OS" is the one that spends the least time transferring data from the card into memory, running the least amount of code to "boot", and spending the least amount of time initializing sub-systems. its as simple as that.
Re: Fast boot raspberry pi
Well, indeed, the fastest booting OS is the fastest booting OS.r3d4 wrote:http://www.raspberrypi.org/forums/viewt ... 80#p657429mahjongg wrote:The "fastest booting OS" is the one that spends the least time transferring data from the card into memory, running the least amount of code to "boot", and spending the least amount of time initializing sub-systems. its as simple as that.
Next.
Re: Fast boot raspberry pi
To be slightly more constructive:
The original UNIX kernel required that everything you wanted to do with the hardware be there right at the start, and it has to be initialized right at the start too.
The current Linux kernel does this as well, unless you use systemd, however the 'generic' kernel doesn't require that everything is correct. Instead it asks each driver in turn whether it works and, if it doesn't, throws it away and reclaims the memory. This means that a generic kernel works with everything but takes a long time to boot.
Around the time the ARM was first developed, in the 1980s, the concept of a "microkernel" became popular, probably as a reaction to the increasing complexity of the UNIX kernel. Microkernels don't do anything that doesn't need to be done to run the first user process, so they boot very fast but the user process might then have to wait a bit to get hold of the hardware it needs. RISC OS is an example of such a kernel, and it boots very fast.
You can achieve the same thing with Linux by putting everything into modules and only modprobing the stuff you need. Linux starts to look a lot like RISC OS at this point
But, as others have said by implication, the normal issue people encounter is that the user system is itself bloated; it does all manner of things that aren't necessary. This is why people quote boot times of more than 5 seconds; all that time is spent doing things that probably aren't necessary, like setting the time (a very slow operation.)
For that reason the first thing to do is to deconstruct the user boot process; everything that happens after process 1 is started. In some sense that means building your own operating system, but, in practice, if you are not providing a multi-user operating system and you care about the time-to-start then you have no choice but to do this. Anyway, it's really easy; both OpenRC and systemd can be effectively deconstructed by disabling things from the start. Debian probably isn't a good starting point - it *is* a multi-user OS so it expects to have to start up everything that any user might need.
For Linux systems busybox provides an almost canonical implementation; you don't need anything apart from busybox to get a running Linux based operating system.
John Bowler
The original UNIX kernel required that everything you wanted to do with the hardware be there right at the start, and it has to be initialized right at the start too.
The current Linux kernel does this as well, unless you use systemd, however the 'generic' kernel doesn't require that everything is correct. Instead it asks each driver in turn whether it works and, if it doesn't, throws it away and reclaims the memory. This means that a generic kernel works with everything but takes a long time to boot.
Around the time the ARM was first developed, in the 1980s, the concept of a "microkernel" became popular, probably as a reaction to the increasing complexity of the UNIX kernel. Microkernels don't do anything that doesn't need to be done to run the first user process, so they boot very fast but the user process might then have to wait a bit to get hold of the hardware it needs. RISC OS is an example of such a kernel, and it boots very fast.
You can achieve the same thing with Linux by putting everything into modules and only modprobing the stuff you need. Linux starts to look a lot like RISC OS at this point

But, as others have said by implication, the normal issue people encounter is that the user system is itself bloated; it does all manner of things that aren't necessary. This is why people quote boot times of more than 5 seconds; all that time is spent doing things that probably aren't necessary, like setting the time (a very slow operation.)
For that reason the first thing to do is to deconstruct the user boot process; everything that happens after process 1 is started. In some sense that means building your own operating system, but, in practice, if you are not providing a multi-user operating system and you care about the time-to-start then you have no choice but to do this. Anyway, it's really easy; both OpenRC and systemd can be effectively deconstructed by disabling things from the start. Debian probably isn't a good starting point - it *is* a multi-user OS so it expects to have to start up everything that any user might need.
For Linux systems busybox provides an almost canonical implementation; you don't need anything apart from busybox to get a running Linux based operating system.
John Bowler
Re: Fast boot raspberry pi
Within linux. Look at a custom kernel + a busybox initramfs.
The ram disk you-ll need to build yourself. Suggest busy box + uclibc + whatever else you need.
Then with the kernel - only enable the minimal that you need to boot the machine.
Link the initramfs into the kernel.
This will boot *very fast* into a not very usable system. This said though if you know what you want to run, it would be very fast - probably as fast as it can be with linux.
I've been planning on doing a RPi system like this - for amusment more than anything. Havn't yet had time to do it though ...
The ram disk you-ll need to build yourself. Suggest busy box + uclibc + whatever else you need.
Then with the kernel - only enable the minimal that you need to boot the machine.
Link the initramfs into the kernel.
This will boot *very fast* into a not very usable system. This said though if you know what you want to run, it would be very fast - probably as fast as it can be with linux.
I've been planning on doing a RPi system like this - for amusment more than anything. Havn't yet had time to do it though ...