LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 03-13-2016, 05:49 AM   #1
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Rep: Reputation: Disabled
Raspberry PI, SlackwareARM, fs integrity and power outages


I have been running a Raspberry PI model B (1st version) with SlackwareARM-14.1 installed according to Exaga's guide.

I have experienced not so rare power outages. By that I mean "mains power" and a few times brownout on the PI due to high current consumption by a USB-WiFi dongle.

Even with the standard FS checks done at startup, after several weeks I experienced more and more FS corruption after several outages.
I checked the card (badblocks), no errors reported.
The SDCARD is a class 10 Sandisk from the RPI compatibility list.

The FS got so badly damaged that after manually answering about a hundred items for fsck, I gave up and rewrote the card from a backup image.
Then I tried a Verbatim card (also on the list). Same results over time.

I know SDCARDs work internally quite different from HDDs, one such difference being in internal block size, reading, erasing a block before, then writing it back (large blocks even for a single bit change).

Has anyone encountered such corruption after power outages?

Are there optimizations that can help reduce or eliminate the chances for such corruptions?

Such as:
- using fdisk to align partitions to certain boundaries?
- using mkfs.ext4 and tune2fs to set special FS parameters regarding alignments and special FS options regarding it running of a flash memory rather then hdd?
- installing on several partitions:
* /boot (ro)
* / (ro)
* /home (rw)
* /var (rw)
maybe /etc ? (there are several files written to /etc at run time)

I am seeking installation/configuration improvements.
From hardware perspective I know for USB a powered hub would help and that a UPS would help. But these may not always be available.
 
Old 03-13-2016, 06:10 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
I live in a storm afflicted area. Since I put a pi 3 in a week ago it has rebooted at least every day from power drops.
I use ext4 and it has survived without corruption on the restart. Class 10 Sandisk.

I have just ordered a small fanless UPS for the router and pi. You might want to consider likewise.
 
Old 03-13-2016, 08:17 AM   #3
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Original Poster
Rep: Reputation: Disabled
Any advice for the SDCARD specific medium also regarding these:

- disk caching, amount of data cached in memory before commited to disk. How much (to be safe), how much to avoid killing performance due to slow writes

- ext4 delayed writes, as described here:
https://en.wikipedia.org/wiki/Ext4#D...tial_data_loss

- ext4 specific options like:
* block_validity (data integrity gains vs. performance loss)
* discard (does this apply to SDCARDS?)
* nodelalloc (disable delayed allocation described above)
* uninit_bg (reduce e2fsck runtimes, beneficial on the SDCARD and PI?)
* flex_bg and mkfs -G option?
* custom inode size (with reference to SDCARD hardware)
* bigalloc (might help with SDCARD hardware page size?)

My question is now even more general, if any PI and SlackwareARM users have played with such options and with what results.
 
Old 03-14-2016, 06:23 AM   #4
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486
Blog Entries: 4

Rep: Reputation: 282Reputation: 282Reputation: 282
I had a couple corruption issues with my first PI. Some advice I received from the forum here was that USB flash is faster and more reliable than SD/MicroSD. So I started using a small 16 or 32G USB flash for mt /root leaving only the SD as /boot and haven't had an issue since.
 
Old 03-15-2016, 04:21 AM   #5
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Original Poster
Rep: Reputation: Disabled
Question

Quote:
Originally Posted by enine View Post
I had a couple corruption issues with my first PI. Some advice I received from the forum here was that USB flash is faster and more reliable than SD/MicroSD. So I started using a small 16 or 32G USB flash for mt /root leaving only the SD as /boot and haven't had an issue since.
Have you tested using a SDCARD in an USB card reader instead of an USB flash drive?
To see if it has anything to do specifically with SDCARDS, or with the SDCARD interface of the PI?
 
Old 03-15-2016, 10:33 AM   #6
louigi600
Member
 
Registered: Dec 2013
Location: Italy
Distribution: Slackware
Posts: 635
Blog Entries: 20

Rep: Reputation: 81
Once you've verified whether the media is still good or not you might want to give this blog a read.
 
Old 03-15-2016, 03:28 PM   #7
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486
Blog Entries: 4

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by andrixnet View Post
Have you tested using a SDCARD in an USB card reader instead of an USB flash drive?
To see if it has anything to do specifically with SDCARDS, or with the SDCARD interface of the PI?

I have not tested with an sdcard in a usb adapter. I seem to be having issues cloning my sd card, put it and a usb flash drive in my laptop and dd'ed it. I have /boot and /root on the sd and since I dd'ed both to the usb I tried to edit fstab to use /root from the usb it panic'ed.
Code:
fsck seems to think its borked
fsck /dev/sda2
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
The filesystem size (according to the superblock) is 7577600 blocks
The physical size of the device is 7553024 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? yes
I wish they would make these USB boot.

Last edited by enine; 03-15-2016 at 03:29 PM.
 
Old 03-15-2016, 03:47 PM   #8
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
You just have to bolt an ISCSI initiator onto your Raspberry Pi and then it will boot from SAN, like the good Lord intended....

Last edited by dijetlo; 03-15-2016 at 05:31 PM.
 
Old 03-15-2016, 04:12 PM   #9
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dijetlo View Post
You just have to bolt an ISCSI initiator to to your Raspberry Pi and then it will boot from SAN, like the good Lord intended....
Very interesting idea.

Of course, however, having a SAN available for any RPi based project may not always be feasible...
 
Old 03-15-2016, 05:59 PM   #10
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
having a SAN available for any RPi based project may not always be feasible...
Admittedly, though you can make a SAN from an RPi, some cabling, a hub and some USB hard drives (USB2 Hard drives are pretty cheap right now).
Upon Further Consideration:
While a personal SAN is imminently doable as an RPi project and goodness knows everyone would enjoy the hours of pouring over LUN IDs, WWNNs, et al, SAN and SAN zoning entails, that RPi (the one hosting the theoretical SAN)would still have to boot from its on board card so file corruption is still a show stopper.
I might give enines' solution a try.

Last edited by dijetlo; 03-15-2016 at 06:06 PM. Reason: my participle dangled
 
Old 03-16-2016, 02:38 AM   #11
louigi600
Member
 
Registered: Dec 2013
Location: Italy
Distribution: Slackware
Posts: 635
Blog Entries: 20

Rep: Reputation: 81
The problem with the RPis for making NAS is that they don't have Gigabit NICs ... so the NAS performance will be bogged don not only by the USB2 mass storage throughput but also bu the fast Ethernet limited performance. If I remember right there is another limiting factor: the RPi's NIC and the USB ports are all on the same USB bus so they all share the same bandwidth (due to bus access constraints, the effective throughput of the USB2 High Speed signaling rate is limited to 280 Mbit/s or 35 MB/s).

If you're going to make a NAS from a Rpi2/3 it will be sufficient from media streaming but your upload times might be comparable to the play times of the media you deposit on it.

An SBC with Gb Ethernet NIC would be much better suited for making a NAS (plenty of options there) end even more so if it had 2 or more sata ports on-board (not so common unfortunately).
 
Old 03-16-2016, 03:19 AM   #12
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Original Poster
Rep: Reputation: Disabled
@dijetlo: actually my reply was about the idea to already have a SAN and make the RPi boot over the network from it.
 
Old 03-16-2016, 03:20 AM   #13
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Original Poster
Rep: Reputation: Disabled
@louigi600: Regarding the limitations of the RPi for a SAN project, one might consider the Olinuxino Lime 2: Cortex A7 dual core @1GHz, 1GB RAM, native SATA port, 1Gbps ethernet.
 
Old 03-16-2016, 03:41 AM   #14
louigi600
Member
 
Registered: Dec 2013
Location: Italy
Distribution: Slackware
Posts: 635
Blog Entries: 20

Rep: Reputation: 81
Quote:
Originally Posted by andrixnet View Post
@louigi600: Regarding the limitations of the RPi for a SAN project, one might consider the Olinuxino Lime 2: Cortex A7 dual core @1GHz, 1GB RAM, native SATA port, 1Gbps ethernet.
I run my NAS off a Seagate GoFlex NET: not much ram and internal flash but it can boot of the SATA drives and has 2 onboard SATA ports and Gb NIC.

If you can do without redundancy I guess 1 SATA port is good enough .... But loosing 1Tb, or more, of data dew to a disk failure can be a pain in the but even if it's not vital data. I software mirror the 2 SATA drives on my NAS ... so if one fails I can hopefully replace it before I loose the data.
 
Old 03-16-2016, 04:40 AM   #15
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by louigi600 View Post
I run my NAS off a Seagate GoFlex NET: not much ram and internal flash but it can boot of the SATA drives and has 2 onboard SATA ports and Gb NIC.

If you can do without redundancy I guess 1 SATA port is good enough .... But loosing 1Tb, or more, of data dew to a disk failure can be a pain in the but even if it's not vital data. I software mirror the 2 SATA drives on my NAS ... so if one fails I can hopefully replace it before I loose the data.
Is your LIME running SlackwareARM ?

One could, concievably use a SATA port expander, though it is not recommended for RAID (as in if one disk fails, the port on the LIME will go down, but your data will still be safe on the second disk).

Last edited by andrixnet; 03-16-2016 at 04:44 AM. Reason: incomplete
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dealing with power outages. jens General 3 12-20-2014 01:10 PM
Raspberry Pi - xbmc SlackBuild fails (SlackwareARM 14.1) slacksam Slackware - ARM 2 07-28-2014 02:44 PM
[SOLVED] Installing SlackwareARM-14.1 onto a Raspberry Pi doctorwho8 Slackware - ARM 3 12-29-2013 02:43 AM
Slackwarearm on the Raspberry Pi onebuck Linux - Embedded & Single-board computer 0 02-24-2013 08:44 PM
Fault tolerant boot? Power outages? KendersPlace Linux - General 8 07-27-2003 03:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 12:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration