micutu82
Posts: 16
Joined: Sat Apr 18, 2020 1:40 pm

Automatically turn on after power supply gets off

Fri May 01, 2020 8:26 pm

Hello,

I have read that a raspberry pi doesn't have a BIOS like a normal computer (Desktop or laptop).

The question is:

If the power supply gets off and it's come back after , let's say...5-10 minutes, raspberry is starting automatically, without any problem?

At the newer computers in BIOS we have an option to do that, to start again by itself when the power supply is come back

Thank you and sorry for my English

trejan
Posts: 1874
Joined: Tue Jul 02, 2019 2:28 pm

Re: Automatically turn on after power supply gets off

Fri May 01, 2020 8:38 pm

micutu82 wrote:
Fri May 01, 2020 8:26 pm
If the power supply gets off and it's come back after , let's say...5-10 minutes, raspberry is starting automatically, without any problem?
Yes. The Pi will always try to start after power has been restored.

micutu82
Posts: 16
Joined: Sat Apr 18, 2020 1:40 pm

Re: Automatically turn on after power supply gets off

Fri May 01, 2020 8:46 pm

Thank you for your fast reply.

But the OS could have problems? if then it's running a process, or maybe SD card may have problems
Can i run the OS from a hdd on USB? (of course with its own power supply)


LE

From this documentation i understood that i can't boot on raspberry pi 4 from a hdd on USB

https://www.raspberrypi.org/documentati ... teeprom.md

W. H. Heydt
Posts: 12431
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Automatically turn on after power supply gets off

Fri May 01, 2020 8:59 pm

micutu82 wrote:
Fri May 01, 2020 8:46 pm
Thank you for your fast reply.

But the OS could have problems? if then it's running a process, or maybe SD card may have problems
Can i run the OS from a hdd on USB? (of course with its own power supply)
Yes, you can put anything from the root file system to the whole boot process (depending on model) on an HDD. While that will *reduce* the chances of file system corruption from losing power, it won't solve the problem. The problem is that, if file system activity is taking place when the power fails, there may be file system corruption. The corruption may or may not be recoverable.

There are several pretty good solutions to your problem. Things like "read only" file systems, for instance. But if you want a normally running system, then your first step should be to use a UPS to reduce the chance of an uncontrolled power outage. The reason I say "reduce" rather than "eliminate" is because a UPS can fail on its own, though it's not particularly likely and routine maintanence can make the chances quite low.

emma1997
Posts: 774
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Automatically turn on after power supply gets off

Fri May 01, 2020 9:00 pm

The problem is shutting down w/o permission because of SD corruption, not the powerup part. Modern HD are more resistant to damage in that case and flash drive or SSD even more so.

micutu82
Posts: 16
Joined: Sat Apr 18, 2020 1:40 pm

Re: Automatically turn on after power supply gets off

Fri May 01, 2020 9:25 pm

W. H. Heydt wrote:
Fri May 01, 2020 8:59 pm
micutu82 wrote:
Fri May 01, 2020 8:46 pm
Thank you for your fast reply.

But the OS could have problems? if then it's running a process, or maybe SD card may have problems
Can i run the OS from a hdd on USB? (of course with its own power supply)
Yes, you can put anything from the root file system to the whole boot process (depending on model) on an HDD. While that will *reduce* the chances of file system corruption from losing power, it won't solve the problem. The problem is that, if file system activity is taking place when the power fails, there may be file system corruption. The corruption may or may not be recoverable.

There are several pretty good solutions to your problem. Things like "read only" file systems, for instance. But if you want a normally running system, then your first step should be to use a UPS to reduce the chance of an uncontrolled power outage. The reason I say "reduce" rather than "eliminate" is because a UPS can fail on its own, though it's not particularly likely and routine maintanence can make the chances quite low.
Yes, thank you very much for your fast answer. I want to make my own router :) It's only a hobby :). I don't think i will buy an UPS, probably i will use an ssd on usb. Do i need a different power supply for ssd? I forgot to say that i want to buy a raspberry pi 4

micutu82
Posts: 16
Joined: Sat Apr 18, 2020 1:40 pm

Re: Automatically turn on after power supply gets off

Fri May 01, 2020 9:30 pm

emma1997 wrote:
Fri May 01, 2020 9:00 pm
The problem is shutting down w/o permission because of SD corruption, not the powerup part. Modern HD are more resistant to damage in that case and flash drive or SSD even more so.
Then, first i will try with an HD card or a flash drive. Anyway, for the first time when i boot up, i have to use a sd card, right? for raspberry pi 4
Thank you

W. H. Heydt
Posts: 12431
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Automatically turn on after power supply gets off

Fri May 01, 2020 9:53 pm

micutu82 wrote:
Fri May 01, 2020 9:25 pm
W. H. Heydt wrote:
Fri May 01, 2020 8:59 pm
micutu82 wrote:
Fri May 01, 2020 8:46 pm
Thank you for your fast reply.

But the OS could have problems? if then it's running a process, or maybe SD card may have problems
Can i run the OS from a hdd on USB? (of course with its own power supply)
Yes, you can put anything from the root file system to the whole boot process (depending on model) on an HDD. While that will *reduce* the chances of file system corruption from losing power, it won't solve the problem. The problem is that, if file system activity is taking place when the power fails, there may be file system corruption. The corruption may or may not be recoverable.

There are several pretty good solutions to your problem. Things like "read only" file systems, for instance. But if you want a normally running system, then your first step should be to use a UPS to reduce the chance of an uncontrolled power outage. The reason I say "reduce" rather than "eliminate" is because a UPS can fail on its own, though it's not particularly likely and routine maintanence can make the chances quite low.
Yes, thank you very much for your fast answer. I want to make my own router :) It's only a hobby :). I don't think i will buy an UPS, probably i will use an ssd on usb. Do i need a different power supply for ssd? I forgot to say that i want to buy a raspberry pi 4
At present, I have 3 Pi4B4 each with an attached HP 120GB SSD. The SSDs run from their respective Pis. I also have a Pi3B+ powering and booting from a WD 314GB PiDrive. All of those Pis are behind a UPS. You can get a small (about 350VA) for less than $40, at least the last time I bought one.

Just be sure to check the specs on your chosen SSD/HDD to be sure that it will run from a 5v supply (typical of 2.5" form factor drives) and whose maximum draw is less than the 1.2A a Pi can supply to the USB ports. The SSDs I'm using are all rated at less than 1.5W (300mA) max for writing. The PiDrive was specially designed to powered from a Pi, including reduced starting in-rush current, which is what will rule out many HDDs.

I should point out that all of my network equipment--modem, routers, and switches--are behind UPSes, so just because your Pi project is to make a router is a not reason to omit proper power protection.

micutu82
Posts: 16
Joined: Sat Apr 18, 2020 1:40 pm

Re: Automatically turn on after power supply gets off

Sat May 02, 2020 10:01 pm

W. H. Heydt wrote:
Fri May 01, 2020 9:53 pm
micutu82 wrote:
Fri May 01, 2020 9:25 pm
W. H. Heydt wrote:
Fri May 01, 2020 8:59 pm

Yes, you can put anything from the root file system to the whole boot process (depending on model) on an HDD. While that will *reduce* the chances of file system corruption from losing power, it won't solve the problem. The problem is that, if file system activity is taking place when the power fails, there may be file system corruption. The corruption may or may not be recoverable.

There are several pretty good solutions to your problem. Things like "read only" file systems, for instance. But if you want a normally running system, then your first step should be to use a UPS to reduce the chance of an uncontrolled power outage. The reason I say "reduce" rather than "eliminate" is because a UPS can fail on its own, though it's not particularly likely and routine maintanence can make the chances quite low.
Yes, thank you very much for your fast answer. I want to make my own router :) It's only a hobby :). I don't think i will buy an UPS, probably i will use an ssd on usb. Do i need a different power supply for ssd? I forgot to say that i want to buy a raspberry pi 4
At present, I have 3 Pi4B4 each with an attached HP 120GB SSD. The SSDs run from their respective Pis. I also have a Pi3B+ powering and booting from a WD 314GB PiDrive. All of those Pis are behind a UPS. You can get a small (about 350VA) for less than $40, at least the last time I bought one.

Just be sure to check the specs on your chosen SSD/HDD to be sure that it will run from a 5v supply (typical of 2.5" form factor drives) and whose maximum draw is less than the 1.2A a Pi can supply to the USB ports. The SSDs I'm using are all rated at less than 1.5W (300mA) max for writing. The PiDrive was specially designed to powered from a Pi, including reduced starting in-rush current, which is what will rule out many HDDs.

I should point out that all of my network equipment--modem, routers, and switches--are behind UPSes, so just because your Pi project is to make a router is a not reason to omit proper power protection.
Very good information. I didn't know that exist special hdd drive for raspberry pi. After i will buy a pi i will bother you, if you don't mind, with questions about hdd :)

If it will be an uncontrolled power outage and even if i would have an UPS, i still won't be online. My ISP doesn't have UPS for his DSLAM :)

W. H. Heydt
Posts: 12431
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Automatically turn on after power supply gets off

Sun May 03, 2020 12:04 am

micutu82 wrote:
Sat May 02, 2020 10:01 pm
Very good information. I didn't know that exist special hdd drive for raspberry pi. After i will buy a pi i will bother you, if you don't mind, with questions about hdd :)
For whatever reasons--probably didn't sell enough--WD discontinued the PiDrives.
If it will be an uncontrolled power outage and even if i would have an UPS, i still won't be online. My ISP doesn't have UPS for his DSLAM :)
That seems....unlikely. Or...short sighted. Or...just plain incompetent. If your ISP isn't able or willing to provide emergency backup power for their own equipment, I'd be looking for another ISP...fast.

User avatar
HawaiianPi
Posts: 5711
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Automatically turn on after power supply gets off

Sun May 03, 2020 1:12 am

micutu82 wrote:
Fri May 01, 2020 8:26 pm
Hello,

I have read that a raspberry pi doesn't have a BIOS like a normal computer (Desktop or laptop).
It doesn't have an on-board BIOS. Many of the BIOS functions found on Windows computers are handled in the "boot" partition of a Raspbian SD card. It's a different system, but it's still quite capable and versatile.

micutu82 wrote:
Fri May 01, 2020 8:26 pm
If the power supply gets off and it's come back after , let's say...5-10 minutes, raspberry is starting automatically, without any problem?

At the newer computers in BIOS we have an option to do that, to start again by itself when the power supply is come back

Thank you and sorry for my English
Whenever powered on, a Raspberry Pi computer will always try to boot the system. What it can't do (as far as I know) is not boot after a power interruption (like you can configure in some other BIOS systems).

micutu82 wrote:
Fri May 01, 2020 8:46 pm
But the OS could have problems? if then it's running a process, or maybe SD card may have problems
Can i run the OS from a hdd on USB? (of course with its own power supply)
Whenever the system is powered off without a proper software shutdown you may have problems. This is true even with SSD or HDD. To protect against that you can use an uninterruptible power supply (UPS) or read-only file system. Another option is to net-boot (boot the system from a network resource), which the Pi3 and Pi4 can do.

micutu82 wrote:
Fri May 01, 2020 8:46 pm
From this documentation i understood that i can't boot on raspberry pi 4 from a hdd on USB
Not yet. Netbooting was added first, and they are working on adding USB boot now. In the meantime you can have /boot on an SD card and run the main OS file system from a USB drive (that's what I do with my Pi 4B2).

Network booting will allow you to boot with no SD card, but it will be slower than SD or SD+USB booting. You could combine both by starting a cardless boot from the network, then running the OS from an SSD (haven't tried that yet, but it should be possible).

micutu82 wrote:
Sat May 02, 2020 10:01 pm
If it will be an uncontrolled power outage and even if i would have an UPS, i still won't be online. My ISP doesn't have UPS for his DSLAM :)
If your ISP supplied modem+router was connected to a UPS along with your computer, I bet it would work. In my experience both the Internet and phones continue to work (at least for awhile).


Raspberry Pi 3B, 3B+ and 4B models can usually run a single 2.5 inch HDD or dual SSD from their USB ports using only the official power supply. Of course that depends on the drives (some are more power hungry than others), but I have a few 3B/3B+ models running off of SSD, and I have tested the Pi 4B with dual SSD (/boot on SD card with main OS on top SSD and /home on bottom SSD). It worked fine, not only with the official 3A power supply, but even with the older 2.5A micro-USB PSU with a USB-C adapter.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

micutu82
Posts: 16
Joined: Sat Apr 18, 2020 1:40 pm

Re: Automatically turn on after power supply gets off

Mon May 04, 2020 10:09 am

HawaiianPi wrote:
Sun May 03, 2020 1:12 am

Whenever powered on, a Raspberry Pi computer will always try to boot the system. What it can't do (as far as I know) is not boot after a power interruption (like you can configure in some other BIOS system
So, if i understood ok, i can't use it as a router without an UPS. After a power outage, it will not boot, it will not start by itself

wildfire
Posts: 606
Joined: Sat Sep 03, 2016 10:39 am
Location: Dundee, Scotland

Re: Automatically turn on after power supply gets off

Mon May 04, 2020 11:21 am

micutu82 wrote:
Mon May 04, 2020 10:09 am
HawaiianPi wrote:
Sun May 03, 2020 1:12 am

Whenever powered on, a Raspberry Pi computer will always try to boot the system. What it can't do (as far as I know) is not boot after a power interruption (like you can configure in some other BIOS system
So, if i understood ok, i can't use it as a router without an UPS. After a power outage, it will not boot, it will not start by itself
The opposite, you can't set the Pi to NOT boot when power is restored after a power failure*, whether the attempt to boot is successful or not depends on the state of boot media and/or file system.

*It's likely this is possible but would require additional hardware.
E8 85 A2 64 C9 64 81 94 64 81 95 64 89 84 89 96 A3
Still NF Shirls

User avatar
HawaiianPi
Posts: 5711
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Automatically turn on after power supply gets off

Mon May 04, 2020 11:59 am

micutu82 wrote:
Mon May 04, 2020 10:09 am
So, if i understood ok, i can't use it as a router without an UPS. After a power outage, it will not boot, it will not start by itself
It will always try to boot, and more often than not it will succeed. If your power doesn't go out often, you might be okay.

However, corrupting the file system is always a possibility when power is interrupted without a proper shutdown. To avoid that you either need a more robust file system (read-only or RAM based), or you need to prevent unscheduled power interruptions (UPS).

A read-only file system is never written to in normal operation, so it won't get corrupted, but as you might have guessed by now, if you want to save data or update the OS it complicates things (it can be done, just not as easily as with a read-write OS). On Pi computers configuring just the boot partition for read-only helps protect the system, while still allowing some data manipulation.

RAM based OS is a similar concept, except in this case the entire OS loads into and runs from RAM, so every reboot is a fresh start. Tiny Core Linux is such an OS, and they have a version for the Pi (although I'm not sure if they have Pi4 support yet).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

micutu82
Posts: 16
Joined: Sat Apr 18, 2020 1:40 pm

Re: Automatically turn on after power supply gets off

Mon May 04, 2020 12:43 pm

HawaiianPi wrote:
Mon May 04, 2020 11:59 am
micutu82 wrote:
Mon May 04, 2020 10:09 am
So, if i understood ok, i can't use it as a router without an UPS. After a power outage, it will not boot, it will not start by itself
It will always try to boot, and more often than not it will succeed. If your power doesn't go out often, you might be okay.

However, corrupting the file system is always a possibility when power is interrupted without a proper shutdown. To avoid that you either need a more robust file system (read-only or RAM based), or you need to prevent unscheduled power interruptions (UPS).

A read-only file system is never written to in normal operation, so it won't get corrupted, but as you might have guessed by now, if you want to save data or update the OS it complicates things (it can be done, just not as easily as with a read-write OS). On Pi computers configuring just the boot partition for read-only helps protect the system, while still allowing some data manipulation.

RAM based OS is a similar concept, except in this case the entire OS loads into and runs from RAM, so every reboot is a fresh start. Tiny Core Linux is such an OS, and they have a version for the Pi (although I'm not sure if they have Pi4 support yet).
Thank you very much for your fast answer and for clarification. I don't know linux so well, so the easiest way is to buy an UPS :). Expensive hobby :)

fruitoftheloom
Posts: 23132
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Automatically turn on after power supply gets off

Mon May 04, 2020 1:54 pm

micutu82 wrote:
Mon May 04, 2020 12:43 pm
HawaiianPi wrote:
Mon May 04, 2020 11:59 am
micutu82 wrote:
Mon May 04, 2020 10:09 am
So, if i understood ok, i can't use it as a router without an UPS. After a power outage, it will not boot, it will not start by itself
It will always try to boot, and more often than not it will succeed. If your power doesn't go out often, you might be okay.

However, corrupting the file system is always a possibility when power is interrupted without a proper shutdown. To avoid that you either need a more robust file system (read-only or RAM based), or you need to prevent unscheduled power interruptions (UPS).

A read-only file system is never written to in normal operation, so it won't get corrupted, but as you might have guessed by now, if you want to save data or update the OS it complicates things (it can be done, just not as easily as with a read-write OS). On Pi computers configuring just the boot partition for read-only helps protect the system, while still allowing some data manipulation.

RAM based OS is a similar concept, except in this case the entire OS loads into and runs from RAM, so every reboot is a fresh start. Tiny Core Linux is such an OS, and they have a version for the Pi (although I'm not sure if they have Pi4 support yet).
Thank you very much for your fast answer and for clarification. I don't know linux so well, so the easiest way is to buy an UPS :). Expensive hobby :)

How can you infer that the Raspberry Pi is costing money, when your issue is with your Electricity Provider :?


https://uk.pi-supply.com/products/pi-up ... spberry-pi
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

micutu82
Posts: 16
Joined: Sat Apr 18, 2020 1:40 pm

Re: Automatically turn on after power supply gets off

Mon May 04, 2020 2:04 pm

It was a joke :) i forgot to put the quotes

Abnormalized
Posts: 1
Joined: Wed Apr 22, 2020 12:47 am

Re: Automatically turn on after power supply gets off

Mon May 04, 2020 7:29 pm

If the power supply gets off and it's come back after , let's say...5-10 minutes.
I wonder what the power supply's mother thinks ( ͡• ͜ʖ ͡• )



But yes, the Pi turns on when it receives power. You can buy little switches on the usb-c cable that allow you to leave the cord plugged in without the Pi receiving power. Though I would still unplug it if you are gonna access the GPIO pins.

Return to “Beginners”