Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: DateTime throwing an error

by nachtmsk (Acolyte)
on Apr 16, 2021 at 11:33 UTC ( [id://11131364]=note: print w/replies, xml ) Need Help??


in reply to Re^3: DateTime throwing an error
in thread DateTime throwing an error

Yeah, will do.

I should have mentioned: this is part of a security application I wrote to run on a series of Raspberry Pi's. They each take a picture in a certain area and move it over to the main Pi which processes the images into a DB and finally into a simple web page which this Pi hosts.

The "hard drive" of this Pi is actually a micro SD card. So no Raid or anything fancy.

Replies are listed 'Best First'.
Re^5: DateTime throwing an error
by haukex (Archbishop) on Apr 16, 2021 at 11:45 UTC
    The "hard drive" of this Pi is actually a micro SD card.

    Any flash memory of course has a limited number of write cycles, and since a Linux system is constantly writing log files etc. to the disk, and you say you're regularly writing image files to the disk, two years isn't an unreasonable time for the SD card to start failing if the system was in operation the whole time. I'm also not sure how widespread Wear leveling currently is on SD cards.

    But what I really don't understand is how that file from 2019 (With.pm) was changed but the filetimestamp didn't change. Maybe a corruption doesn't always trigger a timestamp update?

    Physical damage to the storage medium (or corruption of the flash cells) wouldn't be reflected in the file's timestamp. However, I can almost guarantee you that this wasn't the only file affected. I'd strongly recommend replacing the SD card ASAP. Recently there are also new "endurance" SD cards (e.g. from SanDisk, Samsung, and Transcend) that promise to have higher write endurances.

      I'm also not sure how widespread Wear leveling currently is on SD cards.

      Wear leveling is one of the few differences between an SD card and simple SPI flash (and of course, the SD-interface).

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
      Hi,

      I built the Pi this past January, it's been running since then. The 2019 Timestamp on the Module file was (I assume) the most recent version of that particular file at the time of install. I installed the Module this past January through Cpan. But I agree about your suggestion in replacing the SD card with something more robust.

      This just started as a fun project to monitor my property with some Pi's I had laying around the the house.

      I'm wondering if the Pi can run off of an external drive enclosure in a mirrored array. I need to check on that.

      Thanks very much,

      Mike

        this past January, it's been running since then. [...] But I agree about your suggestion in replacing the SD card with something more robust.

        Consider making some changes: Log only to RAM (i.e. mount a tmpfs for /var/log and some other places), keep the SD-Card mounted read-only, or - if you have the memory - put everything you need into an initramfs and don't mount the SD-Card at all. If you want to keep the logs, copy them once per day or at shutdown to the SD-Card. Logging to another system (e.g. using rsyslog) could also be an option. Also, just using the noatime or relatime mount options (see Re^4: Analyzing Files Within a Directory) could help a little bit.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        I built the Pi this past January, it's been running since then.

        Ah, well it could also be an early failure (Bathtub curve), especially if it's a cheap noname SD card.

        I'm wondering if the Pi can run off of an external drive enclosure in a mirrored array. I need to check on that.

        Several models do support USB mass storage boot. I run several RPis off of SD cards and they've been running fine so far; it really depends on how much you wear out the flash memory.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11131364]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-03-28 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found