power outage tolerance

Ask questions about Arch Linux ARM. Please search before making a new topic.

power outage tolerance

Postby Socaltom » Wed Jan 23, 2013 6:02 am

I'm setting up a Pogoplug V2 to act as a webcam/security cam server at my 75 yr old Dad's house. Everytime his internet goes down he unplugs the pogo and the rootfs has to go through an FSCK before it will boot again. What can I do to make the system more fault tolerant?

Options I'm considering
1) fstab data= journal,noadirtime, noatime ( more conservative journaling, and less writing by removing the access time changes)

2) should I try adding sync ( to disable write caching on the rootfs partition)

3) What happens if I set /dev/sda1 to read only?
Tom
used to be owned by me
Pink Pogo V2, Black Pogo V3, Zyxel NAS 325 v1,
used to be Adminstrator for
Goflex net, Black V3, Black V2
Now I have a couple of raspberry pi ( 3+ and 4)
Socaltom
 
Posts: 571
Joined: Thu Apr 07, 2011 2:21 pm
Location: The left side

Re: power outage tolerance

Postby moonman » Wed Jan 23, 2013 7:43 am

1. Is it on a flash drive or hdd? With hdd you can use ext3 or even better - ext2 partition with the kernel (/boot) + ext4 with the system with better performance. noatime implies nodiratime so no need to specify both.

2. You may suffer from bad performance. I suppose you can try and tell us how bad/maybe not bad it is.

3. It should work as long as it isn't your first boot. You may run in trouble in the long run though (errors trying to write logs or some daemons create files needed at runtime which won't be possible thus daemons failing to start). In this case you may want to redirect things to tmp as by defaults it is in ram.

Also if you create uinitrd it will do fsck at boot if something is wrong.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: power outage tolerance

Postby Socaltom » Thu Jan 24, 2013 3:35 am

$this->bbcode_second_pass_quote('moonman', '1'). Is it on a flash drive or hdd? With hdd you can use ext3 or even better - ext2 partition with the kernel (/boot) + ext4 with the system with better performance. noatime implies nodiratime so no need to specify both.

2. You may suffer from bad performance. I suppose you can try and tell us how bad/maybe not bad it is.

3. It should work as long as it isn't your first boot. You may run in trouble in the long run though (errors trying to write logs or some daemons create files needed at runtime which won't be possible thus daemons failing to start). In this case you may want to redirect things to tmp as by defaults it is in ram.

Also if you create uinitrd it will do fsck at boot if something is wrong.


It's an Hdd, I have 2 partitions, sda1 is the rootfs sda2 is. Mounted as /home

What is th unitrd?
used to be owned by me
Pink Pogo V2, Black Pogo V3, Zyxel NAS 325 v1,
used to be Adminstrator for
Goflex net, Black V3, Black V2
Now I have a couple of raspberry pi ( 3+ and 4)
Socaltom
 
Posts: 571
Joined: Thu Apr 07, 2011 2:21 pm
Location: The left side

Re: power outage tolerance

Postby moonman » Thu Jan 24, 2013 3:58 am

Hdd is good.

1. The simplest is to use ext3 fs.
2. Use ext2/3 boot partition + ext4 system partition. since boot partition is never touched except for kernel updates it won't get corrupted - ext4 is faster but this is not as trivial as the installation guide. I think hydro made a guide, but I don't think it's complete.
3. Make uInitrd with either of the previous 2 options for fsck. uInitrd is basically initrd for uboot.

Journaled filesystems are better in terms or reliability and corruption.

http://en.wikipedia.org/wiki/Initrd
https://wiki.archlinux.org/index.php/Mkinitcpio

Or you can use this one that I created: http://www.mediafire.com/file/e6mwdz6bw3nxmjj/uInitrd
It's kernel independent and comes with fsck
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: power outage tolerance

Postby silentcreek » Fri Jan 25, 2013 1:20 pm

What do you mean by "internet going down"? Irregular failures by the provider or does his router/modem turn off regularly (e.g. at night)?

If the outages would be regular you could easily handle this with a time switch and cron. That's what I do with my Pogov3. I have a time switch that turns off at 11pm. I have a cron job set to shutdown the system at 10:55pm. So the system goes down in order before being turned off. When the time switch turns on again, the system will boot without any problems. And your dad wouldn't need to do anything.

If the outages would be irregular, you could still have a cron job that checks your internet connection regularly (e.g. every 5mins) and if the internet connection is down the script will shutdown the system. If you choose the interval short enough, shutdown will be invoked before your dad pulls the plug. However, the downside is, if the internet connection is lost and your dad doesn't pull the plug, the pogo won't work again until he forecefully restarts it (by pulling the plug and plugging it in again).

Timo
silentcreek
 
Posts: 21
Joined: Mon Jan 07, 2013 8:38 pm

Re: power outage tolerance

Postby Socaltom » Fri Jan 25, 2013 2:04 pm

$this->bbcode_second_pass_quote('silentcreek', 'W')hat do you mean by "internet going down"? Irregular failures by the provider or does his router/modem turn off regularly (e.g. at night)?


If the outages would be regular you could easily handle this with a time switch and cron. That's what I do with my Pogov3. I have a time switch that turns off at 11pm. I have a cron job set to shutdown the system at 10:55pm. So the system goes down in order before being turned off. When the time switch turns on again, the system will boot without any problems. And your dad wouldn't need to do anything.

If the outages would be irregular, you could still have a cron job that checks your internet connection regularly (e.g. every 5mins) and if the internet connection is down the script will shutdown the system. If you choose the interval short enough, shutdown will be invoked before your dad pulls the plug. However, the downside is, if the internet connection is lost and your dad doesn't pull the plug, the pogo won't work again until he forecefully restarts it (by pulling the plug and plugging it in again). :roll: posting.php?mode=quote&f=9&p=27289#

Timo


I hear what you are saying, but those solutions won't work in this case, for reasons I won't go into publicly. :roll:
Tom
used to be owned by me
Pink Pogo V2, Black Pogo V3, Zyxel NAS 325 v1,
used to be Adminstrator for
Goflex net, Black V3, Black V2
Now I have a couple of raspberry pi ( 3+ and 4)
Socaltom
 
Posts: 571
Joined: Thu Apr 07, 2011 2:21 pm
Location: The left side

Re: power outage tolerance

Postby Socaltom » Fri Jan 25, 2013 2:12 pm

$this->bbcode_second_pass_quote('moonman', 'H')dd is good.

1. The simplest is to use ext3 fs.

I' m am using ext3. The curious part is that I recently set up another plug the same way. The first one was unplugged without proper shutdown on numerous occasion and never failed to boot after. This plug can't tolerate a single bad power off. I have to fsck using a backup on a thumb drive in order to get the hdd booting again.


$this->bbcode_second_pass_quote('moonman', '
')3. Make uInitrd with either of the previous 2 options for fsck. uInitrd is basically initrd for uboot.

Is it correct to state that with uInitrd, the system boots to ram, then it would fsck the drive, then boot the drive?

Assuming I use the version you created, how do I implement this?
used to be owned by me
Pink Pogo V2, Black Pogo V3, Zyxel NAS 325 v1,
used to be Adminstrator for
Goflex net, Black V3, Black V2
Now I have a couple of raspberry pi ( 3+ and 4)
Socaltom
 
Posts: 571
Joined: Thu Apr 07, 2011 2:21 pm
Location: The left side
Top

Re: power outage tolerance

Postby moonman » Sun Jan 27, 2013 8:58 pm

https://wiki.archlinux.org/index.php/Fsck

Add partitions to fstab and place initrd with your kernel under/boot
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: power outage tolerance

Postby permitivity » Mon Feb 18, 2013 3:17 am

Hello,
Sorry to hijack your thread. I've been looking for a guide on installing a USB webcam (Logitech C310) onto a pogoplug, and running a web page off the pogoplug to display webcam images at some refresh rate (1 per 5 seconds).

Can you share how you installed the USB webcam on your pogoplug?

Thanks.
permitivity
 
Posts: 141
Joined: Mon Feb 18, 2013 3:08 am

Re: power outage tolerance

Postby Socaltom » Mon Feb 18, 2013 4:40 am

I'm using motion to collect and stream the images. then I just put them on a very simple webpage I created with MS word. One page has the most recent image which is updated every 10 minutes ( but can be as often as you would like). I use lighttp to host the webpages. Then another page streams the live camera at up to 30 fps ( I usually keep it at about 4)
Tom
used to be owned by me
Pink Pogo V2, Black Pogo V3, Zyxel NAS 325 v1,
used to be Adminstrator for
Goflex net, Black V3, Black V2
Now I have a couple of raspberry pi ( 3+ and 4)
Socaltom
 
Posts: 571
Joined: Thu Apr 07, 2011 2:21 pm
Location: The left side


Return to User Questions

Who is online

Users browsing this forum: No registered users and 3 guests