title: How to fix btrfs root inode errors
body: <p>Running <code>btrfsck</code>, or more officially, <code>btrfs check --repair</code> gives this output stating that there are root inode errors. The repair command does not fix the issue and reruns will display the same output. The system is <strong>fully mountable and operational</strong>, but I cannot perform advanced operations on the partition (resizing).</p>
  
  <pre><code>sudo btrfs check --repair /dev/sda9
  enabling repair mode
  Checking filesystem on /dev/sda9
  UUID: 82fca3c2-703b-4fae-aec2-6b7df1be71c1
  checking extents
  Fixed 0 roots.
  checking free space cache
  cache and super generation don't match, space cache will be invalidated
  checking fs roots
  root 257 inode 452001 errors 400, nbytes wrong
  root 257 inode 452004 errors 400, nbytes wrong
  root 257 inode 452005 errors 400, nbytes wrong
  root 257 inode 452006 errors 400, nbytes wrong
  root 257 inode 452010 errors 400, nbytes wrong
  root 257 inode 452011 errors 400, nbytes wrong
  root 257 inode 452012 errors 400, nbytes wrong
  root 257 inode 1666032 errors 400, nbytes wrong
  checking csums
  checking root refs
  found 33957216263 bytes used err is 0
  total csum bytes: 32206988
  total tree bytes: 968933376
  total fs tree bytes: 886636544
  total extent tree bytes: 35323904
  btree space waste bytes: 199109273
  file data blocks allocated: 41090113536
   referenced 32584159232
  btrfs-progs v4.0.1
  </code></pre>