You are not logged in.

#1 2017-07-09 09:36:38

failednoose
Member
Registered: 2017-07-09
Posts: 3

Issue with mounting BTRFS

Hi everyone,

I'm having some issues with mounting btrfs filesystem on my work laptop. I was having a 'No space left on device issue' a couple of days ago, which made my Arch install pretty much useless. I've found a blog post about rebalancing the tree, so I ran this command:

sudo btrfs fi balance start -dusage=5 /

Unfortuately, since rebalancing took a really long time I've made a dump mistake of restarting the computer while rebalancing was still going on. As you might expect, this caused some unfortunate issues.

When I tried to boot to my arch install after that, it got stuck at mounting the btrfs partition, and after a couple of minutes it would say that the mount task is taking too long. After some more time, I would get a kernel oops. Loading an Arch install USB and trying to mount the partition normally would cause the same error, but I could still mount the partition read only:

mount -o ro,recovery /dev/nvme0n1p5

Recovery option isn't actually needed here, since I can still mount with just the ro option.

I've ran a btfsck --repair command after that, and the only thing that it did is speed up the time until I get the kernel oops. I can also still mount my filesystem when it's read only, and as far as I can tell, most of my data can still be read.

Here's a couple of snaps of error messages I recieve:

Kernel oops when booting my install:

http://i.imgur.com/pCE0TRg.png

Another kernel oops that appears a minute or two after the first one:

http://i.imgur.com/LkCTRq1.png

I've pressed enter a couple of times before the second kernel oops appears, so you can't see any text of the first kernel oops. Also, after the second oops there's a new oops every 20-30 seconds.

Also, here's the output of btrfsck, this is the second run. The first run had a bunch of repair messages and took over an hour

http://i.imgur.com/d5TgDR3.png

I have a bunch of snapshots available, but I can't use any since I have to mount the partition as read only. I think if I could restore one of the previous snapshots that that would potentially fix the problem. If restoring is impossible, I would really appreciate any advice on how to approach extracting the data from my partition and restoring it in any way possible.

If you need any more information, please let me know smile

Offline

#2 2017-07-09 12:10:18

ratcheer
Member
Registered: 2011-10-09
Posts: 924

Re: Issue with mounting BTRFS

Are all of your snapshots on the same drive? If they are on a backup drive somewhere else, you can just recreate your filesystem and then restore your stuff from a snapshot. But  I'm afraid you mean they're all on the same filesystem, and I have no idea how to deal with that.

Tim

Offline

#3 2017-07-09 12:53:50

loqs
Member
Registered: 2014-03-06
Posts: 18,859

Re: Issue with mounting BTRFS

Try contacting upstream btrfs Project_information.2FContact such as the irc channel or mailing list.

Offline

#4 2017-07-09 15:18:09

failednoose
Member
Registered: 2017-07-09
Posts: 3

Re: Issue with mounting BTRFS

ratcheer wrote:

Are all of your snapshots on the same drive? If they are on a backup drive somewhere else, you can just recreate your filesystem and then restore your stuff from a snapshot. But  I'm afraid you mean they're all on the same filesystem, and I have no idea how to deal with that.

Tim

Yes, they are, but the partition still has some NTFS space I could probably repartition to extract the snapshots. Could you please expand a bit on how to recreate the filesystem and restore the snapshot? I'm not 100% sure what you mean. Just some general instruction should be fine.


loqs wrote:

Try contacting upstream btrfs Project_information.2FContact such as the irc channel or mailing list.

Thanks, I'll do that as well smile

Offline

#5 2017-07-09 19:47:35

ratcheer
Member
Registered: 2011-10-09
Posts: 924

Re: Issue with mounting BTRFS

failednoose wrote:
ratcheer wrote:

Are all of your snapshots on the same drive? If they are on a backup drive somewhere else, you can just recreate your filesystem and then restore your stuff from a snapshot. But  I'm afraid you mean they're all on the same filesystem, and I have no idea how to deal with that.

Tim

Yes, they are, but the partition still has some NTFS space I could probably repartition to extract the snapshots. Could you please expand a bit on how to recreate the filesystem and restore the snapshot? I'm not 100% sure what you mean. Just some general instruction should be fine.


loqs wrote:

Try contacting upstream btrfs Project_information.2FContact such as the irc channel or mailing list.

Thanks, I'll do that as well smile

My thinking was that if you have your snapshots backed up to another drive, you could re-partition the drive you're having trouble with, create a new, empty btrfs filesystem, and then copy everything back from a snapshot. You would have to do it booted to something like a Live ISO.

But, since your snapshots are on the same drive, repartitioning would wipe them out, too. So, you can't do it.

Tim

Offline

#6 2017-07-09 22:12:51

failednoose
Member
Registered: 2017-07-09
Posts: 3

Re: Issue with mounting BTRFS

ratcheer wrote:

My thinking was that if you have your snapshots backed up to another drive, you could re-partition the drive you're having trouble with, create a new, empty btrfs filesystem, and then copy everything back from a snapshot. You would have to do it booted to something like a Live ISO.

But, since your snapshots are on the same drive, repartitioning would wipe them out, too. So, you can't do it.

Tim

Oh, I probably should have mentioned that I have large parts of the drive formatted to NTFS since I'm dual booting with Windows big_smile
I have one NTFS partition that has more free space than the size of the btrfs partition, so I could probably create a new btrfs partition, move the snapshots out (since they can actually be read) and nuke the old partition. Unless I'm missing some kind of an issue with that approach?

Offline

#7 2017-07-10 18:55:46

ratcheer
Member
Registered: 2011-10-09
Posts: 924

Re: Issue with mounting BTRFS

That should work, as far as I know.

I recently did an almost bare metal recovery by creating a new partition table on my main drive, creating a new btrfs filesystem, and copying a snapshot to the new filesystem using "cp -ar <path to snapshot>/* To my pleasant surprise, it worked perfectly.

Tim

Offline

Board footer

Powered by FluxBB