OH3: EXT4-fs (sda2): failed to convert unwritten extents to written extents

  • openHABian 3.3.0 on rPi4 with 4GB

The last two days have seen an error at the same time at 02:03:

Message from syslogd@openhabian at Feb 17 02:03:41 ...
kernel:[5157341.495080] EXT4-fs (sda2):
failed to convert unwritten extents to written extents --
potential data loss!  (inode 30201, error -30)

The file system looks like htis:

df -h
Filesystem                              Size  Used Avail Use% Mounted on
/dev/root                                15G  6.4G  7.4G  47% /
devtmpfs                                1.9G     0  1.9G   0% /dev
tmpfs                                   1.9G     0  1.9G   0% /dev/shm
tmpfs                                   778M  2.5M  776M   1% /run
tmpfs                                   5.0M     0  5.0M   0% /run/lock
/dev/mmcblk0p1                          253M   50M  203M  20% /boot
/dev/zram1                              721M  234M  436M  35% /opt/zram/zram1
overlay1                                721M  234M  436M  35% /var/lib/openhab/persistence
/dev/zram2                              974M   58M  849M   7% /opt/zram/zram2
overlay2                                974M   58M  849M   7% /var/log
192.168.1.6:/volume1/backup/openhabian  3.5T   11G  3.5T   1% /media/SynologyBackup
/dev/sda3                                14G   28K   14G   1% /storage
tmpfs                                   389M     0  389M   0% /run/user/1000

dmesg shows this:

dmesg -T | grep -i EXT4
[Fri Feb 17 02:04:22 2023] EXT4-fs (sda2): warning: mounting fs with errors, running e2fsck is recommended
[Fri Feb 17 02:04:22 2023] EXT4-fs (sda2): recovery complete
[Fri Feb 17 02:04:22 2023] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[Fri Feb 17 02:05:00 2023] EXT4-fs warning (device sda2): ext4_end_bio:348: I/O error 10 writing to inode 30201 starting block 595956)
[Fri Feb 17 02:05:00 2023] EXT4-fs error (device sda2): ext4_journal_check_start:83: comm rsync: Detected aborted journal
[Fri Feb 17 02:05:00 2023] EXT4-fs error (device sda2): ext4_journal_check_start:83: comm kworker/u8:0: Detected aborted journal
[Fri Feb 17 02:05:00 2023] EXT4-fs (sda2): I/O error while writing superblock
[Fri Feb 17 02:05:00 2023] EXT4-fs (sda2): previous I/O error to superblock detected
[Fri Feb 17 02:05:00 2023] EXT4-fs (sda2): Remounting filesystem read-only
[Fri Feb 17 02:05:00 2023] EXT4-fs (sda2): I/O error while writing superblock
[Fri Feb 17 02:05:00 2023] EXT4-fs (sda2): failed to convert unwritten extents to written extents -- potential data loss!  (inode 30201, error -30)
[Fri Feb 17 02:05:01 2023] EXT4-fs warning (device sda2): htree_dirblock_to_tree:1072: inode #42231: lblock 0: comm rsync: error -5 reading directory block
[Fri Feb 17 02:05:01 2023] EXT4-fs error (device sda2): __ext4_find_entry:1665: inode #42232: comm rsync: reading directory lblock 0
[Fri Feb 17 02:05:01 2023] EXT4-fs (sda2): I/O error while writing superblock
[Fri Feb 17 02:05:01 2023] EXT4-fs error (device sda2): __ext4_find_entry:1665: inode #42232: comm rsync: reading directory lblock 0
[Fri Feb 17 02:05:01 2023] EXT4-fs (sda2): I/O error while writing superblock
[Fri Feb 17 02:05:01 2023] EXT4-fs error (device sda2): __ext4_find_entry:1665: inode #42232: comm rsync: reading directory lblock 0
[Fri Feb 17 02:05:01 2023] EXT4-fs (sda2): I/O error while writing superblock
[Fri Feb 17 02:05:01 2023] EXT4-fs error (device sda2): __ext4_find_entry:1665: inode #42232: comm rsync: reading directory lblock 0
[Fri Feb 17 02:05:01 2023] EXT4-fs (sda2): I/O error while writing superblock
[Fri Feb 17 02:05:01 2023] EXT4-fs error (device sda2): __ext4_find_entry:1665: inode #42232: comm rsync: reading directory lblock 0
[Fri Feb 17 02:05:01 2023] EXT4-fs (sda2): I/O error while writing superblock
[Fri Feb 17 02:05:01 2023] EXT4-fs error (device sda2): __ext4_find_entry:1665: inode #42232: comm rsync: reading directory lblock 0
[Fri Feb 17 02:05:01 2023] EXT4-fs error (device sda2): __ext4_find_entry:1665: inode #42232: comm rsync: reading directory lblock 0
[Fri Feb 17 02:05:01 2023] EXT4-fs error (device sda2): __ext4_find_entry:1665: inode #151452: comm rsync: reading directory lblock 0
[Sat Feb 18 02:08:23 2023] EXT4-fs (sda2): warning: mounting fs with errors, running e2fsck is recommended
[Sat Feb 18 02:08:23 2023] EXT4-fs (sda2): recovery complete
[Sat Feb 18 02:08:23 2023] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[Sat Feb 18 02:08:57 2023] EXT4-fs warning (device sda2): ext4_end_bio:348: I/O error 10 writing to inode 30214 starting block 921587)
[Sat Feb 18 02:08:57 2023] EXT4-fs warning (device sda2): ext4_end_bio:348: I/O error 10 writing to inode 30214 starting block 922099)
[Sat Feb 18 02:08:58 2023] EXT4-fs error (device sda2): ext4_check_bdev_write_error:218: comm rsync: Error while async write back metadata
[Sat Feb 18 02:08:58 2023] EXT4-fs warning (device sda2): ext4_end_bio:348: I/O error 10 writing to inode 30214 starting block 922611)
[Sat Feb 18 02:08:58 2023] EXT4-fs warning (device sda2): ext4_end_bio:348: I/O error 10 writing to inode 30214 starting block 922624)
[Sat Feb 18 02:08:58 2023] EXT4-fs warning (device sda2): ext4_end_bio:348: I/O error 10 writing to inode 30214 starting block 923135)
[Sat Feb 18 02:08:58 2023] EXT4-fs warning (device sda2): ext4_end_bio:348: I/O error 10 writing to inode 30214 starting block 923647)
[Sat Feb 18 02:08:58 2023] EXT4-fs error (device sda2): ext4_check_bdev_write_error:218: comm rsync: Error while async write back metadata
[Sat Feb 18 02:08:58 2023] EXT4-fs error (device sda2) in ext4_reserve_inode_write:5752: Journal has aborted
[Sat Feb 18 02:08:58 2023] EXT4-fs error (device sda2): mpage_map_and_submit_extent:2513: inode #30214: comm rsync: mark_inode_dirty error
[Sat Feb 18 02:08:58 2023] EXT4-fs error (device sda2): mpage_map_and_submit_extent:2517: comm rsync: Failed to mark inode 30214 dirty
[Sat Feb 18 02:08:58 2023] EXT4-fs error (device sda2) in ext4_writepages:2833: Journal has aborted
[Sat Feb 18 02:08:58 2023] EXT4-fs warning (device sda2): ext4_end_bio:348: I/O error 10 writing to inode 30214 starting block 924159)
[Sat Feb 18 02:08:58 2023] EXT4-fs (sda2): I/O error while writing superblock
[Sat Feb 18 02:08:58 2023] EXT4-fs warning (device sda2): ext4_end_bio:348: I/O error 10 writing to inode 30214 starting block 924672)
[Sat Feb 18 02:08:58 2023] EXT4-fs error (device sda2): ext4_journal_check_start:83: comm rsync: Detected aborted journal
[Sat Feb 18 02:08:58 2023] EXT4-fs error (device sda2): ext4_journal_check_start:83: comm kworker/u8:2: Detected aborted journal
[Sat Feb 18 02:08:58 2023] EXT4-fs (sda2): I/O error while writing superblock
[Sat Feb 18 02:08:58 2023] EXT4-fs (sda2): Remounting filesystem read-only
[Sat Feb 18 02:08:58 2023] EXT4-fs (sda2): I/O error while writing superblock
[Sat Feb 18 02:08:58 2023] EXT4-fs (sda2): failed to convert unwritten extents to written extents -- potential data loss!  (inode 30214, error -30)
[Sat Feb 18 02:08:59 2023] EXT4-fs warning (device sda2): htree_dirblock_to_tree:1072: inode #42231: lblock 0: comm rsync: error -5 reading directory block
[Sat Feb 18 02:08:59 2023] EXT4-fs error (device sda2): __ext4_find_entry:1665: inode #42232: comm rsync: reading directory lblock 0
[Sat Feb 18 02:08:59 2023] EXT4-fs (sda2): I/O error while writing superblock
[Sat Feb 18 02:08:59 2023] EXT4-fs error (device sda2): __ext4_find_entry:1665: inode #42232: comm rsync: reading directory lblock 0
[Sat Feb 18 02:08:59 2023] EXT4-fs (sda2): I/O error while writing superblock
[Sat Feb 18 02:08:59 2023] EXT4-fs (sda2): I/O error while writing superblock
[Sat Feb 18 02:08:59 2023] EXT4-fs (sda2): I/O error while writing superblock
[Sat Feb 18 02:08:59 2023] EXT4-fs (sda2): I/O error while writing superblock

I am using the SD mirror in openhabian, and assume, sda2 is that mirror SD?!

Can I expect the mirror SD to fail?
Would I need to “Remove SD mirroring”, then swap the card and enable it again?

Any hints appreciated.

I think you’ll need to search for a generic Linux/Raspberry Pi forum. This is some low level Linux stuff and in the twenty-eight years I’ve used Linux (my first install was in 1995, Slackwear), I’ve never seen this error (though to be fair ext 4 has only been around since 2008). I wouldn’t know where to start beyond searching DuckDuckGo with the text of the error. I bet there’s at least one post in stackoverflow that talks about it and what it means.

1 Like

Looks like filesystem issue. You can try repairing it with fsck. It might happen that unexpected shutdown may leave filesystem in inconsistent state.
If you use rsync then this tool works at file level which means that any troubles with source filesystem will cause error while reading and not while writing.

1 Like

Agree and understood; I found some info on the web, and then thought it to be an SD card issue. Hence, getting the OH steps confirmed; as in, break the mirror, replace card, establish mirror is what I’d do in this case.

Yes, what I thought too. However, I do not know how openHABian manages the mirroring, etc. The system is up for 61 days, no weird shutdowns… I only say the error for two days; last night it did not show. Go figure.

Let’s close this problem… and I replace the SD card as indicated, with break mirror, replace card; create mirror.

Thanks guys! :slight_smile: