Corruption on Big Endian System

2018-03-26 Thread Ashu Tiwary
It appears my system may have hit the issue reverted here (
https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg74621.html
) ( [PATCH] Revert "btrfs: use proper endianness accessors for
super_copy" ); system is an IBM OpenPower 720 (Big Endian) running
Fedora 27; kernel was at 4.15.9; attempting to reboot after updating
system (including kernel to 4.15.10) caused system to not be able to
boot:

=
 Mounting /sysroot...
[   34.644721] BTRFS warning (device dm-3): suspicious: generation <
chunk_root_generation: 15959351903540740096 < 17261735521269317632
[   34.644761] BTRFS info (device dm-3): disk space caching is enabled
[   34.644771] BTRFS info (device dm-3): has skinny extents
[   34.645925] BTRFS critical (device dm-3): unable to find logical
71472550772736 length 65536
[   34.645941] BTRFS critical (device dm-3): unable to find logical
71472550772736 length 65536
[   34.645952] BTRFS error (device dm-3): failed to read chunk root
[   34.807156] BTRFS error (device dm-3): open_ctree failed
[FAILED] Failed to mount /sysroot.
=

It appears there is a manual method available to repair the corrupted
superblock: can that be made available?

Thanks,

-Ashu

--
Ashu Tiwary
ashuat...@gmail.com
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Corruption on Big Endian System

2018-03-28 Thread Ashu Tiwary
On Tue, Mar 27, 2018 at 7:13 AM, David Sterba  wrote:
> On Mon, Mar 26, 2018 at 10:00:04AM -0500, Ashu Tiwary wrote:
>> It appears my system may have hit the issue reverted here (
>> https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg74621.html
>> ) ( [PATCH] Revert "btrfs: use proper endianness accessors for
>> super_copy" ); system is an IBM OpenPower 720 (Big Endian) running
>> Fedora 27; kernel was at 4.15.9; attempting to reboot after updating
>> system (including kernel to 4.15.10) caused system to not be able to
>> boot:
>>
>> =
>>  Mounting /sysroot...
>> [   34.644721] BTRFS warning (device dm-3): suspicious: generation <
>> chunk_root_generation: 15959351903540740096 < 17261735521269317632
>> [   34.644761] BTRFS info (device dm-3): disk space caching is enabled
>> [   34.644771] BTRFS info (device dm-3): has skinny extents
>> [   34.645925] BTRFS critical (device dm-3): unable to find logical
>> 71472550772736 length 65536
>> [   34.645941] BTRFS critical (device dm-3): unable to find logical
>> 71472550772736 length 65536
>> [   34.645952] BTRFS error (device dm-3): failed to read chunk root
>> [   34.807156] BTRFS error (device dm-3): open_ctree failed
>> [FAILED] Failed to mount /sysroot.
>> =
>>
>> It appears there is a manual method available to repair the corrupted
>> superblock: can that be made available?
>
> Yes, details below.
>
> Quick check from your logs:
>
> chunk_root_generation: 15959351903540740096 = 0xdd7b0200
> should be: 162781 = 0x0x27bdd
>
> tree root block pointer: 71472550772736 = 0x4101
> should be: 21037056 = 0x141
>
> The tool is available in the branch devel in my repos.  Setup repository
> unless you already have one:
>
> $ git clone git://github.com/kdave/btrfs-progs
> $ cd btrfs-progs
> $ git checkout devel
> $ ./autogen.sh
> $ ./configure
>
> Build the tool:
>
> $ make btrfs-sb-mod
>
> Use it (replace the path with the real one) and save the output in case
> something goes unexpectedly wrong:
>
> device=/path/to/the/device
> ./btrfs-sb-mod $device root @0
> ./btrfs-sb-mod $device generation @0
> ./btrfs-sb-mod $device chunk_root @0
> ./btrfs-sb-mod $device chunk_root_generation @0
> ./btrfs-sb-mod $device cache_generation @0
> ./btrfs-sb-mod $device uuid_tree_generation @0
>
> It prints the current and new values so it's reversible, besides that
> the byteswap can be run twice to get back to the starting point.
>
> Then the filesystem should be mountable again.


Hi,

That utility worked perfectly (it took me some time as I had to find
another system on which to build the recovery tool).

Thanks,

-Ashu

--
Ashu Tiwary
ashuat...@gmail.com
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html