HTFC Forums

H.T.F.C.

How To Fix Computers





Go Back   HTFC Forums > Hardware Newsgroups > Storage > SCSI

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1  
Old 04-15-2008, 11:24 AM
Sergiusz Brzezinski
 
Posts: n/a
Default Linux: hotswap SCSI - after scanning drive doesn't appear

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

Reply With Quote
Sponsored Links
Fix your Windows Problems - FAST.
FREE Safe Scan Registry Check. Locate & Fix Errors in Minutes!
  #2  
Old 04-15-2008, 02:18 PM
Michael Baeuerle
 
Posts: n/a
Default Re: Linux: hotswap SCSI - after scanning drive doesn't appear

Sergiusz Brzezinski wrote:
>
> [Disk removed and added again]
> AND MY DRIVE IS NOT THERE!
>
> 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


On this machine (Kernel 2.6.24.2) /dev/sdc is a real SCSI harddisk and
/dev/sdd is an USB stick:
----------------------------------------------------------------------
[root@WStation2:~]# sg_map -x
/dev/sg0 0 0 0 0 0 /dev/sda
/dev/sg1 0 0 1 0 0 /dev/sdb
/dev/sg2 0 0 3 0 1 /dev/st0
/dev/sg3 0 0 5 0 5 /dev/scd0
/dev/sg4 0 0 6 0 5 /dev/scd1
/dev/sg5 1 0 0 0 0 /dev/sdc
/dev/sg6 2 0 0 0 0 /dev/sdd
[root@WStation2:~]# echo "scsi remove-single-device 1 0 0 0"
>/proc/scsi/scsi

[root@WStation2:~]# sg_map -x
/dev/sg0 0 0 0 0 0 /dev/sda
/dev/sg1 0 0 1 0 0 /dev/sdb
/dev/sg2 0 0 3 0 1 /dev/st0
/dev/sg3 0 0 5 0 5 /dev/scd0
/dev/sg4 0 0 6 0 5 /dev/scd1
/dev/sg5 -1 -1 -1 -1 -1
/dev/sg6 2 0 0 0 0 /dev/sdd
[root@WStation2:~]# echo "scsi add-single-device 1 0 0 0"
>/proc/scsi/scsi

[root@WStation2:~]# sg_map -x
/dev/sg0 0 0 0 0 0 /dev/sda
/dev/sg1 0 0 1 0 0 /dev/sdb
/dev/sg2 0 0 3 0 1 /dev/st0
/dev/sg3 0 0 5 0 5 /dev/scd0
/dev/sg4 0 0 6 0 5 /dev/scd1
/dev/sg5 1 0 0 0 0 /dev/sdc
/dev/sg6 2 0 0 0 0 /dev/sdd
[root@WStation2:~]# echo "scsi remove-single-device 2 0 0 0"
>/proc/scsi/scsi

[root@WStation2:~]# sg_map -x
/dev/sg0 0 0 0 0 0 /dev/sda
/dev/sg1 0 0 1 0 0 /dev/sdb
/dev/sg2 0 0 3 0 1 /dev/st0
/dev/sg3 0 0 5 0 5 /dev/scd0
/dev/sg4 0 0 6 0 5 /dev/scd1
/dev/sg5 1 0 0 0 0 /dev/sdc
[root@WStation2:~]# echo "scsi add-single-device 2 0 0 0"
>/proc/scsi/scsi

[root@WStation2:~]# sg_map -x
/dev/sg0 0 0 0 0 0 /dev/sda
/dev/sg1 0 0 1 0 0 /dev/sdb
/dev/sg2 0 0 3 0 1 /dev/st0
/dev/sg3 0 0 5 0 5 /dev/scd0
/dev/sg4 0 0 6 0 5 /dev/scd1
/dev/sg5 1 0 0 0 0 /dev/sdc
/dev/sg6 2 0 0 0 0 /dev/sdd
----------------------------------------------------------------------
Both can be removed and re-added.

Looks for me like the SCSI code in the kernel works as expected and your
problem is caused by the the ATA/SCSI mapping code in libata.


Micha
Reply With Quote
  #3  
Old 04-24-2008, 12:16 PM
Sergiusz Brzezinski
 
Posts: n/a
Default 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
>



--
http://www.supersystem.pl Profesjonalna obsługa IT
sklepy internetowe, ochrona antywirusowa
Reply With Quote
Sponsored Links
Fix your Windows Problems - FAST.
FREE Safe Scan Registry Check. Locate & Fix Errors in Minutes!
Reply


Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
scsi hard drive cecleachman@hotmail.com SCSI 7 03-17-2008 02:30 AM
Recover corrupt bios? Hotswap+ wire+new PLCC socket??? saturnlee@yahoo.com Hardware 9 11-21-2007 12:38 AM
ATA or SCSI drive Robert Windows XP 5 07-23-2007 09:23 PM
Ext Mac SCSI Drive for use with XP Pro aRKay Windows XP Basics 6 04-06-2007 11:56 PM
"Delayed Write Failed" ... Scsi-Sata Conflict Or Malfunctioning Scsi Drive? sl@hotmail.com SCSI 6 03-30-2007 02:38 AM


All times are GMT. The time now is 08:54 PM.


Powered by vBulletin® Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© 2004 - 2007 Web-S-Sense Pty. Ltd. Usenet and forums posts © their respective authors.
Ad Management by RedTyger