MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    dead SD-card every aprox. 6 months

    Scheduled Pinned Locked Moved Hardware
    19 Posts 10 Posters 9.2k Views 12 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      marvin424 Project Sponsor
      last edited by

      Hi Zdeněk,
      SD cards have limited write cycles so it’s just a question of time when your pi will not start.

      To increase their life, all manufactures have implemented an internal algorithm which uses different physical sectors when writing data to the SD-Card, see wear leveling.

      You can help your hardware if you “oversize” the SD-Card, avoid ram discs and swap partitions.
      I am using a 16GB SD-Card even though just 4GB is used by the system. It’s running now for more than 4 years without any trouble.

      Brgds, Michael…

      zdenekZ 1 Reply Last reply Reply Quote 0
      • zdenekZ Offline
        zdenek @marvin424
        last edited by

        @marvin424 that’s really weird. I’m also using 16 cards, in both my mirrors (one is for testing) a in both I’ve had to replace card in about 6 months max. Maybe I’m using to many modules, maybe there is al lot of writes on card… I’ll try SSD

        1 Reply Last reply Reply Quote 0
        • A Offline
          almliden
          last edited by

          I know this is an old thread, but hope someone finds this helpful.

          1. Use a proper power source, one reason for SD-cards to wear out fast is that the RPi doesn’t receive enough power to actually perform the writes and therefore writes bad data which corrupts the card. Depending on which model it is it might need more power. Since I switched to better power supplies I haven’t had a dead SD-card for quite a while, so it seem to have an impact.

          2. Use RPi-images that writes to /tmpfs, or configure them to write temporary data to RAM to reduce wear on the SD-card.

          3. Since it hasn’t been mentioned before in this thread, avoid powering off the device by removing power since this could cancel an ongoing write which potentially could corrupt the card. If you need to power it off, do it properly.

          SergeS 1 Reply Last reply Reply Quote 3
          • SergeS Offline
            Serge @almliden
            last edited by

            @almliden said in dead SD-card every aprox. 6 months:

            Use RPi-images that writes to /tmpfs, or configure them to write temporary data to RAM to reduce wear on the SD-card.

            How to do that?

            MoreLinuxM 1 Reply Last reply Reply Quote 0
            • MoreLinuxM Offline
              MoreLinux @Serge
              last edited by MoreLinux

              @Serge said in dead SD-card every aprox. 6 months:

              @almliden said in dead SD-card every aprox. 6 months:

              Use RPi-images that writes to /tmpfs, or configure them to write temporary data to RAM to reduce wear on the SD-card.

              How to do that?

              As root user, edit the file /etc/fstab and add the following lines:

              tmpfs    /tmp    tmpfs    defaults,noatime,nosuid,size=100m    0 0
              tmpfs    /var/tmp    tmpfs    defaults,noatime,nosuid,size=30m    0 0
              tmpfs    /var/log    tmpfs    defaults,noatime,nosuid,mode=0755,size=100m    0 0
              tmpfs    /var/run    tmpfs    defaults,noatime,nosuid,mode=0755,size=2m    0 0
              tmpfs    /var/spool/mqueue    tmpfs    defaults,noatime,nosuid,mode=0700,gid=12,size=30m    0 0
              
              

              Now most of the write intensive files write to the Raspberry PI’s ram.

              Disable the swap file, as it can be write intensive too. First check if you have swap activated with the command:

              free -h
              

              If your total swap is 0B, you are good, if not, execute the following commands:

              dphys-swapfile swapoff
              dphys-swapfile uninstall
              systemctl disable dphys-swapfile
              

              Now the command activated with the command:

              free -h
              

              should tell you that you are not using the swap file anymore.

              P 2 Replies Last reply Reply Quote 0
              • S Offline
                sdetweil
                last edited by

                i switched to using a small ssd USB stick, boot from the sd card, run from the usb stick… all the i/o goes to the ssd

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • BKeyportB Offline
                  BKeyport Module Developer
                  last edited by

                  can you explain how to do this, or provide a link to an explaination?

                  The "E" in "Javascript" stands for "Easy"

                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    sdetweil @BKeyport
                    last edited by sdetweil

                    https://www.tomshardware.com/news/boot-raspberry-pi-from-usb,39782.html

                    really easy, copy all the data from sd to ssd, then change one line in sd config, reboot… voila

                    on one machine I had trouble with regularly, I had a 500gb ssd drive I wasn’t using…
                    for my main dev machine, I just bought a 128gig usb stick ssd. came with a cable, took 20 minutes to copy the data…spent $35 from amazon

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    S 1 Reply Last reply Reply Quote 0
                    • S Offline
                      sdetweil @sdetweil
                      last edited by

                      @BKeyport I am NOT trying to BOOT from the usb stick, most pi’s don’t support that

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • BKeyportB Offline
                        BKeyport Module Developer
                        last edited by

                        Speak of the evil, the evil happens. Blew up my SD card.

                        The "E" in "Javascript" stands for "Easy"

                        S 1 Reply Last reply Reply Quote 0
                        • S Offline
                          sdetweil @BKeyport
                          last edited by

                          @BKeyport boooooo

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

                          1 Reply Last reply Reply Quote 1
                          • P Offline
                            PHAGE.GOV @MoreLinux
                            last edited by

                            @MoreLinux so how do you edit this text file using root?

                            1 Reply Last reply Reply Quote 0
                            • P Offline
                              PHAGE.GOV @MoreLinux
                              last edited by

                              @MoreLinux said in dead SD-card every aprox. 6 months:

                              tmpfs /tmp tmpfs defaults,noatime,nosuid,size=100m 0 0
                              tmpfs /var/tmp tmpfs defaults,noatime,nosuid,size=30m 0 0
                              tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=100m 0 0
                              tmpfs /var/run tmpfs defaults,noatime,nosuid,mode=0755,size=2m 0 0
                              tmpfs /var/spool/mqueue tmpfs defaults,noatime,nosuid,mode=0700,gid=12,size=30m 0 0

                              could you potentilally give a more in-depth guide to doing this?

                              S 1 Reply Last reply Reply Quote 0
                              • S Offline
                                sdetweil @PHAGE.GOV
                                last edited by

                                @PHAGE-GOV edit the file as root

                                if u are not root, then u must use the sudo prefix on a command

                                commands to edit on linux are vi, nano and (too many) others…

                                I use nano

                                SO its

                                sudo nano /etc/fstab
                                

                                has nothing to do with MM, just basic linux skills.

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                1 Reply Last reply Reply Quote 0

                                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                With your input, this post could be even better 💗

                                Register Login
                                • 1 / 1
                                • First post
                                  Last post
                                Enjoying MagicMirror? Please consider a donation!
                                MagicMirror created by Michael Teeuw.
                                Forum managed by Sam, technical setup by Karsten.
                                This forum is using NodeBB as its core | Contributors
                                Contact | Privacy Policy