* Btrfs and LBA errors
@ 2014-07-11 11:42 constantine
2014-07-11 12:36 ` Russell Coker
0 siblings, 1 reply; 6+ messages in thread
From: constantine @ 2014-07-11 11:42 UTC (permalink / raw)
To: linux-btrfs
Hi everybody!
Btrfs filesystem could not be mounted because /dev/sdc1 had unreadable sectors.
It is/was a single filesystem (not raid1 or raid0) over /dev/sda1 and
/dev/sdc1.
I wrote the unreadable sectors with hdparm but filesystem still cannot
be mounted (sectors were too early perhaps).
What should be my next step for recovering the btrfs filesystem?
#### Analytically:
After
# smartctl -t long /dev/sdc
I got
"Extended offline Completed: read failure 90% 19662 2176"
So LBA_of_first_error: 2176
With
# hdparm --read-sector
I found out that 2176-2183 LBA sectors were unreadable.
I wrote them with
# hdparm --write-sector
and now smartctl does not report any error.
However when I run
# btrfs fi show
I get:
Label: 'partition' uuid: c1eb1aaf-665a-4337-9d04-3c3921aa67e0
Total devices 2 FS bytes used 1.53TiB
devid 2 size 1.37TiB used 195.00GiB path /dev/sda1
*** Some devices missing
#### Complementary Information
# uname -a
Linux hostname 3.15.5-031505-generic #201407091543 SMP Wed Jul 9
19:44:36 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
# btrfs --version
Btrfs v3.12
# btrfs fi show
Label: 'partition' uuid: c1eb1aaf-665a-4337-9d04-3c3921aa67e0
Total devices 2 FS bytes used 1.53TiB
devid 2 size 1.37TiB used 195.00GiB path /dev/sda1
*** Some devices missing
Btrfs v3.12
# btrfs fi df /mnt/partition
ERROR: couldn't get space info - Inappropriate ioctl for device
ERROR: get_df failed Inappropriate ioctl for device
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Btrfs and LBA errors
2014-07-11 11:42 Btrfs and LBA errors constantine
@ 2014-07-11 12:36 ` Russell Coker
2014-07-11 19:29 ` constantine
0 siblings, 1 reply; 6+ messages in thread
From: Russell Coker @ 2014-07-11 12:36 UTC (permalink / raw)
To: constantine; +Cc: linux-btrfs
On Fri, 11 Jul 2014 13:42:40 constantine wrote:
> Btrfs filesystem could not be mounted because /dev/sdc1 had unreadable
> sectors. It is/was a single filesystem (not raid1 or raid0) over /dev/sda1
> and /dev/sdc1.
What does "file -s /dev/sda1 /dev/sdc1" report?
--
My Main Blog http://etbe.coker.com.au/
My Documents Blog http://doc.coker.com.au/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Btrfs and LBA errors
2014-07-11 12:36 ` Russell Coker
@ 2014-07-11 19:29 ` constantine
2014-07-12 1:23 ` Russell Coker
0 siblings, 1 reply; 6+ messages in thread
From: constantine @ 2014-07-11 19:29 UTC (permalink / raw)
To: russell; +Cc: linux-btrfs
Thank you very much for your response:
# file -s /dev/sda1 /dev/sdc1
/dev/sda1: BTRFS Filesystem label "partition", sectorsize 4096,
nodesize 4096, leafsize 4096,
UUID=c1eb1aaf-665a-4337-9d04-3c3921aa67e0, 1683870334976/3010310701056
bytes used, 2 devices
/dev/sdc1: data
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Btrfs and LBA errors
2014-07-11 19:29 ` constantine
@ 2014-07-12 1:23 ` Russell Coker
2014-07-15 9:42 ` constantine
0 siblings, 1 reply; 6+ messages in thread
From: Russell Coker @ 2014-07-12 1:23 UTC (permalink / raw)
To: constantine; +Cc: linux-btrfs
On Fri, 11 Jul 2014 21:29:07 constantine wrote:
> Thank you very much for your response:
>
> # file -s /dev/sda1 /dev/sdc1
> /dev/sda1: BTRFS Filesystem label "partition", sectorsize 4096,
> nodesize 4096, leafsize 4096,
> UUID=c1eb1aaf-665a-4337-9d04-3c3921aa67e0, 1683870334976/3010310701056
> bytes used, 2 devices
> /dev/sdc1: data
Looks like the primary superblock on /dev/sdc1 is corrupt.
http://www.funtoo.org/BTRFS_Fun#btrfs-select-super_.2F_btrfs-zero-log
The above URL documents how to use the other superblocks. It notes that you
only get one chance - if you do this wrong you will dramatically reduce the
probability of getting your data back. Do not do this on the master copy of
your data!
Buy 2 disks of equal or greater capacity, copy the block devices, and then
working with the copy. sdc needs to be replaced anyway no matter what you do
and getting a replacement for sda would be a good strategy anyway. Buy 2*4TB
disks and you can make a new RAID-1 array that has more capacity than the non-
RAID filesystem you currently have.
--
My Main Blog http://etbe.coker.com.au/
My Documents Blog http://doc.coker.com.au/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Btrfs and LBA errors
2014-07-12 1:23 ` Russell Coker
@ 2014-07-15 9:42 ` constantine
2014-07-15 9:51 ` Russell Coker
0 siblings, 1 reply; 6+ messages in thread
From: constantine @ 2014-07-15 9:42 UTC (permalink / raw)
To: russell; +Cc: linux-btrfs
Thank you very much for your advice. It worked!
I verified that the superblocks 1 and 2 had similar information with
btrfs-show-super -i 1 /dev/sdc1 (and -i 2) and then with crossed
fingers:
btrfs-select-super -s 2 /dev/sdc1
which restored my btrfs filesystem.
Then I runned scrub. For future reference, scrub was "stuck":
"
# btrfs scrub status partition/
scrub status for c1eb1aaf-665a-4337-9d04-3c3921aa67e0
scrub started at Thu Jul 10 21:30:41 2014, running for 2743 seconds
total bytes scrubbed: 193.47GiB with 0 errors
"
and could not cancel it:
"
btrfs scrub cancel partition/
ERROR: scrub cancel failed on Downloads/: not running
"
After deleting /var/lib/btrfs/scrub.status.c1eb1aaf-665a-4337-9d04-3c3921aa67e0
it was completed successfully.
Many thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Btrfs and LBA errors
2014-07-15 9:42 ` constantine
@ 2014-07-15 9:51 ` Russell Coker
0 siblings, 0 replies; 6+ messages in thread
From: Russell Coker @ 2014-07-15 9:51 UTC (permalink / raw)
To: constantine; +Cc: linux-btrfs
On Tue, 15 Jul 2014 11:42:05 constantine wrote:
> Thank you very much for your advice. It worked!
Great!
> I verified that the superblocks 1 and 2 had similar information with
> btrfs-show-super -i 1 /dev/sdc1 (and -i 2) and then with crossed
> fingers:
> btrfs-select-super -s 2 /dev/sdc1
> which restored my btrfs filesystem.
>
> Then I runned scrub. For future reference, scrub was "stuck":
> "
> # btrfs scrub status partition/
> scrub status for c1eb1aaf-665a-4337-9d04-3c3921aa67e0
> scrub started at Thu Jul 10 21:30:41 2014, running for 2743 seconds
> total bytes scrubbed: 193.47GiB with 0 errors
> "
> and could not cancel it:
> "
> btrfs scrub cancel partition/
> ERROR: scrub cancel failed on Downloads/: not running
> "
> After deleting
> /var/lib/btrfs/scrub.status.c1eb1aaf-665a-4337-9d04-3c3921aa67e0 it was
> completed successfully.
That's a known bug.
Now I hope you have made a good backup, the next problem you encounter may not
be as easy to solve.
--
My Main Blog http://etbe.coker.com.au/
My Documents Blog http://doc.coker.com.au/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-07-15 9:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11 11:42 Btrfs and LBA errors constantine
2014-07-11 12:36 ` Russell Coker
2014-07-11 19:29 ` constantine
2014-07-12 1:23 ` Russell Coker
2014-07-15 9:42 ` constantine
2014-07-15 9:51 ` Russell Coker
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).