btrfs becomes read only

Hi there

I was deleting some old stuff and when I try to remove a particular folder on a btrfs the whole fs becomes RO.
How to fix ? I am new to btrfs…


**kimera:~ #** findmnt --real -l | grep /mnt/btrfs
**/mnt/btrfs**                /dev/sdc2                           btrfs   rw,relatime,space_cache,subvolid=5,subvol=/
**kimera:~ #** cd /mnt/btrfs/miguel/Steam/         
**kimera:/mnt/btrfs/miguel/Steam # **ls
GameOverlayRenderer64.dll**config****linux64****steam****tenfoot**
ThirdPartyLegalNotices.css**controller_base****logs**steam.sh**ubuntu12_32**
ThirdPartyLegalNotices.doc**depotcache****music**steam_msg.sh**ubuntu12_64**
ThirdPartyLegalNotices.htmlfossilize_engine_filters.json**package**steam_subscriber_agreement.txtupdate_hosts_cached.vdf
**appcache****friends****public****steamapps****userdata**
**bin****graphics****resource****steamchina**
bin_steamdeps.py             installscriptevalutor_log.txt  **servers**steamclient.dll
bootstrap.tar.xz**legacycompat****skins**steamclient64.dll
**clientui****linux32**ssfn9115004176610272489**steamui**
**kimera:/mnt/btrfs/miguel/Steam #** rm -rf config
**kimera:/mnt/btrfs/miguel/Steam #** find  .  -maxdepth 1 -type f -exec rm {} \;                
**kimera:/mnt/btrfs/miguel/Steam #** ls
**appcache****clientui****depotcache****graphics****linux32****logs****package****resource****skins****steamapps****steamui****ubuntu12_32****userdata**
**bin****controller_base****friends****legacycompat****linux64****music****public****servers****steam****steamchina****tenfoot****ubuntu12_64**
**kimera:/mnt/btrfs/miguel/Steam #** rm -rf appcache bin clientui controller_base
rm: cannot remove 'appcache/httpcache/00/00d317630ee7d0825dc6a4cd5ce9f91f50e6993c_da39a3ee5e6b4b0d3255bfef95601890afd80709': Read-only file system
rm: cannot remove 'appcache/httpcache/01/01edefade28afe779bad14a9d5ff954b0f4c4e60_da39a3ee5e6b4b0d3255bfef95601890afd80709': Read-only file system
rm: cannot remove 'appcache/httpcache/01/0116c6a41aee246e028415352052bd79d323fc1f_da39a3ee5e6b4b0d3255bfef95601890afd80709': Read-only file system
...
rm: cannot remove 'controller_base/bigpicture_mouseon.vdf': Read-only file system
rm: cannot remove 'controller_base/gamepad_generic.vdf': Read-only file system
rm: cannot remove 'controller_base/basicui_gamepad.vdf': Read-only file system
rm: cannot remove 'controller_base/basicui_neptune.vdf': Read-only file system
rm: cannot remove 'controller_base/basicui.vdf': Read-only file system
**kimera:/mnt/btrfs/miguel/Steam #**


The strange is, each time (I have to reboot to get RW access to FS) a different folder trigger the error. Last time was that folder “config” that, this time, as you can see, was removed fine;
Well, kind of, the folder/files aren’t removed at all. After the reboot, all files/folders previously removed are there again.

How to fix that FS ?

Post output of “btrfs filesystem usage -T /mnt/btrfs” and full output of dmesg (upload to https://susepaste.org/).

Here it is: SUSE Paste
The output of usage comes here for your convinience:


**kimera:~ #** btrfs filesystem usage -T /mnt/btrfs
Overall:
    Device size:                   2.37TiB
    Device allocated:            348.06GiB
    Device unallocated:            2.03TiB
    Device missing:                  0.00B
    Used:                        287.07GiB
    Free (estimated):              2.09TiB      (min: 1.08TiB)
    Data ratio:                       1.00
    Metadata ratio:                   2.00
    Global reserve:              349.28MiB      (used: 0.00B)
    Multiple profiles:                  no

             Data      Metadata  System               
Id Path      single    RAID1     RAID1    Unallocated
-- --------- --------- --------- -------- -----------
 1 /dev/sdc2 346.00GiB   1.00GiB 32.00MiB     1.16TiB
 2 /dev/sdc1         -   1.00GiB 32.00MiB   898.97GiB
-- --------- --------- --------- -------- -----------
   Total     346.00GiB   1.00GiB 32.00MiB     2.03TiB
   Used      286.15GiB 470.45MiB 64.00KiB             
**kimera:~ #**

There are no errors in it. Is it after filesystem went read-only? You need to post output after this happens, to capture any kernel errors.

The output of usage comes here for your convinience

Well, you have plenty of space so at least this can be rules out.

Follow the output of journalctl -e -f


Feb 02 10:42:05 kimera.rozsas.eng.br kdeinit5[31743]: **Qt: Session management error: networkIdsList argument is NULL**
Feb 02 10:43:34 kimera.rozsas.eng.br kernel: **BTRFS error (device sdc2): parent transid verify failed on 558004666368 wanted 86067 found 86066**
Feb 02 10:43:34 kimera.rozsas.eng.br kernel: **BTRFS error (device sdc2): parent transid verify failed on 558004666368 wanted 86067 found 86066**
Feb 02 10:43:34 kimera.rozsas.eng.br kernel: **BTRFS: error (device sdc2) in __btrfs_free_extent:3144: errno=-5 IO failure**
Feb 02 10:43:34 kimera.rozsas.eng.br kernel: BTRFS info (device sdc2): forced readonly
Feb 02 10:43:34 kimera.rozsas.eng.br kernel: **BTRFS: error (device sdc2) in btrfs_run_delayed_refs:2191: errno=-5 IO failure**
Feb 02 10:43:50 kimera.rozsas.eng.br kdeinit5[17184]: **Qt: Session management error: networkIdsList argument is NULL**


The above happend after the following commands:


** miguel ** …  btrfs  miguel  **Steam ** ls
**bin**      **skins**  **music**     **controller_base**  **steamchina**  **linux32**   **friends**   **steamui**  **resource**  **ubuntu12_64**  **legacycompat**  **depotcache**  **config**
**tenfoot**  **steam**  **userdata**  **steamapps**        **linux64**     **graphics**  **clientui**  **servers**  **public**    **ubuntu12_32**  **logs**          **appcache**    **package**
** miguel ** …  btrfs  miguel  **Steam ** rm -rf bin skins music
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/62-tt-traced-bitmap-rendering.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/80-selective-rendering-inf-7-xp.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/43-repl-tt-traced-bitmap.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/81-final-rendering-inf-7-xp.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/62-tt-monospace-rendering.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/44-repl-corrective.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/80-selective-rendering-inf-win-lin.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/50-base-rendering-win7-winxp.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/21-aliases-wine-win7-inf.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/61-group-non-tt-rendering-inf-7-xp-lin.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/30-non-latin-inf-win.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/20-fix-cantarell.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/61-group-tt-rendering-inf-7-xp.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/65-override.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/70-forced-synthetic.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/90-reject.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/20-aliases-default-win.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/60-group-non-tt-fonts.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/90-no-synthetic.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/41-repl-os-win.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/42-repl-global.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/conf.d/60-group-tt-fonts.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/fonts/fonts.conf': Read-only file system
rm: cannot remove 'bin/panorama/etc/pango/pango.modules': Read-only file system
rm: cannot remove 'bin/shaders/tenfoot/opengl/fancyquaduber.vert': Read-only file system
rm: cannot remove 'bin/shaders/tenfoot/opengl/orthographic2d.vert': Read-only file system
rm: cannot remove 'bin/shaders/tenfoot/opengl/vrdistort.vert': Read-only file system
rm: cannot remove 'bin/shaders/tenfoot/opengl/tex2dparticle.frag': Read-only file system
rm: cannot remove 'bin/shaders/tenfoot/opengl/vrdistort.frag': Read-only file system
rm: cannot remove 'bin/shaders/tenfoot/opengl/tex2dblur.frag': Read-only file system
rm: cannot remove 'bin/shaders/tenfoot/opengl/fancyquaduber.frag': Read-only file system
rm: cannot remove 'bin/shaders/tenfoot/glfancyquadshaders.cfg': Read-only file system
rm: cannot remove 'skins/skins_readme.txt': Read-only file system
rm: cannot remove 'music/_database/musicdatabase_0016.db': Read-only file system
rm: cannot remove 'music/_database/rules.vdf': Read-only file system
rm: cannot remove 'music/_database/covers/318981dbc4a61124286d317cac65ef9767d66603.png': Read-only file system
rm: cannot remove 'music/_database/covers/f1bc4b1923b1e22850484237660549e173ef3722.png': Read-only file system
rm: cannot remove 'music/_database/covers/e46e7f4485ccf022c615ae3853d7924257035980.png': Read-only file system



This usually means real filesystem corruption - some writes were lost and never reached disk. Depending on which parts of filesystem are affected it may be possible to fix it without data loss. But it really requires developers who understand internals to guide further.

You may try to contact btrfs mailing list. Usually it is responsive. Alternative is to preserve whatever data may be needed from this filesystem and reformat it. But the very fact that filesystem went corrupted may indicate hardware or (disk) firmware issue.

Ouch !
Ok, I will try to get in touch with them in