Gentoo Archives: gentoo-user

From: Laurence Perkins <lperkins@×××××××.net>
To: "gentoo-user@l.g.o" <gentoo-user@l.g.o>
Subject: RE: [gentoo-user] Re: e2fsck -c when bad blocks are in existing file?
Date: Mon, 14 Nov 2022 16:38:02
In Reply to: [gentoo-user] Re: e2fsck -c when bad blocks are in existing file? by Grant Edwards
1 >
2 >
3 > -----Original Message-----
4 > From: Grant Edwards <grant.b.edwards@×××××.com>
5 > Sent: Saturday, November 12, 2022 7:55 PM
6 > To: gentoo-user@l.g.o
7 > Subject: [gentoo-user] Re: e2fsck -c when bad blocks are in existing file?
8 >
9 > On 2022-11-12, Michael <confabulate@××××××××.com> wrote:
10 >
11 > > Have your questions been answered satisfactorily by Lawrence's contribution?
12 >
13 > Yes, Lawrence's experiment answered the my question: e2fsck adds the bad block to the "bad block" inode and leaves it also allocated to the existing file.
14 >
15 > Presumably if you don't allow it to clone the block, reading that file will return an error when it gets to the bad block. Once you delete that file, the bad block will never get reallocated by the filesystem since it still belongs to the bad block inode.
16 >
17 > The failing SSD that prompted the question has now been replaced and a fresh Gentoo system installed on the new drive. I never did figure out which files contained the bad blocks (there were 37 bad blocks, IIRC). They apparently didn't belong to any of the files I copied over to the replacement drive.
18 >
19 > The old drive was a Samsung 850 EVO SATA drive, and the new one is a Samsung 980 PRO M.2 drive. The new one is noticably faster than the old one (which in turn was way faster than the spinning platter drive it had replaced).
20 >
21 > --
22 > Grant
24 Multiply-allocated blocks won't cause an error by themselves. They can just cause strange and unexpected munging of your data if two files are scribbling on the same patch of disk. So if you leave it allocated to both then you can use a more intelligent tool to either coax one more read out of it or potentially replace the lost data with some substitute.
26 I'm not sure what fsck will do with a read error while cloning the block since my test "disk" wasn't actually bad. Presumably fill the bad section with nulls.
28 LMP