January 19Jan 19 I ran into the issue that my SAS drive was formatted in emulated 512 bytes sector size and i low level formatted it into 4096 sector size. Since analyzing another problem with my SAS drive which took me several hours of headache (two new HBA cards and SAS drives) i formatted my drive to the specific native sector size. Here is my summary for anyone running into the same issue.Sources / inspiration:[Guide] Changing block size on SAS and SCSI drivesHow to reformat drive sector size | 520b 524b 528b to 512b or 4k@ArtofServer: thank you for your amazing content! 😀SettingParity check running - no docker container possible -> Ubuntu Playground could not be usedBroadcom 9500-8i PCI HBA Card (newest firmware version: FW Version = 37.00.00.00)Ultrastar DC HC560 SAS drive (WUH722020BL5204) (used drive from ebay)Required additional softwareCreate a directory /boot/extra, navigate to to the official Slackware page https://slackware.pkgs.org/15.0/slackware-patches-x86_64/sg3_utils-1.47-x86_64-2_slack15.0.txz.html, navigate to the Download section and copy the link to the binary files, download, install it and verify installation. Hint: all files in /boot/extra will get automatically installed at first boot.mkdir /boot/extra cd /boot/extra wget https://slackware.uk/slackware/slackware64-15.0/slackware64/l/sg3_utils-1.47-x86_64-1.txz installpkg sg3_utils-1.47-x86_64-1.txz whereis sg3_utilsGet drive informationGet the generic SCSI name of all devices and search for your specific drive, here drive WUH722020BL5204 has /dev/sg8.lsscsi -g[0:0:0:0] disk ATA ST20000NM007D-3D SN03 /dev/sdb /dev/sg1 [1:0:0:0] disk ATA ST20000NM007D-3D SN03 /dev/sdc /dev/sg2 [2:0:0:0] disk ATA ST20000NM007D-3D SN01 /dev/sdd /dev/sg3 [3:0:0:0] disk ATA ST20000NM007D-3D SN01 /dev/sde /dev/sg4 [4:0:0:0] disk ATA ST20000NM007D-3D SN01 /dev/sdf /dev/sg5 [5:0:0:0] disk ATA ST20000NM007D-3D SN01 /dev/sdg /dev/sg6 [7:0:0:0] disk ATA WDC WD5000LPVT-0 1A01 /dev/sdh /dev/sg7 [8:0:0:0] disk Kingston DataTraveler 3.0 PMAP /dev/sda /dev/sg0 [9:0:0:0] disk WDC WUH722020BL5204 C5C0 /dev/sdi /dev/sg8 [9:0:1:0] disk HGST HUH721212AL4200 DD08 /dev/sdj /dev/sg9 [9:0:2:0] enclosu BROADCOM VirtualSES 03 - /dev/sg10 [N:0:0:1] disk CT2000P310SSD8__1 /dev/nvme0n1 - [N:1:0:1] disk CT1000P310SSD8__1 /dev/nvme1n1 -Validate if the generic name shows the expected info with the sg3_scan command.sg_scan -i /dev/sgX/dev/sg8: scsi9 channel=0 id=0 lun=0 WDC WUH722020BL5204 C5C0 [rmb=0 cmdq=1 pqual=0 pdev=0x0]Check the current drive parameter in line Logical block length. Here it is 512 bytes and i want it to be 4096 bytes, according to the official datasheet Ultrastar DC HC560 page 2, Format: Sector size (bytes) 4Kn: 4096 (SAS Models row).Ensure that you follow the manufacturer's recommendations for sector sizes for your hard drive!sg_readcap /dev/sgXREAD CAPACITY (10) indicates device capacity too large now trying 16 byte cdb variant Read Capacity results: Protection: prot_en=0, p_type=0, p_i_exponent=0 Logical block provisioning: lbpme=0, lbprz=0 Last LBA=39063650303 (0x9185fffff), Number of logical blocks=39063650304 Logical block length=512 bytes Logical blocks per physical block exponent=3 [so physical block length=4096 bytes] Lowest aligned LBA=0 Hence: Device size: 20000588955648 bytes, 19074048.0 MiB, 20000.59 GB, 20.00 TBLow level formatAccording to @ArtofServerSometimes changing the sector size directly does not work. To do this, the disk must first be zeroed sg_format --format /dev/sgX and then the sector size changed sg_format --format --size=4096 /dev/sgX.I highly recommend to create a tmux session in order to prevent loss of connection during this step, since formatting will take several hours. Replace /dev/sgX with your specific generic drive name. After creating a new tmux session, a green highlighted lines at the end of your concosle will apear, indicating that you are in the tmux session. Just enter the sg_format command with your specific sector sizes values, here 4096 bytes.To detach tmux session: Ctrl+b then dTo reattach tmux session: tmux attach -t format_sessionTo list all tmux sessions: tmux lstmux new -s format_session sg_format -v --format --size=4096 /dev/sgXThis process took almost 24h for a 20TB drive. After the sg_format command is finished validate the sector size withsg_readcap /dev/sgXREAD CAPACITY (10) indicates device capacity too large now trying 16 byte cdb variant Read Capacity results: Protection: prot_en=0, p_type=0, p_i_exponent=0 Logical block provisioning: lbpme=0, lbprz=0 Last LBA=4882956287 (0x1230bffff), Number of logical blocks=4882956288 Logical block length=4096 bytes Logical blocks per physical block exponent=0 Lowest aligned LBA=0 Hence: Device size: 20000588955648 bytes, 19074048.0 MiB, 20000.59 GB, 20.00 TBTerminate the tmux sessiontmux kill-session -t session_nameHope this is helpful. Have a good one!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.