Power fail corrupts mounted drives

  • Hello, any suggestions how to prevent corruption when the power fails?

    I've just replaced my kodi 18 with an ext3 drive with a kodi 20 using an NTFS drive. NTFS was supposed to be less susceptible, but that's not what I've seen so far.

    Since 99.9% of the time I am reading from a static file system can I turn off write caching?

    (before you suggest it I bought a UPS. I'm hoping to get NUT compiled on it so the UPS can shut down the RPI3 when the power fails).

    Thanks

  • Hello, any suggestions how to prevent corruption when the power fails?

    Disabling the write cache helps. Mounting read-only helps. Using EXT4 or perhaps BTRFS (with more advanced journaling) instead of NTFS also probably helps. Using hardware RAID helps. We do not support software RAID; there are too many variants and tools and we prefer to avoid the bloat incurred. No filesystem is corruption proof so if you truly want to prevent corruption, prevent the loss of power (Yes, get a UPS).

  • udev rules; you'll need to place a modified version of the default mount rules in /storage/.config/udev.rules.d that detects your drive and then applies different config to it, and reboot for it to be overlaid (and thus overwrite) the default file.

  • I had similar problems. In my case started with NTFS but was told Ext4 would be better. With NTFS I occasionally had to physically connect the drive to a Windows PC to sort out problems. With Ext4 plug into my Linux machine. Then some kind person gave me this

    the code to check Ext4 disk on boot:

    Code: /storage/.config/system.d/[email protected]/fsck.conf

    Code
    [Service]
    ExecStartPre=-/usr/sbin/fsck -T -M -p -t ext4 %I