LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   F18 automatically boots to emergency mode: HD is failing? (http://www.linuxquestions.org/questions/linux-newbie-8/f18-automatically-boots-to-emergency-mode-hd-is-failing-4175475013/)

lroyer 08-28-2013 06:45 AM

F18 automatically boots to emergency mode: HD is failing?
 
Hi,
I have a hard disk problem, and I need some help.
Each time that I start my computer, Fedora18 directly boots into emergency mode due to I/O errors. The result of the dmesg | tail command is the following.

Quote:

[ 1967.110181] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
[ 1967.110191] 25 42 ea af
[ 1967.110197] sd 0:0:0:0: >[sda]
[ 1967.110199] ASC=0x11 ASCQ=0x4
[ 1967.110203] sd 0:0:0:0: >[sda] CDB:
[ 1967.110205] cdb[0]=0x28: 28 00 25 42 ea a8 00 00 08 00
[ 1967.110214] end_request: I/O error, dev sda, sector 625142447
[ 1967.110218] Buffer I/O error on device sda, logical block 78142805
[ 1967.110244] ata1: EH complete



I tried to fix this problem thanks to the following link.
http://smartmontools.sourceforge.net/badblockhowto.html

Here is the log from the short smart test.


Quote:

smartctl 6.0 2012-10-10 r3643 [i686-linux-3.5.6-pmagic] (local build)
Copyright (C) 2002-12, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family: Seagate Momentus 5400.6
Device Model: ST9320325AS
Serial Number: 6VD8JEHJ
LU WWN Device Id: 5 000c50 030c5fdb8
Firmware Version: 0003SDM1
User Capacity: 320,072,933,376 bytes [320 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: 5400 rpm
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS T13/1699-D revision 4
SATA Version is: SATA 2.6, 3.0 Gb/s
Local Time is: Wed Aug 28 11:06:26 2013 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 0) seconds.
Offline data collection
capabilities: (0x73) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 97) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x103b) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 097 091 006 Pre-fail Always - 91649560
3 Spin_Up_Time 0x0003 098 098 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 099 099 020 Old_age Always - 1987
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 078 060 030 Pre-fail Always - 78626832
9 Power_On_Hours 0x0032 096 096 000 Old_age Always - 3585
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 099 099 020 Old_age Always - 1982
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 001 001 000 Old_age Always - 701
188 Command_Timeout 0x0032 100 087 000 Old_age Always - 3388780975431
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 057 049 045 Old_age Always - 43 (Min/Max 41/50)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 234
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 49
193 Load_Cycle_Count 0x0032 059 059 000 Old_age Always - 83907
194 Temperature_Celsius 0x0022 043 051 000 Old_age Always - 43 (0 5 0 0 0)
195 Hardware_ECC_Recovered 0x001a 056 054 000 Old_age Always - 91649560
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 2
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 2
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 4297
254 Free_Fall_Sensor 0x0032 100 100 000 Old_age Always - 0

SMART Error Log Version: 1
ATA Error Count: 700 (device log contains only the most recent five errors)
CR = Command Register [HEX]
FR = Features Register [HEX]
SC = Sector Count Register [HEX]
SN = Sector Number Register [HEX]
CL = Cylinder Low Register [HEX]
CH = Cylinder High Register [HEX]
DH = Device/Head Register [HEX]
DC = Device Command Register [HEX]
ER = Error register [HEX]
ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 700 occurred at disk power-on lifetime: 3584 hours (149 days + 8 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 12:18:22.921 READ FPDMA QUEUED
27 00 00 00 00 00 e0 00 12:18:22.920 READ NATIVE MAX ADDRESS EXT
ec 00 00 00 00 00 a0 00 12:18:22.918 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 00 12:18:22.918 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 12:18:22.917 READ NATIVE MAX ADDRESS EXT

Error 699 occurred at disk power-on lifetime: 3584 hours (149 days + 8 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 12:18:20.600 READ FPDMA QUEUED
27 00 00 00 00 00 e0 00 12:18:20.600 READ NATIVE MAX ADDRESS EXT
ec 00 00 00 00 00 a0 00 12:18:20.598 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 00 12:18:20.597 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 12:18:20.597 READ NATIVE MAX ADDRESS EXT

Error 698 occurred at disk power-on lifetime: 3584 hours (149 days + 8 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 12:18:18.201 READ FPDMA QUEUED
27 00 00 00 00 00 e0 00 12:18:18.200 READ NATIVE MAX ADDRESS EXT
ec 00 00 00 00 00 a0 00 12:18:18.198 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 00 12:18:18.198 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 12:18:18.198 READ NATIVE MAX ADDRESS EXT

Error 697 occurred at disk power-on lifetime: 3584 hours (149 days + 8 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 12:18:15.791 READ FPDMA QUEUED
27 00 00 00 00 00 e0 00 12:18:15.790 READ NATIVE MAX ADDRESS EXT
ec 00 00 00 00 00 a0 00 12:18:15.788 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 00 12:18:15.788 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 12:18:15.787 READ NATIVE MAX ADDRESS EXT

Error 696 occurred at disk power-on lifetime: 3584 hours (149 days + 8 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 12:18:13.391 READ FPDMA QUEUED
27 00 00 00 00 00 e0 00 12:18:13.391 READ NATIVE MAX ADDRESS EXT
ec 00 00 00 00 00 a0 00 12:18:13.389 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 00 12:18:13.389 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 12:18:13.388 READ NATIVE MAX ADDRESS EXT

SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed: read failure 90% 3571 625142447

SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

I noted that the Current Pending Sector count is not equal to zero which demonstrates the presence of bad sectors.
The following line gives details about the location of the bad sectors.

Quote:

Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed: read failure 90% 3571 625142447


Here is the log from the fdisk -l command:
Quote:


Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000ea0de

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 2050047 512000 83 Linux
/dev/sda3 2050048 625141759 311545856 8e Linux LVM

Disk /dev/mapper/fedora-swap: 4009 MB, 4009754624 bytes
255 heads, 63 sectors/track, 487 cylinders, total 7831552 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/fedora-home: 261.3 GB, 261321916416 bytes
255 heads, 63 sectors/track, 31770 cylinders, total 510394368 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/fedora-root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders, total 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
However, I can't locate the partition on which the bad sector lives (LBA=625142447), because the LBA is higher than the SDA3 end value.

Can anyone help me?

Thanks in advance

rknichols 08-29-2013 10:48 AM

That LBA is at the very end of the disk, in the unallocated space following the last partition. Since this drive has a legacy msdos partition table, there would be nothing important stored there. Just zero out the last few kilobytes:
Code:

dd if=/dev/zero of=/dev/sda bs=512 seek=625142432
That will zero the last 8KB. Do be sure to get that "seek" parameter right or you will destroy your data.

lroyer 08-31-2013 10:42 AM

Thanks for your answer.
Unfortunately, it doesn't work because I think that I can't write on this bad sector.
Here is the output of the "dd" command.

Quote:

root@PartedMagic:~# dd if=/dev/zero of=/dev/sda bs=512 seek=625142432
dd: writing ‘/dev/sda’: Input/output error
9+0 records in
8+0 records out
4096 bytes (4.1 kB) copied, 3.05395 s, 1.3 kB/s


jefro 08-31-2013 12:08 PM

In any event like this I suggest that you first try to boot a live cd/usb. Then remove as much data as you can. Then try fooling with any fixes. Yes, dd is a poor way to recover data from a damaged disk.

We don't know if the disk is bad, or the cable, or the drive controller or memory or cpu. Don't assume.

rknichols 08-31-2013 12:51 PM

Quote:

Originally Posted by jefro (Post 5019444)
Yes, dd is a poor way to recover data from a damaged disk.

Not trying to use it to recover data, just to repair the drive.

The last resort for forcing a write to the bad sector would be hdparm with the "--write-sector" option:
Code:

hdparm --write-sector 625142447 /dev/sda
From the hdparm manpage:
--write-sector
Writes zeros to the specified sector number. VERY DANGEROUS. The sector number must be given (base10) after this flag. hdparm will issue a low-level write (completely bypassing the usual block layer read/write mechanisms) to the specified sector. This can be used to force a drive to repair a bad sector (media error).


All times are GMT -5. The time now is 10:35 PM.