Device: /dev/sda, 1 Currently unreadable (pending) sectors

Aus NOBAQ
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „<section begin="head"/> I sometimes get these annoying messages from smartd. They only occur with Samsung HD103SIS SATA disks. According to my google research, th…“)
 
 
Zeile 2: Zeile 2:
 
I sometimes get these annoying messages from smartd. They only occur with Samsung HD103SIS SATA disks. According to my google research, these messages are not harmful and a Samsung speciality. One reason for me to avoid Samsung in future. The messages should disappear after a reboot. However, since the disks are built into a RAID1 on a 24x7 server I want to avoid rebooting the server. Instead I can get rid of these messages without a reboot when overwriting the whole disk with zeros. Please click [[Device: /dev/sda, 1 Currently unreadable (pending) sectors|here]] for details.
 
I sometimes get these annoying messages from smartd. They only occur with Samsung HD103SIS SATA disks. According to my google research, these messages are not harmful and a Samsung speciality. One reason for me to avoid Samsung in future. The messages should disappear after a reboot. However, since the disks are built into a RAID1 on a 24x7 server I want to avoid rebooting the server. Instead I can get rid of these messages without a reboot when overwriting the whole disk with zeros. Please click [[Device: /dev/sda, 1 Currently unreadable (pending) sectors|here]] for details.
 
<section end="head"/>
 
<section end="head"/>
 +
 +
== Removing the disk from the array ==
 +
 +
The first step is remove the corresponding disk from the array. This is first done by failing the disk and afterwards removing it. In my case, the disk is part of three RAID1 volumes md0, md1 and md2:
 +
 +
mdadm --manage /dev/md0 --fail /dev/sda1
 +
mdadm --manage /dev/md0 --remove /dev/sda1
 +
 +
mdadm --manage /dev/md2 --fail /dev/sda3
 +
mdadm --manage /dev/md2 --remove /dev/sda3
 +
 +
mdadm --manage /dev/md1 --fail /dev/sda4
 +
mdadm --manage /dev/md1 --remove /dev/sda4
 +
 +
== Zeroing the disk ==
 +
 +
Since the disk is removed from the RAID it is safe now to overwrite is with zeroes. As soon as the disk is completely zeroed out, the messages disappear. In my case, the disk is 1TB:
 +
 +
cat /dev/zero | pv -s 1000G | dd of=/dev/sda bs=100M
 +
 +
== Recreate partition layout ==
 +
 +
Now you have to recreate the partition layout with fdisk or cfdisk. In my case, the two RAID1 disks are identical, so I can copy the partition layout from the other disk:
 +
 +
sfdisk -d /dev/sdb | sfdisk /dev/sda
 +
sfdisk -R /dev/sda
 +
 +
== Adding the disk to the RAID ==
 +
 +
This is simple as before:
 +
 +
mdadm --manage /dev/md0 --add /dev/sda1
 +
mdadm --manage /dev/md2 --add /dev/sda3
 +
mdadm --manage /dev/md1 --add /dev/sda4
 +
 +
== reinstall grub ==
 +
 +
In my case I installed grub on both disks. In case of failure of a single disk, the system is always fully bootable and running.
 +
 +
grub-install /dev/sda
 +
 +
Or if you use symbolic names (like me), just reinstall on both devices:
 +
 +
grub-install /dev/disk/by-id/scsi-SATA_SAMSUNG_HD103SIS1VSJ1KS300499
 +
grub-install /dev/disk/by-id/scsi-SATA_SAMSUNG_HD103SIS1VSJ1KS300505
  
 
= Comments =
 
= Comments =

Aktuelle Version vom 2. Mai 2011, 14:13 Uhr

I sometimes get these annoying messages from smartd. They only occur with Samsung HD103SIS SATA disks. According to my google research, these messages are not harmful and a Samsung speciality. One reason for me to avoid Samsung in future. The messages should disappear after a reboot. However, since the disks are built into a RAID1 on a 24x7 server I want to avoid rebooting the server. Instead I can get rid of these messages without a reboot when overwriting the whole disk with zeros. Please click here for details.


Inhaltsverzeichnis

[Bearbeiten] Removing the disk from the array

The first step is remove the corresponding disk from the array. This is first done by failing the disk and afterwards removing it. In my case, the disk is part of three RAID1 volumes md0, md1 and md2:

mdadm --manage /dev/md0 --fail /dev/sda1
mdadm --manage /dev/md0 --remove /dev/sda1

mdadm --manage /dev/md2 --fail /dev/sda3
mdadm --manage /dev/md2 --remove /dev/sda3

mdadm --manage /dev/md1 --fail /dev/sda4
mdadm --manage /dev/md1 --remove /dev/sda4

[Bearbeiten] Zeroing the disk

Since the disk is removed from the RAID it is safe now to overwrite is with zeroes. As soon as the disk is completely zeroed out, the messages disappear. In my case, the disk is 1TB:

cat /dev/zero | pv -s 1000G | dd of=/dev/sda bs=100M

[Bearbeiten] Recreate partition layout

Now you have to recreate the partition layout with fdisk or cfdisk. In my case, the two RAID1 disks are identical, so I can copy the partition layout from the other disk:

sfdisk -d /dev/sdb | sfdisk /dev/sda 
sfdisk -R /dev/sda

[Bearbeiten] Adding the disk to the RAID

This is simple as before:

mdadm --manage /dev/md0 --add /dev/sda1
mdadm --manage /dev/md2 --add /dev/sda3
mdadm --manage /dev/md1 --add /dev/sda4

[Bearbeiten] reinstall grub

In my case I installed grub on both disks. In case of failure of a single disk, the system is always fully bootable and running.

grub-install /dev/sda

Or if you use symbolic names (like me), just reinstall on both devices:

grub-install /dev/disk/by-id/scsi-SATA_SAMSUNG_HD103SIS1VSJ1KS300499
grub-install /dev/disk/by-id/scsi-SATA_SAMSUNG_HD103SIS1VSJ1KS300505

[Bearbeiten] Comments

[Bearbeiten] Niki Hammler meinte …

30. August 2012

One additional comment: The problem is NOT solved by rebooting. It seems that zeroing out is necessary :-(

--Niki Hammler

[Bearbeiten] mike meinte …

26. Dezember 2012

hello! i have /dev/sdb 3TB

how to perform Zeroing the disk for 3TB


cat /dev/zero | pv -s 3000G | dd of=/dev/sda bs=100M


or this is not right ? please show the correct command


I'm afraid to make a mistake


--mike

[Bearbeiten] Niki meinte …

29. Dezember 2012

Are you sure you have the same config as I (RAID1)?

Only in this case my howto makes sense, otherwise you will destroy all your data!!


If you are sure (really sure!) then the disk in the command must match:


cat /dev/zero | pv -s 3000G | dd of=/dev/sdb bs=100M



--Niki

[Bearbeiten] James Hightower meinte …

13. Juni 2013

I think your can skip the zero-ing part. Unless you have write-intent bitmaps enabled, then just removing and re-adding a drive will cause MD to overwrite the entire disk, including your pending-bad blocks. Thiis has worked for me many times. Remember, though, that the SMART Offline_Uncorrectable won't get updated until the next offline collection occours, like with smartctl -t offline.

--James Hightower

[Bearbeiten] Niki meinte …

14. Juni 2013

Dear James,


Thank your for your comment! I will try it our the next time I encounter the message!


Niki

--Niki
Meine Werkzeuge