Coping with bad sectors on RAID disk
up vote
0
down vote
favorite
I have a RAID 1 of 2 hard drives managed with mdadm
. Today, one of them failed. I figured out that this is because of bad sectors in /dev/sdb
. According to badblocks
, these sectors are affected: 1028, 1029, 1030, 1031
. In /dev/sdb1
(the only partition on the hard drive), they are sectors 4, 5, 6, 7
. I performed a read-only test.
After googling the problem, I found out that you can instruct a file system to cope with bad blocks. But what do you do if the affected region isn't used directly by any file system but by a RAID manager instead?
I guess that in my case I could simply move the partition a bit to the right. But what would you do if the fault was somewhere in the middle of the drive? Is moving the partition a bit to the right the proper solution for my problem?
raid mdadm software-raid raid1 badblocks
|
show 1 more comment
up vote
0
down vote
favorite
I have a RAID 1 of 2 hard drives managed with mdadm
. Today, one of them failed. I figured out that this is because of bad sectors in /dev/sdb
. According to badblocks
, these sectors are affected: 1028, 1029, 1030, 1031
. In /dev/sdb1
(the only partition on the hard drive), they are sectors 4, 5, 6, 7
. I performed a read-only test.
After googling the problem, I found out that you can instruct a file system to cope with bad blocks. But what do you do if the affected region isn't used directly by any file system but by a RAID manager instead?
I guess that in my case I could simply move the partition a bit to the right. But what would you do if the fault was somewhere in the middle of the drive? Is moving the partition a bit to the right the proper solution for my problem?
raid mdadm software-raid raid1 badblocks
The more interesting question is why you actually seebadblocks
, because on most modern hard drives, bad sectors get mapped away transparently. So even if you tell Linux to ignore these blocks, it won't help. Did you inspect the SMART values on the drives?
– dirkt
2 days ago
@dirkt I usedbadblocks
in read-only mode several times. It always found the same bad blocks. When I used it in write mode, it didn't find any. I thendd
ed binary zeros over the beginning of the drive and ranbadblocks
in read-only mode again. It didn't find any bad blocks. These are the SMART values of the drive: pastebin.com/Lnk15KuD I find it particularly confusing that it says 0 bad sectors there. To me, this sounds like that the drive isn't even compensating for bad sectors internally.
– UTF-8
2 days ago
Not finding bad blocks in write mode/after writing zeros suggests the harddisk remapped the sectors, or that it was able to correct the problem somehow during the write. A reallocated sector count of zero suggests the latter. In any case, now you won't need to tell the file system about the bad blocks, because they are no longer bad. You may have to reinitialize the RAID info part, though, and I wouldn't store any important data on this disk.
– dirkt
2 days ago
@dirkt Do you mean because the disk might fail again soon or because of undetected data corruption? Is the latter made more likely by the disk having experienced bad blocks? Because I don't see much of a problem with the former as there is another copy on the data on/dev/sda
, of course.
– UTF-8
yesterday
Because it might fail again soon. The harddisk detected the problem just fine, so I'm not sure what you mean by "undetected data corruption".
– dirkt
yesterday
|
show 1 more comment
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a RAID 1 of 2 hard drives managed with mdadm
. Today, one of them failed. I figured out that this is because of bad sectors in /dev/sdb
. According to badblocks
, these sectors are affected: 1028, 1029, 1030, 1031
. In /dev/sdb1
(the only partition on the hard drive), they are sectors 4, 5, 6, 7
. I performed a read-only test.
After googling the problem, I found out that you can instruct a file system to cope with bad blocks. But what do you do if the affected region isn't used directly by any file system but by a RAID manager instead?
I guess that in my case I could simply move the partition a bit to the right. But what would you do if the fault was somewhere in the middle of the drive? Is moving the partition a bit to the right the proper solution for my problem?
raid mdadm software-raid raid1 badblocks
I have a RAID 1 of 2 hard drives managed with mdadm
. Today, one of them failed. I figured out that this is because of bad sectors in /dev/sdb
. According to badblocks
, these sectors are affected: 1028, 1029, 1030, 1031
. In /dev/sdb1
(the only partition on the hard drive), they are sectors 4, 5, 6, 7
. I performed a read-only test.
After googling the problem, I found out that you can instruct a file system to cope with bad blocks. But what do you do if the affected region isn't used directly by any file system but by a RAID manager instead?
I guess that in my case I could simply move the partition a bit to the right. But what would you do if the fault was somewhere in the middle of the drive? Is moving the partition a bit to the right the proper solution for my problem?
raid mdadm software-raid raid1 badblocks
raid mdadm software-raid raid1 badblocks
edited Dec 4 at 15:37
asked Dec 4 at 15:15
UTF-8
1,197724
1,197724
The more interesting question is why you actually seebadblocks
, because on most modern hard drives, bad sectors get mapped away transparently. So even if you tell Linux to ignore these blocks, it won't help. Did you inspect the SMART values on the drives?
– dirkt
2 days ago
@dirkt I usedbadblocks
in read-only mode several times. It always found the same bad blocks. When I used it in write mode, it didn't find any. I thendd
ed binary zeros over the beginning of the drive and ranbadblocks
in read-only mode again. It didn't find any bad blocks. These are the SMART values of the drive: pastebin.com/Lnk15KuD I find it particularly confusing that it says 0 bad sectors there. To me, this sounds like that the drive isn't even compensating for bad sectors internally.
– UTF-8
2 days ago
Not finding bad blocks in write mode/after writing zeros suggests the harddisk remapped the sectors, or that it was able to correct the problem somehow during the write. A reallocated sector count of zero suggests the latter. In any case, now you won't need to tell the file system about the bad blocks, because they are no longer bad. You may have to reinitialize the RAID info part, though, and I wouldn't store any important data on this disk.
– dirkt
2 days ago
@dirkt Do you mean because the disk might fail again soon or because of undetected data corruption? Is the latter made more likely by the disk having experienced bad blocks? Because I don't see much of a problem with the former as there is another copy on the data on/dev/sda
, of course.
– UTF-8
yesterday
Because it might fail again soon. The harddisk detected the problem just fine, so I'm not sure what you mean by "undetected data corruption".
– dirkt
yesterday
|
show 1 more comment
The more interesting question is why you actually seebadblocks
, because on most modern hard drives, bad sectors get mapped away transparently. So even if you tell Linux to ignore these blocks, it won't help. Did you inspect the SMART values on the drives?
– dirkt
2 days ago
@dirkt I usedbadblocks
in read-only mode several times. It always found the same bad blocks. When I used it in write mode, it didn't find any. I thendd
ed binary zeros over the beginning of the drive and ranbadblocks
in read-only mode again. It didn't find any bad blocks. These are the SMART values of the drive: pastebin.com/Lnk15KuD I find it particularly confusing that it says 0 bad sectors there. To me, this sounds like that the drive isn't even compensating for bad sectors internally.
– UTF-8
2 days ago
Not finding bad blocks in write mode/after writing zeros suggests the harddisk remapped the sectors, or that it was able to correct the problem somehow during the write. A reallocated sector count of zero suggests the latter. In any case, now you won't need to tell the file system about the bad blocks, because they are no longer bad. You may have to reinitialize the RAID info part, though, and I wouldn't store any important data on this disk.
– dirkt
2 days ago
@dirkt Do you mean because the disk might fail again soon or because of undetected data corruption? Is the latter made more likely by the disk having experienced bad blocks? Because I don't see much of a problem with the former as there is another copy on the data on/dev/sda
, of course.
– UTF-8
yesterday
Because it might fail again soon. The harddisk detected the problem just fine, so I'm not sure what you mean by "undetected data corruption".
– dirkt
yesterday
The more interesting question is why you actually see
badblocks
, because on most modern hard drives, bad sectors get mapped away transparently. So even if you tell Linux to ignore these blocks, it won't help. Did you inspect the SMART values on the drives?– dirkt
2 days ago
The more interesting question is why you actually see
badblocks
, because on most modern hard drives, bad sectors get mapped away transparently. So even if you tell Linux to ignore these blocks, it won't help. Did you inspect the SMART values on the drives?– dirkt
2 days ago
@dirkt I used
badblocks
in read-only mode several times. It always found the same bad blocks. When I used it in write mode, it didn't find any. I then dd
ed binary zeros over the beginning of the drive and ran badblocks
in read-only mode again. It didn't find any bad blocks. These are the SMART values of the drive: pastebin.com/Lnk15KuD I find it particularly confusing that it says 0 bad sectors there. To me, this sounds like that the drive isn't even compensating for bad sectors internally.– UTF-8
2 days ago
@dirkt I used
badblocks
in read-only mode several times. It always found the same bad blocks. When I used it in write mode, it didn't find any. I then dd
ed binary zeros over the beginning of the drive and ran badblocks
in read-only mode again. It didn't find any bad blocks. These are the SMART values of the drive: pastebin.com/Lnk15KuD I find it particularly confusing that it says 0 bad sectors there. To me, this sounds like that the drive isn't even compensating for bad sectors internally.– UTF-8
2 days ago
Not finding bad blocks in write mode/after writing zeros suggests the harddisk remapped the sectors, or that it was able to correct the problem somehow during the write. A reallocated sector count of zero suggests the latter. In any case, now you won't need to tell the file system about the bad blocks, because they are no longer bad. You may have to reinitialize the RAID info part, though, and I wouldn't store any important data on this disk.
– dirkt
2 days ago
Not finding bad blocks in write mode/after writing zeros suggests the harddisk remapped the sectors, or that it was able to correct the problem somehow during the write. A reallocated sector count of zero suggests the latter. In any case, now you won't need to tell the file system about the bad blocks, because they are no longer bad. You may have to reinitialize the RAID info part, though, and I wouldn't store any important data on this disk.
– dirkt
2 days ago
@dirkt Do you mean because the disk might fail again soon or because of undetected data corruption? Is the latter made more likely by the disk having experienced bad blocks? Because I don't see much of a problem with the former as there is another copy on the data on
/dev/sda
, of course.– UTF-8
yesterday
@dirkt Do you mean because the disk might fail again soon or because of undetected data corruption? Is the latter made more likely by the disk having experienced bad blocks? Because I don't see much of a problem with the former as there is another copy on the data on
/dev/sda
, of course.– UTF-8
yesterday
Because it might fail again soon. The harddisk detected the problem just fine, so I'm not sure what you mean by "undetected data corruption".
– dirkt
yesterday
Because it might fail again soon. The harddisk detected the problem just fine, so I'm not sure what you mean by "undetected data corruption".
– dirkt
yesterday
|
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f485914%2fcoping-with-bad-sectors-on-raid-disk%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The more interesting question is why you actually see
badblocks
, because on most modern hard drives, bad sectors get mapped away transparently. So even if you tell Linux to ignore these blocks, it won't help. Did you inspect the SMART values on the drives?– dirkt
2 days ago
@dirkt I used
badblocks
in read-only mode several times. It always found the same bad blocks. When I used it in write mode, it didn't find any. I thendd
ed binary zeros over the beginning of the drive and ranbadblocks
in read-only mode again. It didn't find any bad blocks. These are the SMART values of the drive: pastebin.com/Lnk15KuD I find it particularly confusing that it says 0 bad sectors there. To me, this sounds like that the drive isn't even compensating for bad sectors internally.– UTF-8
2 days ago
Not finding bad blocks in write mode/after writing zeros suggests the harddisk remapped the sectors, or that it was able to correct the problem somehow during the write. A reallocated sector count of zero suggests the latter. In any case, now you won't need to tell the file system about the bad blocks, because they are no longer bad. You may have to reinitialize the RAID info part, though, and I wouldn't store any important data on this disk.
– dirkt
2 days ago
@dirkt Do you mean because the disk might fail again soon or because of undetected data corruption? Is the latter made more likely by the disk having experienced bad blocks? Because I don't see much of a problem with the former as there is another copy on the data on
/dev/sda
, of course.– UTF-8
yesterday
Because it might fail again soon. The harddisk detected the problem just fine, so I'm not sure what you mean by "undetected data corruption".
– dirkt
yesterday