Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hey, everyone. I'm running Linux Mint 21.3 MATE with the OS in an SSD and /home mounted on an HDD (sda).
A couple of days ago I started having an issue where my desktop would crash because /home would remount itself as RO. Going through the syslog I found this:
Googling it I came across this post here which seems to be more or less the same issue. So apparently the HDD is dying, but if I understood correctly there could be a way of zeroing the offending blocks or somehow mark them as non-usable and keep it going a while longer? I'm shaky on the block arithmetic, though, I'd be worried about zeroing where I shouldn't.
Here's some more info for context:
Code:
smartctl -a /dev/sda
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.15.0-102-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Seagate FireCuda 2.5
Device Model: ST1000LX015-1U7172
Serial Number: WL1PSNC2
LU WWN Device Id: 5 000c50 0bec95d7b
Firmware Version: SDM1
User Capacity: 1.000.204.886.016 bytes [1,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Form Factor: 2.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-3 T13/2161-D revision 3b
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Fri Apr 19 21:53:39 2024 -03
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: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
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: (0x79) SMART execute Offline immediate.
No Auto Offline data collection support.
Suspend Offline collection upon new
command.
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: ( 165) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x3035) SCT Status 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 049 043 006 Pre-fail Always - 112585528
3 Spin_Up_Time 0x0003 099 099 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 097 097 020 Old_age Always - 3818
5 Reallocated_Sector_Ct 0x0033 097 095 036 Pre-fail Always - 1768
7 Seek_Error_Rate 0x000f 072 060 045 Pre-fail Always - 34497004209
9 Power_On_Hours 0x0032 083 083 000 Old_age Always - 15701 (150 99 0)
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 098 098 020 Old_age Always - 2695
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 001 001 000 Old_age Always - 4430
188 Command_Timeout 0x0032 100 095 000 Old_age Always - 390848577647
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 070 047 040 Old_age Always - 30 (Min/Max 26/30)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 94
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 781
193 Load_Cycle_Count 0x0032 097 097 000 Old_age Always - 7848
194 Temperature_Celsius 0x0022 030 053 000 Old_age Always - 30 (0 13 0 0 0)
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 8
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 8
199 UDMA_CRC_Error_Count 0x003e 200 197 000 Old_age Always - 199
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 15493h+19m+44.280s
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 10194754103
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 6031171545
254 Free_Fall_Sensor 0x0032 100 100 000 Old_age Always - 0
SMART Error Log Version: 1
ATA Error Count: 4430 (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 4430 occurred at disk power-on lifetime: 12753 hours (531 days + 9 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 2d+15:31:10.378 READ FPDMA QUEUED
ef 10 03 00 00 00 a0 00 2d+15:31:10.369 SET FEATURES [Enable SATA feature]
ef 10 02 00 00 00 a0 00 2d+15:31:10.360 SET FEATURES [Enable SATA feature]
27 00 00 00 00 00 e0 00 2d+15:31:10.332 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
ec 00 00 00 00 00 a0 00 2d+15:31:10.293 IDENTIFY DEVICE
Error 4429 occurred at disk power-on lifetime: 12753 hours (531 days + 9 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 2d+15:31:09.670 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 2d+15:31:09.669 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 2d+15:31:09.669 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 2d+15:31:09.669 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 2d+15:31:09.669 READ FPDMA QUEUED
Error 4428 occurred at disk power-on lifetime: 12753 hours (531 days + 9 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 00 ff ff ff 4f 00 2d+15:31:08.877 READ FPDMA QUEUED
60 00 00 ff ff ff 4f 00 2d+15:31:08.253 READ FPDMA QUEUED
60 00 00 ff ff ff 4f 00 2d+15:31:07.708 READ FPDMA QUEUED
60 00 00 ff ff ff 4f 00 2d+15:31:06.855 READ FPDMA QUEUED
60 00 00 ff ff ff 4f 00 2d+15:31:06.074 READ FPDMA QUEUED
Error 4427 occurred at disk power-on lifetime: 12117 hours (504 days + 21 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 06:32:00.391 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 06:32:00.377 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 06:32:00.376 READ FPDMA QUEUED
ef 10 03 00 00 00 a0 00 06:32:00.366 SET FEATURES [Enable SATA feature]
ef 10 02 00 00 00 a0 00 06:32:00.357 SET FEATURES [Enable SATA feature]
Error 4426 occurred at disk power-on lifetime: 12117 hours (504 days + 21 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 06:31:59.672 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 06:31:58.747 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 06:31:58.747 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 06:31:58.747 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 06:31:58.746 READ FPDMA QUEUED
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 15689 -
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.
and also:
Code:
sudo fdisk -l /dev/sda
Disk /dev/sda: 931,51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000LX015-1U71
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 589B5C00-2D73-45A3-A01D-D16061168728
Device Start End Sectors Size Type
/dev/sda1 34 32767 32734 16M Microsoft reserved
/dev/sda2 32768 1953521663 1953488896 931,5G Microsoft basic data
Partition 1 does not start on physical sector boundary.
Could someone point me in the right direction? Is it possible to get rid of those bad blocks, and if so, could you explain the appropriate math?
Replace this dying SATA-HDD with a SSD with capacity of 1 TB or above: Choose a NVMe-SSD if possible, otherwise a SATA-SSD. Enjoy performance boost of SDD against awfully slow HDD.
I/O or Input/Output errors usually are an indicator of a hardware problem.
First, I'd suggest checking /etc/fstab with an editor. I expect you'll find the option
Code:
errors=remount,ro
and get that out of the options for the offending disk.
Next, rescue what data you can from there. Back it up, preferably to another disk. You can reinstall a system. But the files in /home & /etc are very handy to have.
Then, go at the disk. Badblocks is a program designed to ferret these out and mark them as bad. Then, depending on your filesystem, there will be tools of varying quality to try and repair it. If you have another OS or a live usb or something, best work from there.
If you're replying, try to give as much info as possible about your setup. You can see it, but not us. How_To_Ask_a_Question
If you like living dangerously, 'e2fsck -fccky <device>' will non-destructively scan for bad blocks, mark them, try to continue. Warning: takes hours, cannot be aborted (without fscking filesystem, that is), back up first. But that's a mighty thin ice you'll be walking on, over 4000 errors...
But that's a mighty thin ice you'll be walking on, over 4000 errors...
and counting. In my experience, once you start getting a bunch of bad sectors they only multiply with time. You can mark the bad blocks today with e2fsck and have a hundred new ones tomorrow. Backup and replace that drive.
hey, everyone, thanks for your answers. I checked fstab but it doesn't have that option set for sda2
Code:
# /home was on /dev/sda2 during installation
UUID=76f164d7-d8a7-49d5-b690-faff032025a3 /home ext4 defaults 0 2
I booted up using a Mint 21.3 live USB and am currently trying to backup everything I can. Then I'll go with badblocks overnight, as I expect it will take quite a while to finish, so tomorrow morning it'll be complete.
After reading the man page I was thinking of going with
Code:
badblocks -sn -b 4096
, unless someone suggests something better based on the provided info. Perhaps
Code:
e2fsck -fccky <device>
would be a better option running from this live USB?
Like I said, this HDD only has /home in it, the rest of the OS (including /etc) is in a different partition in a different drive (an SSD with this Linux and a Windows partition). I can provide as much information as necessary, if anyone thinks of anything else that might be useful to diagnose, let me know the appropriate commands and I'll reply back with the info. The idea is to try and save this HDD insofar as it is possible. Buying a new one would be a last resort.
The e2fsck option does a check with badblocks. It's the -c option, so in fact you're doing 2 checks. The -k appends to any already recorded bad blocks, but the '-y' gives it the go ahead in advance. I wouldn't forgive e2fsck's sins in advance when you might decide to bale out.
You have multiple ropey sections and a rewrite was forced on them. There are many reasons for bad sectors, but physical damage is one of them. Now you're sending your heads over and over the bad sections. This has two problems
Your bad sections might pretend to be good for a few days, causing the system to write on them.
Any detritus the heads picked up from the bad areas could be spread over other parts of the disk, compounding the problem.
Now ask yourself: Are you going to learn the hard lesson, or are you going to get everything you value off that disk, so you won't care when it expires?
I would caution the OP from purchasing and using a consumer aimed HDD or SSD and recommend that he/she instead opt for a HDD aimed at home office / Small business which userally have a High Mean time between failure which means that they means that said you will need to be willing to pay $2 to $3 USD more per GB.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.