LSI HBA, Seagate SAS, wall has head size holes.

Murmaider

Cadet
Joined
Aug 6, 2022
Messages
4
I am starting a upgrade of my home server and want to go from my Ubunutu setup and go the TrueNAS route. I got myself a LSI SAS9211-8i HBA and 4 ebay Seagate ST2000NM0023 SAS drives to use as my main server storage setup. I installed the setup in an old box i had sitting around just to test things out but for the life of me, i cannot TureNAS or LinuxLite to properly read the drives. Both OSs think they are read only and only show up as 512 B available as seen here:
1660443055203.png


If i move the controller and drives into my Win10 system, it sees all the dives and can format, etc as it should be. Even formatting the drive in windows and moving to Linux the problem persists. DMESG does have errors but i dont know what to make of it.

Code:
[   15.769691] sd 0:0:0:0: [sda] physical block alignment offset: 3225468673
[   15.772131] sd 0:0:0:0: [sda] Sector size 0 reported, assuming 512.
[   15.775094] sd 0:0:0:0: [sda] 1 512-byte logical blocks: (512 B/512 B)
[   15.777275] sd 0:0:0:0: [sda] 0-byte physical blocks
[   15.779859] sd 0:0:0:0: [sda] Write Protect is on
[   15.781905] sd 0:0:0:0: [sda] Mode Sense: c1 c3 d1 d2
[   15.782504] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, supports DPO and FUA
[   15.801325] sd 0:0:0:0: [sda] Sector size 0 reported, assuming 512.
[   15.824825] Dev sda: unable to read RDB block 1
[   15.826869]  sda: unable to read partition table
[   15.828873] sda: partition table beyond EOD, enabling native capacity
[   15.831134] Dev sda: unable to read RDB block 1
[   15.833102]  sda: unable to read partition table
[   15.835030] sda: partition table beyond EOD, truncated
[   15.853491] sd 0:0:0:0: [sda] Sector size 0 reported, assuming 512.
[   15.857875] sd 0:0:0:0: [sda] Attached SCSI disk



My google fu cant seem to find anyone who has had the same issue. Not sure what to do next. Dont think its a bad hardware issue.

System with TrueNAS
TrueNAS-SCALE-22.02.2.1
Gigabyte GA-F2A88XM-D3H
AMD Athlon X4 860K
LSI SAS9211-8i HBA
Boot Drive Samsung 850 EVO 120GB
8GB RAM

Windows 10 Box
Asus PRIME X570-P
Ryzen 7 5800X
Same LSI SAS9211-8i HBA
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
It appears that the prior owner set this feature;

[ 15.779859] sd 0:0:0:0: [sda] Write Protect is on

The Linux program hdparm has the ability to remove write protect from SATA drives. I don't know if that will work on SAS drives.

-r Get/set read-only flag for the device. When set, Linux disallows write operations on the device.


The reason for this could be that they were used on a shared host. SAS drives have 2 host ports, and if used by one controller, it may have reserved the drives to prevent the other controller from a different host from over-writing the drives.
 

Murmaider

Cadet
Joined
Aug 6, 2022
Messages
4
So I fire off
Code:
root@truenas[~]# sudo hdparm -r0 /dev/sda

/dev/sda:
 setting readonly to 0 (off)
 readonly      =  0 (off)
root@truenas[~]#
root@truenas[~]# sudo hdparm -r /dev/sda

/dev/sda:
 readonly      =  0 (off)
root@truenas[~]#


But then go to format the drive and get "Error: [Errno 30] Read-only file system: '/dev/sda'"

Reboot the system and

Code:
root@truenas[~]# sudo hdparm -r /dev/sda

/dev/sda:
 readonly      =  1 (on)
root@truenas[~]# 


Tried it in the windows machine again and no problems at all. Diskpart doesn't think they are read only in the attributes. What gives?! About to just spring for some WD reds and call it a day.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
There is another option to preserve updated options over a device reset:

-k Get/set the "keep_settings_over_reset" flag for the drive.

See if you can get all the options using, and put in a reply:

-I Request identification info directly from the drive, which is displayed in a new expanded format with considerably more detail than with the older -i option.
 

Murmaider

Cadet
Joined
Aug 6, 2022
Messages
4
Interesting on sdb and sdc.

Code:
root@truenas[~]# sudo hdparm -I /dev/sda

/dev/sda:

ATA device, with non-removable media
Standards:
        Likely used: 1
Configuration:
        Logical         max     current
        cylinders       0       0
        heads           0       0
        sectors/track   0       0
        --
        Logical/Physical Sector size:           512 bytes
        device size with M = 1024*1024:           0 MBytes
        device size with M = 1000*1000:           0 MBytes
        cache/buffer size  = unknown
Capabilities:
        IORDY not likely
        Cannot perform double-word IO
        R/W multiple sector transfer: not supported
        DMA: not supported
        PIO: pio0
root@truenas[~]# sudo hdparm -I /dev/sdb

/dev/sdb:
SG_IO: bad/missing sense data, sb[]:  72 05 20 00 00 00 00 18 02 06 00 00 cf 00 00 00 03 02 00 01 81 0a 00 00 00 ff ff ff ff 00 ff ff
root@truenas[~]# sudo hdparm -I /dev/sdc

/dev/sdc:
SG_IO: bad/missing sense data, sb[]:  72 05 20 00 00 00 00 18 02 06 00 00 cf 00 00 00 03 02 00 01 81 0a 00 00 00 ff ff ff ff 00 ff ff
root@truenas[~]# sudo hdparm -I /dev/sdd

/dev/sdd:

ATA device, with non-removable media
Standards:
        Likely used: 1
Configuration:
        Logical         max     current
        cylinders       0       0
        heads           0       0
        sectors/track   0       0
        --
        Logical/Physical Sector size:           512 bytes
        device size with M = 1024*1024:           0 MBytes
        device size with M = 1000*1000:           0 MBytes
        cache/buffer size  = unknown
Capabilities:
        IORDY not likely
        Cannot perform double-word IO
        R/W multiple sector transfer: not supported
        DMA: not supported
        PIO: pio0
root@truenas[~]#


Also, when i apply -k i get
Code:
root@truenas[~]# sudo hdparm -k /dev/sda

/dev/sda:
 HDIO_GET_KEEPSETTINGS failed: Invalid argument
root@truenas[~]# sudo hdparm -k1 /dev/sda

/dev/sda:
 setting keep_settings to 1 (on)
 HDIO_SET_KEEPSETTINGS failed: Invalid argument
 HDIO_GET_KEEPSETTINGS failed: Invalid argument
root@truenas[~]#
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Well, it might have been too much to hope the "-k" option worked on SAS disks... They can save parameters, but "hdparm" may not work with them completely.

Other than SAS / SCSI tools, I don't have any other suggestions.
 

Murmaider

Cadet
Joined
Aug 6, 2022
Messages
4
Huzzah! Looks like it good now.. famous last words i know. I was about to put windows on the box just to see if there was something inherent to that hardware. Before i pulled that trigger, i decided to reflash the HBA with the BIOS rom back on just to see if there was anything in there i could tweak. Also, i just happened to jump into the system BIOS and saw i had a little overclock left in there from its previous life which i took out. Not sure what item did the trick but i can now see the drives as they should!

@Arwen thanks for the help anyway!
 
Top