Does reformatting an ext4 partition fix bad sectors, and what are they anyway?

h3x
2021-01-12T20:55:56Z

My Linux desktop is having a bit of difficulty with bad sectors. Lately I've had to boot into recovery and run an fsck a few times to try to fix a problem where the OS drops into read-only mode at the drop of a hat. Today I tried copying some files from one directory to another and got the following error message:
cp: error reading "foo/bar": Input/output error

I've just booted into a live USB and run fsck /dev/sda1 -c and it fixed a load of bad sectors, but the above error message is still happening.

A bit of googling tells me that this is down to bad sectors on the SSD, and I'm not really sure what that means. Is anybody able to enlighten me? And as a follow-up question, would reformatting the hard drive resolve the problem, or are there any other things I can try to fix it?

Comments URL: https://tildes.net/~comp/uik/does_reformatting_an_ext4_partition_fix_bad_sectors_and_what_are_they_anyway

Votes: 9

Comments: 21