On 13/01/2020 23:57, Dāvis Mosāns wrote:
pirmd., 2020. g. 13. janv., plkst. 11:51 — lietotājs John Garry
(<john.garry@xxxxxxxxxx>) rakstīja:
If you just want to rest the disk, you can reset the PHY to which the
disk is attached through sysfs, which is essentially is same as ejecting
and reinserting the disk:
2. Go to PHY sysfs folder and disable+enable the PHY:
Awesome, this works great for me.
Thanks!
I have tried:
$ echo 1 > /sys/block/sdf/device/delete
$ echo '- - -' > /sys/class/scsi_host/host0/scan
but it doesn't work as it doesn't detect any new drives.
I'm not sure if this is the correct method.
Searching on internet it's most common suggestion and I didn't saw
anything else.
https://unix.stackexchange.com/a/404408/51019
.
So this works on my HBA which uses libsas:
root@ubuntu:~# echo 1 > /sys/block/sdf/device/delete
root@ubuntu:~# fdisk -l
Disk /dev/sdb: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3875281E-32EA-404B-B0AD-FCAC27BDE061
Device Start End Sectors Size Type
/dev/sdb1 2048 14037134 14035087 6.7G Linux filesystem
/dev/sdb2 14039040 781403713 767364674 365.9G Linux filesystem
/dev/sdb3 781404160 7814037134 7032632975 3.3T Linux filesystem
Disk /dev/sdd: 279.5 GiB, 300069052416 bytes, 586072368 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 186.3 GiB, 200049647616 bytes, 390721968 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 131072 bytes
Disklabel type: gpt
Disk identifier: EAFDDE26-1C4A-408E-922E-B87F73F144AE
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 390721535 389670912 185.8G Linux filesystem
Disk /dev/sdc: 186.3 GiB, 200049647616 bytes, 390721968 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 131072 bytes
Disklabel type: gpt
Disk identifier: 300604F0-7782-FF48-A2E8-7358D80434C8
Device Start End Sectors Size Type
/dev/sdc1 2048 1000000 997953 487.3M EFI System
/dev/sdc2 1001472 2000000 998529 487.6M Linux RAID
/dev/sdc3 2000896 390721934 388721039 185.4G Linux RAID
Disk /dev/sde: 186.3 GiB, 200049647616 bytes, 390721968 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 131072 bytes
Disklabel type: gpt
Disk identifier: 0C412946-1EFE-FD44-8EF3-246E6DCC64E6
Device Start End Sectors Size Type
/dev/sde1 2048 1000000 997953 487.3M EFI System
/dev/sde2 1001472 2000000 998529 487.6M Linux RAID
/dev/sde3 2000896 390721934 388721039 185.4G Linux RAID
Disk /dev/sdh: 186.3 GiB, 200049647616 bytes, 390721968 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 131072 bytes
Disk /dev/sdg: 186.3 GiB, 200049647616 bytes, 390721968 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 131072 bytes
root@ubuntu:~# echo '- - -' > /sys/class/scsi_host/host0/scan
[321323.142794] scsi 0:0:5:0: Direct-Access SanDisk LT0200MO
P404 PQ: 0 ANSI: 6
root@ubuntu:~# [321323.654846] sd 0:0:5:0: [sdf] 390721968 512-byte
logical blocks: (200 GB/186 GiB)
[321323.696872] sd 0:0:5:0: [sdf] Write Protect is off
[321323.701776] sd 0:0:5:0: [sdf] Mode Sense: cf 00 10 08
[321323.778903] sd 0:0:5:0: [sdf] Write cache: disabled, read cache:
disabled, supports DPO and FUA
[321323.901542] sd 0:0:5:0: [sdf] Optimal transfer size 131072 bytes
[321324.441562] sdf: sdf1 sdf2 sdf3
[321325.122283] sd 0:0:5:0: [sdf] Attached SCSI disk
root@ubuntu:~#
I'm not sure what's going wrong with mvsas. The actual code for
triggering the scan is generic.
Cheers,
John