Re: Linux: hotswap SCSI - after scanning drive doesn't appear
Hi,
I loose my problem by myself. I both cheap controller based on SIL3112 chipset
and I used them instead of via chipset on motherboard. Unfortunately it was
thesame. No drive was recognized with the scanning, after I delteted it.
But suddenly I tried unplug the drive (unplug the cable from the socket). I got
in logs, that SATA link is down. After I turned it on, the drive has appeared!
Well, hotplug works!
So, I don't need to pass any commnad to /sys/class/scsi....... I can just unplug
the drive. It is what I expected!
Unfortunately there is no such behavior with via chipset. Sometimes the computer
even hangs after I unpluged the drive when it was connected to the via socket.
On http://ata.wiki.kernel.org/ there is written in one place, that sata_via does
support the hotplug and in another place there is written, that it doesn't. But
now it doesn't matter.
The cheap controller with SIL3112 for 20$ makes for me a goot job.
Sergiusz
Sergiusz Brzezinski napisał(a):
> Hi,
>
> I would like change disk on the Linux box (hotswap) during system work.
> I have 2 SATA disks on via chipset (via_stata).
>
> Everywhere on groups is written, that:
>
> # echo "- - -" > /sys/class/scsi_host/host0/scan
>
> shoud recognize and connect the devices. But it doesn't work for mie
>
> Step by step, what I am doing:
>
> After system start devices are as follows:
>
> # lsscsi
> [0:0:0:0] disk ATA WDC WD1600AAJS-0 01.0 /dev/sda
> [1:0:0:0] disk ATA WDC WD1600AAJS-0 01.0 /dev/sdb
>
> # sg_scan
> /dev/sg0: scsi0 channel=0 id=0 lun=0 [em]
> /dev/sg1: scsi1 channel=0 id=0 lun=0 [em]
>
> # sg_map
> /dev/sg0 /dev/sda
> /dev/sg1 /dev/sdb
>
>
> # echo "- - -" > /sys/class/scsi_host/host0/scan
>
> in logs:
> Apr 15 11:00:11 serwer kernel: ata1: soft resetting port
> Apr 15 11:00:11 serwer kernel: ata1.00: configured for UDMA/133
> Apr 15 11:00:11 serwer kernel: ata1: EH complete
> Apr 15 11:00:11 serwer kernel: SCSI device sda: 312581808 512-byte hdwr
> sectors (160042 MB)
> Apr 15 11:00:11 serwer kernel: sda: Write Protect is off
> Apr 15 11:00:11 serwer kernel: sda: Mode Sense: 00 3a 00 00
> Apr 15 11:00:11 serwer kernel: SCSI device sda: drive cache: write back
>
> Now I remove the drive. The drive in NOT MOUNTED and is NOT in any
> RAID:
>
> # echo "1" > /sys/class/scsi_device/0:0:0:0/device/delete
>
> in logs:
> Apr 15 11:03:34 serwer kernel: Synchronizing SCSI cache for disk sda:
>
> # lsscsi
> [1:0:0:0] disk ATA WDC WD1600AAJS-0 01.0 /dev/sdb
>
> # sg_scan
> /dev/sg1: scsi1 channel=0 id=0 lun=0 [em]
>
> # sg_map
> /dev/sg0 not present
> /dev/sg1 /dev/sdb
>
> Everything pretty well. Now I want see my drive again (I didn't even
> plug it off).
>
> # echo "- - -" > /sys/class/scsi_host/host0/scan
>
> in logs:
> Apr 15 11:05:52 serwer kernel: ata1: soft resetting port
> Apr 15 11:05:52 serwer kernel: ata1.00: configured for UDMA/133
> Apr 15 11:05:52 serwer kernel: ata1: EH complete
>
> And every other command show thesame what was before scanning.
>
> AND MY DRIVE IS NOT THERE!
>
> any suggestions?
>
> thank's in advance
>
> Sergiusz
>
> ps
>
> I get thesame if I do:
>
> # echo "scsi remove-single-device 0 0 0 0" > /proc/scsi/scsi
> # echo "scsi add-single-device 0 0 0 0" > /proc/scsi/scsi
>