doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Power Outages?

Wed May 29, 2013 12:58 pm

Hi all! I just ordered three new RasPi units last night -- looking forward to this. Anyway...

What does the Pi do after a power outage?

1) Does it automatically boot up when it gets power again as long as it's still plugged in?
2) And what about the drive(s)? It didn't get a chance to dismount it (them).
3) If it was in the process of writing a file, does that mean the file (hopefully not more) is corrupt?

User avatar
rpdom
Posts: 17174
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Power Outages?

Wed May 29, 2013 1:33 pm

doni49 wrote:What does the Pi do after a power outage?

1) Does it automatically boot up when it gets power again as long as it's still plugged in?
Yes.
2) And what about the drive(s)? It didn't get a chance to dismount it (them).
3) If it was in the process of writing a file, does that mean the file (hopefully not more) is corrupt?
The SD card can occasionally be seriously corrupted if powered off during a write operation.

The Pi's OS will try to recover the file system when it boots up. The majority of the time it will be successful, but data that was being written at the time may be lost.

Backups are good. :)

Hard disks are less prone to corruption due to unexpected power loss, although they may still lose data they are unlikely to become unusable. I use a USB connected hard disk on my most heavily used Pi.

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: Power Outages?

Wed May 29, 2013 5:00 pm

The SD card can occasionally be seriously corrupted if powered off during a write operation.
I don't plan to write to the SD card -- UNLESS of course if Raspian does. I will be connecting a USB hard drives for data storage.

P.S. you noted that "Backups are good". Two of these units will be part of my backup solution.

I'm setting up one as a NAS at home and also as an SSH server. Another will be a NAS server at my office. I want to have the office NAS open a connection to the Home NAS by way of a Cron entry and do an RSYNC to make the two of them the same. That way I have a redundant backup at the office should something happen at home.

User avatar
rpdom
Posts: 17174
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Power Outages?

Wed May 29, 2013 5:29 pm

doni49 wrote:I don't plan to write to the SD card -- UNLESS of course if Raspian does. I will be connecting a USB hard drives for data storage.
By default the main Raspbian filesystem is on the second partition on the SD card. It is not to hard to change that to be on the first hard disk instead.

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: Power Outages?

Wed May 29, 2013 5:51 pm

rpdom wrote:By default the main Raspbian filesystem is on the second partition on the SD card. It is not to hard to change that to be on the first hard disk instead.
What would I do that for? What are the pros and cons?

User avatar
rpdom
Posts: 17174
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Power Outages?

Wed May 29, 2013 6:26 pm

Well, Raspbian does lots of writes to its root file system. If that is on the SD card it can be at risk of errors from power failure.

As I said above
rpdom wrote:Hard disks are less prone to corruption due to unexpected power loss, although they may still lose data they are unlikely to become unusable. I use a USB connected hard disk on my most heavily used Pi.
Which means that it is quite a bit less likely to suffer from major failures from power outages.

The disadvantage is that it will use a bit more power and won't be silent.

Return to “Beginners”