linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BTRFS corrupted by combination of mistreatment of hiberantion and accidental power loss.
@ 2014-01-29 14:50 Adam Ryczkowski
  2014-01-29 15:02 ` Roman Mamedov
  2014-01-29 15:13 ` cwillu
  0 siblings, 2 replies; 4+ messages in thread
From: Adam Ryczkowski @ 2014-01-29 14:50 UTC (permalink / raw)
  To: linux-btrfs

I have two independent Linux installations my notebook, both sharing the 
same btrfs partition as root file system, but installed on different 
subvolumes.

I hibernated one Linux (Mint 15 64 bit). Hibernation data is stored on 
the swap file, which is used exclusively by this system.

Then 2 events happened.

1) I accidentally ran the other system, which wasn't hibernated - Ubuntu 
12.10. Realizing the problem, I waited until the system booted up, and 
then shutdowned it.

Then I opened the hibernated Mint 15. Restoration went successful, and I 
never thought I am in trouble.

2) Immediately after that, by coincidence, the battery fell down, 
brutally powering down the computer.

After that, I am unable to repair/mount the root btrfs partition, 
however I try (I built the current btrfs-tools from git). Dmesg displays 
only one error entry: btrfs: open_ctree failed.

I know, that if one those two events happened separately, there would be 
no problem. The problem arose only when those two events happened 
simultaneously.

So I guess I am experiencing one of the corner cases.

What are my prospects to restoring my data? I have several subvolumes on 
the hard drive, some of them were not touched by the accident at all.

Adam Ryczkowski


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BTRFS corrupted by combination of mistreatment of hiberantion and accidental power loss.
  2014-01-29 14:50 BTRFS corrupted by combination of mistreatment of hiberantion and accidental power loss Adam Ryczkowski
@ 2014-01-29 15:02 ` Roman Mamedov
  2014-01-29 15:13 ` cwillu
  1 sibling, 0 replies; 4+ messages in thread
From: Roman Mamedov @ 2014-01-29 15:02 UTC (permalink / raw)
  To: Adam Ryczkowski; +Cc: linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 985 bytes --]

On Wed, 29 Jan 2014 15:50:29 +0100
Adam Ryczkowski <adam.ryczkowski@statystyka.net> wrote:

> I have two independent Linux installations my notebook, both sharing the 
> same btrfs partition as root file system

!!!

> 1) I accidentally ran the other system, which wasn't hibernated

!!!!!

> Ubuntu 
> 12.10. Realizing the problem, I waited until the system booted up, and 
> then shutdowned it.

You were already screwed at this point. The following power-down is
irrelevant, and this is not a BTRFS-specific issue either.

What you did was kind of like plugging a HDD into one computer, then at the
same time plugging it into another one (let's imagine this would be possible)
then "waiting until the system booted up" at the second one, shutting it down,
then expecting the 1st computer doesn't notice a thing. But then again from
your initial post I wonder will you realize why such imagined scenario would
cause any problem.

-- 
With respect,
Roman

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BTRFS corrupted by combination of mistreatment of hiberantion and accidental power loss.
  2014-01-29 14:50 BTRFS corrupted by combination of mistreatment of hiberantion and accidental power loss Adam Ryczkowski
  2014-01-29 15:02 ` Roman Mamedov
@ 2014-01-29 15:13 ` cwillu
  2014-01-29 17:08   ` Duncan
  1 sibling, 1 reply; 4+ messages in thread
From: cwillu @ 2014-01-29 15:13 UTC (permalink / raw)
  To: Adam Ryczkowski; +Cc: linux-btrfs

You'd have been better off to just throw away the hiberated image:
mounting the filesystem would look like any other recovery from a
crash, and would have replayed the log and committed a new
transaction, in addition to whatever other disk writes happened due to
boot logs and so forth.

In this case, I suspect you'd have been perfectly fine.

When resuming the hibernated image at that point however, the kernel
will have its own ideas about the state on disk (i.e., whatever state
it had in memory), partially undoing a subset of the changes from the
previous boot and generally making a mess of things.

That said, have you tried mounting with -o recovery yet?  I wouldn't
be surprised if btrfs-restore was also able to retrieve most of
everything.  Either way, I'd be suspicious of the filesystem, and
would look to restore from backup to a fresh fs.



On Wed, Jan 29, 2014 at 8:50 AM, Adam Ryczkowski
<adam.ryczkowski@statystyka.net> wrote:
> I have two independent Linux installations my notebook, both sharing the
> same btrfs partition as root file system, but installed on different
> subvolumes.
>
> I hibernated one Linux (Mint 15 64 bit). Hibernation data is stored on the
> swap file, which is used exclusively by this system.
>
> Then 2 events happened.
>
> 1) I accidentally ran the other system, which wasn't hibernated - Ubuntu
> 12.10. Realizing the problem, I waited until the system booted up, and then
> shutdowned it.
>
> Then I opened the hibernated Mint 15. Restoration went successful, and I
> never thought I am in trouble.
>
> 2) Immediately after that, by coincidence, the battery fell down, brutally
> powering down the computer.
>
> After that, I am unable to repair/mount the root btrfs partition, however I
> try (I built the current btrfs-tools from git). Dmesg displays only one
> error entry: btrfs: open_ctree failed.
>
> I know, that if one those two events happened separately, there would be no
> problem. The problem arose only when those two events happened
> simultaneously.
>
> So I guess I am experiencing one of the corner cases.
>
> What are my prospects to restoring my data? I have several subvolumes on the
> hard drive, some of them were not touched by the accident at all.
>
> Adam Ryczkowski
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BTRFS corrupted by combination of mistreatment of hiberantion and accidental power loss.
  2014-01-29 15:13 ` cwillu
@ 2014-01-29 17:08   ` Duncan
  0 siblings, 0 replies; 4+ messages in thread
From: Duncan @ 2014-01-29 17:08 UTC (permalink / raw)
  To: linux-btrfs

cwillu posted on Wed, 29 Jan 2014 09:13:44 -0600 as excerpted:

> That said, have you tried mounting with -o recovery yet?  I wouldn't be
> surprised if btrfs-restore was also able to retrieve most of everything.
> Either way, I'd be suspicious of the filesystem, and would look to
> restore from backup to a fresh fs.

What he said, plus try mounting with the nospace_cache option.  I've had 
crashes kill that tree... only, and sometimes...  If that works, try 
clear_spacecache (not sure on the _s and I'm headed for work so look that 
bit up).



-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-29 17:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-29 14:50 BTRFS corrupted by combination of mistreatment of hiberantion and accidental power loss Adam Ryczkowski
2014-01-29 15:02 ` Roman Mamedov
2014-01-29 15:13 ` cwillu
2014-01-29 17:08   ` Duncan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).