From: Andrey Zhunev <a-j@a-j.ru>
To: xfs list <linux-xfs@vger.kernel.org>
Subject: Re: Need help to recover root filesystem after a power supply issue
Date: Thu, 11 Jul 2019 02:43:40 +0300 [thread overview]
Message-ID: <18310556842.20190711024340@a-j.ru> (raw)
In-Reply-To: <CAJCQCtS0EfAghBGoL-YVTEANfAXV4Oy7Q+4Q0Jp3xOF-uQhixA@mail.gmail.com>
Ok, the ddrescue finished copying whatever it was able to recover.
There were many unreadable sectors near the end of the drive.
In total, there were over 170 pending sectors reported by SMART.
I then ran the following commands:
# smartctl -l scterc,900,100 /dev/sda
# echo 180 > /sys/block/sda/device/timeout
But this didn't help at all. The unreadable sectors still remained
unreadable.
So I wiped them with hdparm:
# hdparm --yes-i-know-what-i-am-doing --write-sector <sector_number> /dev/sda
I then re-read all these sectors, and they were all read correctly.
The number of pending sectors reported by SMART dropped down to 7.
Interestingly, there are still NO reallocated sectors reported.
Now, the xfs-repair reported the following:
# xfs_repair /dev/centos/root
Phase 1 - find and verify superblock...
Phase 2 - using internal log
- zero log...
ERROR: The filesystem has valuable metadata changes in a log which needs to
be replayed. Mount the filesystem to replay the log, and unmount it before
re-running xfs_repair. If you are unable to mount the filesystem, then use
the -L option to destroy the log and attempt a repair.
Note that destroying the log may cause corruption -- please attempt a mount
of the filesystem before doing this.
But I was still unable to momunt the filesystem:
# mount /dev/centos/root /tmp/root/
mount: mount /dev/mapper/centos-root on /tmp/root failed: Structure needs cleaning
So I went ahead with the '-L', and after some time the xfs_repair
completed the repair.
I can now mount my / partition successfully!
Most of the data seems to be there (I didn't check all of it, yet).
First thing I checked was the original kernel log. And yes, Chris was
right! There are a few warnings reporting read errors on /dev/sda.
These obviously were logged before the PSU failed. So the PSU might
have been just a coincidence...
Thanks a lot to everybody for your great help and support!!!
BTW, interestingly enough, those 7 pending sectors "disappeared" after
a power cycle. Maybe they were on some internal space on the HDD, not
accessible to users?
The SMART on this drive looks pretty clean now:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 867
3 Spin_Up_Time 0x0027 181 179 021 Pre-fail Always - 5916
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 175
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 100 253 000 Old_age Always - 0
9 Power_On_Hours 0x0032 022 022 000 Old_age Always - 56949
10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 100 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 175
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 112
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 62
194 Temperature_Celsius 0x0022 117 091 000 Old_age Always - 33
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 100 253 000 Old_age Offline - 0
---
Best regards,
Andrey
next prev parent reply other threads:[~2019-07-10 23:43 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-10 9:47 Need help to recover root filesystem after a power supply issue Andrey Zhunev
2019-07-10 14:30 ` Chris Murphy
2019-07-10 15:28 ` Andrey Zhunev
2019-07-10 15:45 ` Chris Murphy
2019-07-10 16:07 ` Andrey Zhunev
2019-07-10 16:46 ` Chris Murphy
2019-07-10 16:47 ` Chris Murphy
2019-07-10 17:16 ` Andrey Zhunev
2019-07-10 18:03 ` Chris Murphy
2019-07-10 18:35 ` Carlos E. R.
2019-07-10 19:30 ` Chris Murphy
2019-07-10 23:43 ` Andrey Zhunev [this message]
2019-07-11 2:47 ` Carlos E. R.
2019-07-11 7:10 ` Andrey Zhunev
2019-07-11 10:23 ` Carlos E. R.
2019-07-10 16:51 ` Chris Murphy
-- strict thread matches above, loose matches on Subject: below --
2019-07-10 9:56 Andrey Zhunev
2019-07-10 13:26 ` Eric Sandeen
2019-07-10 13:58 ` Andrey Zhunev
2019-07-10 14:23 ` Eric Sandeen
2019-07-10 15:02 ` Andrey Zhunev
2019-07-10 15:23 ` Eric Sandeen
2019-07-10 18:21 ` Carlos E. R.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18310556842.20190711024340@a-j.ru \
--to=a-j@a-j.ru \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox