Ubuntu – Can’t boot, task btrfs-transacti blocked for more than 120 seconds, how to fix this

btrfsUbuntuuefi

My computer was set up to boot Ubuntu 15.04 via UEFI. I have two disks. My first disk /dev/sda is a 128 GB ssd formatted as GPT, containing an EFI partition and a btrfs partiton with subvolume @ mounting as '/'. The second disk is a 1 TB hdd formatted as GPT, with a btrfs partition with subvolume @home mounting as /home.

After the greeter started, without logging in I pressed the hard-reset button on my computer to restart the system, because I remembered I wanted to check something in the grub menu.

I held shift during the next boot, but the GRUB boot menu did not open, and the computer stalled on the purple screen.

Pressing ctrl+alt+F1 switches this to a blank terminal, and then ctrl+alt+F7 switches it to another terminal displaying:

starting version 219
Scanning for Btrfs filesystems

Then after waiting for around a 2 minutes, it added an error message on this screen:

[  239.845714] INFO: task exe:169 blocked for more than 120 seconds.
[  239.845740]       Not tainted 3.19.9-16-generic #16-Ubuntu
[  239.845757] "echo 0 > /proc/sys/kernek/hung_task_timeout_secs" disables this message.
[  239.845983] INFO: task btrfs-transacti:191 blocked for more than 120 seconds.
[  239.846005]       Not tainted 3.19.9-16-generic #16-Ubuntu
[  239.846021] "echo 0 > /proc/sys/kernek/hung_task_timeout_secs" disables this message.

These same error messages were repeated again later starting at timestamps [ 359.658207], [ 479.470702], [ 599.283197], and [ 719.095961].

pressing ctrl+alt+F1 switches to a blank terminal, and ctrl+alt+F7 displays this same screen again, but nothing happens with any of the other F keys.

I have attempted fixing this by unplugging two of my drives (one has a corrupted windows install, the other is a failing ssd), but the problem persists.

I have attempted to boot into a live USB of Ubuntu 15.04. It gets to the ubuntu splash, but the loading takes a long time (don't know if it would have ever finished) and the text screen brought up with esc stays blank. I was previously able to boot it on this computer, and my laptop will boot it just fine, so I don't believe it is corrupt.

I tried resetting the BIOS settings, but that didn't change any of the aforementioned behavior.

Disconnecting all of the drives from the system allowed me to successfully boot to the live USB, but it was unable to recognize the disks when I reconnected them after booting.

How can I fix this issue?

Best Answer

Thanks to /u/cypher_zero:

  1. Boot from an Ubuntu live-USB.
  2. Identify your btrfs partitions using sudo blkid
  3. Then, execute sudo btrfs check --repair /dev/sda1 for every btrfs partition (replace /dev/sda1 with your btrfs partitions)
  4. Reboot.
Related Question