Skip to main content

Festplatte mit 0 Bytes - Unsupported sector size 520

Ich hatte SAS Server Festplatten auf Ebay gekauft, diese hatten eine Sector Größe von 520 statt 512, damit konnte mein Linux Server nicht arbeiten.
Ausgabe von lsblk:

root@thinkstation-d30:/home/jj# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0    7:0    0 111,9M  1 loop /snap/lxd/24322
loop1    7:1    0  63,3M  1 loop /snap/core20/1822
loop2    7:2    0  49,8M  1 loop /snap/snapd/18357
sda      8:0    0 232,9G  0 disk 
├─sda1   8:1    0     1G  0 part /boot/efi
└─sda2   8:2    0 231,8G  0 part /
sdb      8:80   1     0B  0 disk 
sdc      8:80   1     0B  0 disk 

Wenn man dann in /var/log/syslog guckt:

Mar  2 14:35:49 thinkstation-d30 kernel: [842811.011313] sd 6:0:21:0: [sdb] Unsupported sector size 520.
Mar  2 14:35:49 thinkstation-d30 kernel: [842811.011789] sd 6:0:21:0: [sdb] 0 512-byte logical blocks: (0 B/0 B)
Mar  2 14:35:49 thinkstation-d30 kernel: [842811.011793] sd 6:0:21:0: [sdb] 520-byte physical blocks
Mar  2 14:35:49 thinkstation-d30 kernel: [842811.012135] sd 6:0:21:0: [sdb] Test WP failed, assume Write Enabled
Mar  2 14:35:49 thinkstation-d30 kernel: [842811.012243] sd 6:0:21:0: [sdb] Asking for cache data failed
Mar  2 14:35:49 thinkstation-d30 kernel: [842811.012269] sd 6:0:21:0: [sdb] Assuming drive cache: write through
Mar  2 14:35:49 thinkstation-d30 kernel: [842811.015632] sd 6:0:21:0: [sdb] Spinning up disk...
Mar  2 14:35:49 thinkstation-d30 systemd-udevd[230768]: sdx: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/sdb' failed with exit code 1.


Mar  2 14:36:19 thinkstation-d30 kernel: [842840.707363] sd 6:0:21:0: [sdb] Unsupported sector size 520.
Mar  2 14:36:19 thinkstation-d30 kernel: [842840.708694] sd 6:0:21:0: [sdb] Write cache: disabled, read cache: enabled, supports DPO and FUA
Mar  2 14:36:19 thinkstation-d30 kernel: [842840.709171] sd 6:0:21:0: [sdb] Attached SCSI disk
Mar  2 14:37:08 thinkstation-d30 kernel: [842841.350666] ................................................
Mar  2 14:37:08 thinkstation-d30 kernel: [842889.668429] ata5: SATA link down (SStatus 0 SControl 300)
Mar  2 14:37:25 thinkstation-d30 kernel: [842890.498005] .................not responding...
Mar  2 14:37:25 thinkstation-d30 kernel: [842906.882025] sd 6:0:22:0: [sdb] Unsupported sector size 520.
Mar  2 14:37:25 thinkstation-d30 kernel: [842906.882508] sd 6:0:22:0: [sdb] 0 512-byte logical blocks: (0 B/0 B)
Mar  2 14:37:25 thinkstation-d30 kernel: [842906.882511] sd 6:0:22:0: [sdb] 520-byte physical blocks
Mar  2 14:37:25 thinkstation-d30 kernel: [842906.882865] sd 6:0:22:0: [sdb] Test WP failed, assume Write Enabled
Mar  2 14:37:25 thinkstation-d30 kernel: [842906.882975] sd 6:0:22:0: [sdb] Asking for cache data failed
Mar  2 14:37:25 thinkstation-d30 kernel: [842906.882998] sd 6:0:22:0: [sdb] Assuming drive cache: write through
Mar  2 14:37:25 thinkstation-d30 kernel: [842906.884748] sd 6:0:22:0: [sdb] Spinning up disk...
Mar  2 14:37:25 thinkstation-d30 systemd-udevd[234836]: sdb: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/sdb' failed with exit code 1.
Mar  2 14:37:34 thinkstation-d30 kernel: [842907.905767] .........ready
Mar  2 14:37:34 thinkstation-d30 kernel: [842916.098275] sd 6:0:22:0: [sdb] Unsupported sector size 520.
Mar  2 14:37:34 thinkstation-d30 kernel: [842916.099587] sd 6:0:22:0: [sdb] Write cache: disabled, read cache: enabled, supports DPO and FUA
Mar  2 14:37:34 thinkstation-d30 kernel: [842916.100070] sd 6:0:22:0: [sdb] Attached SCSI disk
Mar  2 14:38:39 thinkstation-d30 kernel: [842981.024812] sd 7:0:0:4: [sdj] Media removed, stopped polling
Mar  2 14:39:41 thinkstation-d30 kernel: [843042.682033] sd 6:0:22:0: device_block, handle(0x001b)
Mar  2 14:39:51 thinkstation-d30 kernel: [843052.431519] sd 6:0:22:0: device_unblock and setting to running, handle(0x001b)
Mar  2 14:39:51 thinkstation-d30 kernel: [843052.793769] mpt2sas_cm0: mpt3sas_transport_port_remove: removed: sas_addr(0x5000c5006338f78e)
Mar  2 14:39:51 thinkstation-d30 kernel: [843052.793778] mpt2sas_cm0: removing handle(0x001b), sas_addr(0x5000c5006338f78e)
Mar  2 14:39:51 thinkstation-d30 kernel: [843052.793781] mpt2sas_cm0: enclosure logical id(0x5d4ae524852be97e), slot(14)
Mar  2 14:41:03 thinkstation-d30 kernel: [843124.431788] mpt2sas_cm0: handle(0x1b) sas_address(0x5000c5006338f78e) port_type(0x1)
Mar  2 14:41:03 thinkstation-d30 kernel: [843124.493757] scsi 6:0:23:0: Direct-Access     SEAGATE  ST910006CLAR1000 AS0C PQ: 0 ANSI: 5
Mar  2 14:41:03 thinkstation-d30 kernel: [843124.493781] scsi 6:0:23:0: SSP: handle(0x001b), sas_addr(0x5000c5006338f78e), phy(14), device_name(0x00c500508ef73863)
Mar  2 14:41:03 thinkstation-d30 kernel: [843124.493784] scsi 6:0:23:0: enclosure logical id (0x5d4ae524852be97e), slot(14) 
Mar  2 14:41:03 thinkstation-d30 kernel: [843124.493793] scsi 6:0:23:0: qdepth(254), tagged(1), scsi_level(6), cmd_que(1)
Mar  2 14:41:03 thinkstation-d30 kernel: [843124.493897] scsi 6:0:23:0: Power-on or device reset occurred
Mar  2 14:41:03 thinkstation-d30 kernel: [843124.495280] sd 6:0:23:0: [sdb] Spinning up disk...
Mar  2 14:41:03 thinkstation-d30 kernel: [843124.495417] sd 6:0:23:0: Attached scsi generic sg26 type 0
Mar  2 14:41:03 thinkstation-d30 kernel: [843124.495748]  end_device-6:0:22: add: handle(0x001b), sas_addr(0x5000c5006338f78e)

Also passt hier die Sector Größe nicht, diese kann man aber mit den Befehl "sg_format" anpassen:

sg_format /dev/disk/by-id/scsi-SSEAGATE_ST910006CLAR1000_9XG86B5W_0000C526KTTB -v --format --size=512

Ich habe hier lieber by-id genutzt, da ich mir nicht sicher bin, wie gut sdb da funktioniert hätte und ich eh die Seriennummer auf der Festplatte lesen kann.
Je nach Größe dauert das schon seine paar Stunden, er fragt anfangs noch ein paar mal, ob die Festplatte wirklich gelöscht werden soll.
Wenn man nichts macht, führt er es einfach aus.

Am Ende kommt dann sowas:

Format unit in progress, 99.01% done
Format unit in progress, 99.20% done
Format unit in progress, 99.38% done
Format unit in progress, 99.56% done
Format unit in progress, 99.74% done
Format unit in progress, 99.92% done
FORMAT UNIT Complete
root@thinkstation-d30:/home/jj#

 In lsblk:

root@thinkstation-d30:/home/jj# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0    7:0    0 111,9M  1 loop /snap/lxd/24322
loop1    7:1    0  63,3M  1 loop /snap/core20/1822
loop2    7:2    0  49,8M  1 loop /snap/snapd/18357
sda      8:0    0 232,9G  0 disk 
├─sda1   8:1    0     1G  0 part /boot/efi
└─sda2   8:2    0 231,8G  0 part /
sdb     65:112  0 931,5G  0 disk 
sdc     65:128  0 931,5G  0 disk 

Danach kann die Festplatte ganz normal genutzt werden...