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?










share|improve this question
























  • 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
    Dec 5 at 8:37










  • @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 dded 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
    Dec 5 at 11:41










  • 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
    Dec 5 at 11:58










  • @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
    Dec 6 at 9:34










  • 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
    Dec 6 at 9:42















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?










share|improve this question
























  • 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
    Dec 5 at 8:37










  • @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 dded 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
    Dec 5 at 11:41










  • 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
    Dec 5 at 11:58










  • @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
    Dec 6 at 9:34










  • 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
    Dec 6 at 9:42













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?










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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
    Dec 5 at 8:37










  • @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 dded 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
    Dec 5 at 11:41










  • 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
    Dec 5 at 11:58










  • @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
    Dec 6 at 9:34










  • 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
    Dec 6 at 9:42


















  • 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
    Dec 5 at 8:37










  • @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 dded 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
    Dec 5 at 11:41










  • 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
    Dec 5 at 11:58










  • @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
    Dec 6 at 9:34










  • 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
    Dec 6 at 9:42
















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
Dec 5 at 8:37




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
Dec 5 at 8:37












@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 dded 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
Dec 5 at 11:41




@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 dded 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
Dec 5 at 11:41












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
Dec 5 at 11:58




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
Dec 5 at 11:58












@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
Dec 6 at 9:34




@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
Dec 6 at 9:34












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
Dec 6 at 9:42




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
Dec 6 at 9:42















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Morgemoulin

Scott Moir

Souastre