Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Guide] Low level formatting SAS drives

Featured Replies

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 drives

How to reformat drive sector size | 520b 524b 528b to 512b or 4k

@ArtofServer: thank you for your amazing content! 😀

Setting

Parity check running - no docker container possible -> Ubuntu Playground could not be used

Broadcom 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 software

Create 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_utils

Get drive information

Get 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/sgX
READ 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 TB

Low level format

According to @ArtofServer

Sometimes 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 d

To reattach tmux session: tmux attach -t format_session

To list all tmux sessions: tmux ls

tmux new -s format_session
sg_format -v --format --size=4096 /dev/sgX

This process took almost 24h for a 20TB drive. After the sg_format command is finished validate the sector size with

sg_readcap /dev/sgX
READ 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 TB

Terminate the tmux session

tmux kill-session -t session_name

Hope 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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.