6 ms·
Maybe they can tackle the long-lived, widely-experienced SD card corruption issues of the RPi in the next version instead of adding a bunch more pins and an ext
by chisleu 12y ago
Maybe they can tackle the long-lived, widely-experienced SD card corruption issues of the RPi in the next version instead of adding a bunch more pins and an extra core.
Meanwhile the competition even has eMMC in the same price range.
- tdicola 12y agoThis comes up with every Pi post on HN for some reason, but if you're getting SD card corruption you either have a bad card (check the known good cards: http://elinux.org/RPi_SD_cards http://elinux.org/RPi_SD_cards ) or are not shutting the Pi down correctly. You absolutely cannot just pull the power cord out while booted up because the SD card might be in the process of writing and you'll easily corrupt it. Make sure you always run 'sudo shutdown -h now' or something similar before powering down the Pi. I power up and down Pi's almost every day and have never corrupted an SD card.
- UweSchmidt 12y agoHaven't had too many corrupted SD cards yet and a good process to recover (set up everything on a 4GB SD card, save the image on the PC using Win32diskimager, write image on 8GB SD cards using SDFormatter as needed (as SD cards vary in actual capacity and if you're a few bytes short your image won't fit, so just use a bigger one)). However, it seems that crashes are inevitable if you do hobbyist stuff with your RPis. Plug in funny things into your GPIO or USBs and run your own buggy code and you can't always shut it down properly.
- fudged71 12y ago>You absolutely cannot just pull the power cord out while booted up because the SD card might be in the process of writing and you'll easily corrupt it. False. This depends on the software. We developed a system for the PrintToPeer Raspberry Pi OS that uses the RAMdisk for read/write operations, and makes the rest of the operating system read only. You can uplug it whenever and nothing is corrupted.
- tdicola 12y agoSure, but 99% of Pi users are going to use the default Raspbian OS and won't have the luxury of a ramdisk and read-only filesystem.
- chisleu 12y agoThis comes up every time someone mentions the corruption. We don't power off our many pis, but they are on UPSs (we use them for a security system.) However, the corruption happens so much that we keep disk images and have a spare on hand when we have to reboot them for any reason because 1/4 of the time they will not boot up. Even if it were corrupting the FILES being written when hard booted, it shouldn't corrupt the FILESYSTEM being written. TLDR, nuh uh.
- tdicola 12y ago> Even if it were corrupting the FILES being written when hard booted, it shouldn't corrupt the FILESYSTEM being written. That's not how SD cards work unfortunately. When an SD card erases data, like if it's updating a file allocation table, it has to erase an entire block of flash and not just the bytes you care about. The card will throw the block into a cache in memory, erase the block, and then rewrite the parts of the block that weren't erased. However if you pull out power during that operation you'll completely kill the block and destroy the filesystem. There's a great video here from Linuxconf Auckland about using SD cards for embedded systems and these issues: https://www.youtube.com/watch?v=K3zb6p0thQU https://www.youtube.com/watch?v=K3zb6p0thQU
- mark-r 12y agoI wish we had a filesystem that was tuned to the peculiarities of flash memory. It should be aware of the large erase blocks and optimize for that.
- zurn 12y agoThere's no inherent reason SD cards have to be like this, more sophisticated SSDs are designed to stay readable after power loss. But most SD cards are cheap and nasty so they don't.
- chisleu 12y agoI get that, but I don't get how that applies to the corruption we are seeing. We aren't having power fail issues.
- 12y ago
- mindslight 12y agoA possible third reason is a poor connection to the SD card. I was recently using an SD card that was quite flimsy (presumably it was only designed to work when it was also held from the back, which the RPi SD connector does not do). Even when it manged to boot, soon after the card would flex back and the device would go missing. I switched to a micro SD card in a much stiffer adapter (what I had laying around), and then ordered a smaller microsd adapter (http://www.ebay.com/itm/271679029684 http://www.ebay.com/itm/271679029684) so the thing doesn't even stick out, which will keep it from getting knocked around.