Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^5: DateTime throwing an error

by haukex (Bishop)
on Apr 16, 2021 at 11:45 UTC ( #11131365=note: print w/replies, xml ) Need Help??


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

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.

Replies are listed 'Best First'.
Re^6: DateTime throwing an error
by afoken (Canon) on Apr 16, 2021 at 13:55 UTC
    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". ;-)
Re^6: DateTime throwing an error
by nachtmsk (Acolyte) on Apr 16, 2021 at 12:37 UTC
    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
Node Status?
node history
Node Type: note [id://11131365]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2021-05-13 19:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (142 votes). Check out past polls.

    Notices?