Main Page | Report Page

 

  Computers Forum Index » Computer Architecture - Storage » How to scan for new disk in Linux(Redhat) without rebooting?

Author Message
Boll Weevil
Posted: Tue Dec 14, 2004 10:35 pm
 
I'll adding new disk from the EMC SAN and I am wondering if it's possible to
able to
mount the new disk without rebooting. So far fdisk or sfdisk will not see the
newly presented disk with a reboot.
 
vinayg@gmail.com
Posted: Tue Dec 14, 2004 11:35 pm
 
You can unload and load the HBA driver which will cause it to rescan
the SCSI devices:
$$ modprobe -r <hba-driver-module>
$$ modprobe <hba-driver-module>

For example if you have a qlogic 2300 hba:
$$ modprobe -r qla2300
$$ modprobe qla2300

Also take a look at the following for a slightly less disruptive
approach:
http://www.garloff.de/kurt/linux/scsidev/

Cheers,
Vinay
 
Christoph Hellwig
Posted: Wed Dec 15, 2004 12:35 am
 
On Tue, Dec 14, 2004 at 04:09:38PM -0800, RPR wrote:
Quote:
Did you use
echo "scsi add-single-device <hostadapter> <channel> <ID> <LUN>"
/proc/scsi/scsi
? That should do it.

In Versions < Linux 2.6 that's racy and may crash your machine,
especially if it's under heavy SCSI I/O load.
 
RPR
Posted: Wed Dec 15, 2004 12:35 am
 
Did you use
echo "scsi add-single-device <hostadapter> <channel> <ID> <LUN>"
Quote:
/proc/scsi/scsi
? That should do it.


Ralf-Peter
 
Maxim S. Shatskih
Posted: Wed Dec 15, 2004 1:35 am
 
Quote:
In Versions < Linux 2.6 that's racy and may crash your machine,
especially if it's under heavy SCSI I/O load.

How to do this in Windows - probably will be interesting for somebody.

On NT4, just run WINDISK (Disk Administrator), it rescans all SCSI/IDE busses
on startup.

On w2k and later, go to Device Manager and say "Scan For Hardware Changes". Or
download the free DEVCON.EXE tool from www.microsoft.com to do the same from
command line.

Nothing racy. :)

Detaching the disk devices. Impossible on NT4, Device Manager/Disable or Device
Manager/Uninstall (or DEVCON) on w2k and later. Note that if dismount of the
filesystems on this disk fails due to open files on them, then Windows will
suggest you to reboot immediately - such a funny feature of the Device Manager
UI Smile. You can neglect to reboot, but, on next reboot, the disk will be
disabled.

The rest of the detach procedure depends on your hardware.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
 
Yura Pismerov
Posted: Thu Dec 16, 2004 10:35 pm
 
BTW, why do you think you would be able to unload the driver module when it is busy ?

vinayg@gmail.com wrote:
Quote:
You can unload and load the HBA driver which will cause it to rescan
the SCSI devices:
$$ modprobe -r <hba-driver-module
$$ modprobe <hba-driver-module

For example if you have a qlogic 2300 hba:
$$ modprobe -r qla2300
$$ modprobe qla2300

Also take a look at the following for a slightly less disruptive
approach:
http://www.garloff.de/kurt/linux/scsidev/

Cheers,
Vinay

 
vinayg@gmail.com
Posted: Fri Dec 17, 2004 1:35 am
 
A bunch of vendors recommend doing it this way:

http://download.qlogic.com/drivers/21819/README.i2xLNX-v7.01.01.txt

<quote>
When adding logical drives to the storage subsystem with the
SMclient
you will need to unload the device driver and then modprobe the
driver
to scan the new logical drives.
</quote>

http://www-03.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/FLASH10321

(PS: I'm not saying that this is the best way in the world to do this)
Cheers,
Vinay
 
Don Khan
Posted: Fri Dec 17, 2004 2:35 am
 
"Christoph Hellwig" <hch@engr.sgi.com> wrote in message
news:20041215001739.GA13714@lst.de...
Quote:
On Tue, Dec 14, 2004 at 04:09:38PM -0800, RPR wrote:
Did you use
echo "scsi add-single-device <hostadapter> <channel> <ID> <LUN>"
/proc/scsi/scsi
? That should do it.

In Versions < Linux 2.6 that's racy and may crash your machine,
especially if it's under heavy SCSI I/O load.


It has also not been very reliable. It does not seem to work for adding new
LUNs to an existing target, something you will end up doing in a SAN
environment. In fact depending on the driver it may never work. I could not
even get the emulex driver to add new targets or LUNs, same for the Qlogic
cards. This is something I hope would be fixed in the 2.6 kernel. Most
modern operating systems supprot dynamic device reconfiguration (without
unloading the hba driver). Solaris, AIX, HP-UX, Dynix, Windows 200x all have
this feature.

-Don
 
Maxim S. Shatskih
Posted: Fri Dec 17, 2004 2:35 am
 
Quote:
unloading the hba driver). Solaris, AIX, HP-UX, Dynix, Windows 200x all have
this feature.

NT4 can dynamically load new HBA drivers and detect new devices, but cannot
handle removal.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
 
Yura Pismerov
Posted: Fri Dec 17, 2004 3:35 am
 
Funny, I am currently fighting DS4300 connected to pair of Qlogic 2312 HBAs...
What a coincidence ! Smile
As for the topic, would not scsiadd do the job ?
I never tried it on FC hardware, but it always worked fine for regular SCSI devices.


vinayg@gmail.com wrote:

Quote:
A bunch of vendors recommend doing it this way:

http://download.qlogic.com/drivers/21819/README.i2xLNX-v7.01.01.txt

quote
When adding logical drives to the storage subsystem with the
SMclient
you will need to unload the device driver and then modprobe the
driver
to scan the new logical drives.
/quote

http://www-03.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/FLASH10321

(PS: I'm not saying that this is the best way in the world to do this)
Cheers,
Vinay

 
Drink_Chai
Posted: Tue Dec 21, 2004 5:37 am
 
On 2004-12-17, Maxim S. Shatskih <maxim@storagecraft.com> wrote:
Quote:
unloading the hba driver). Solaris, AIX, HP-UX, Dynix, Windows 200x all have
this feature.

NT4 can dynamically load new HBA drivers and detect new devices, but cannot
handle removal.


EMC has this in the their knowedgebase for: "How to add new / remove used LUNs without rebooting Linux server"


printf "scsi remove-single-device %d %d %d %d" $controller $bus $target
$lun >>/proc/scsi/scsi

printf "scsi add-single-device %d %d %d %d" $controller $bus $target
$lun >>/proc/scsi/scsi
 
Stefan Schluppeck
Posted: Sat Jan 29, 2005 10:35 am
 
Hi Boll,


this is from the source-code qla-driver readme:

---schnipp---
8.5 Hot Add new LUNs
--------------------

This version supports hot adding new luns, etc. Please see text below on how
to perform the lun hot add procedure. The latest driver-v7.00.60-fo has the
mechanism which allows the user to force the driver to do re-scan of the
devices to allow a new device to be added. This triggers the driver to
initiate lun discovery process.

To do this from the command line:
#echo "scsi-qlascan" > /proc/scsi/<driver-name>/<adapter-id> (qlogic
driver will re-scan)

Where <driver-name> can be either one : qla2100/qla2200/qla2300 <adapter-id>
~ is the instance number of the HBA.

Once that has been done , user then can force the scsi mid layer to do
its own scan
and build the device table entry for the new device:
# echo "scsi add-single-device 0 1 2 3" >/proc/scsi/scsi
(scsi mid layer will re-scan) with "0 1 2 3"
replaced by your "Host Channel Id Lun". The scanning has to be done in
the above mentioned order.

First the driver (qla2300/qla2200 driver etc) and then the Linux scsi
mid layer.
---schnipp---


You take a look into "dmesg | less" and search for the information about
"Host Channel Id Lun", the Lun you have to know, from the Storage
Administrator.

echo "scsi-qlascan" > /proc/scsi/qla2200/1
echo "scsi-qlascan" > /proc/scsi/qla2200/2

echo "scsi add-single-device 1 0 0 6" >/proc/scsi/scsi

than take a look into "cat /proc/partions" if the pation is not there
you can do a "partprobe" (man partprobe).



--
Mit freundlichen Grüßen / With regards

Stefan Schluppeck






Boll Weevil wrote:
Quote:
I'll adding new disk from the EMC SAN and I am wondering if it's possible to
able to
mount the new disk without rebooting. So far fdisk or sfdisk will not see the
newly presented disk with a reboot.

 
Don Khan
Posted: Sun Jan 30, 2005 2:35 pm
 
"Stefan Schluppeck" <stefan@dr-big.de> wrote in message
news:36158jF4r3m1jU1@individual.net...
Quote:
Hi Boll,


this is from the source-code qla-driver readme:

---schnipp---
8.5 Hot Add new LUNs
--------------------

This version supports hot adding new luns, etc. Please see text below on
how
to perform the lun hot add procedure. The latest driver-v7.00.60-fo has
the
mechanism which allows the user to force the driver to do re-scan of the
devices to allow a new device to be added. This triggers the driver to
initiate lun discovery process.

To do this from the command line:
#echo "scsi-qlascan" > /proc/scsi/<driver-name>/<adapter-id> (qlogic
driver will re-scan)

Where <driver-name> can be either one : qla2100/qla2200/qla2300
adapter-id
~ is the instance number of the HBA.

Once that has been done , user then can force the scsi mid layer to do
its own scan
and build the device table entry for the new device:
# echo "scsi add-single-device 0 1 2 3" >/proc/scsi/scsi
(scsi mid layer will re-scan) with "0 1 2 3"
replaced by your "Host Channel Id Lun". The scanning has to be done in
the above mentioned order.

First the driver (qla2300/qla2200 driver etc) and then the Linux scsi
mid layer.


I'm wondering how this method affects the currently configured devices. For
example if host/channel/id/lun 0 1 1 2 is configured as /dev/sdb and 0 1 1
1 is then added. What device name is going to be used, the next device name
say /dev/sdc or does /dev/sdb now point to 0 1 1 1 and /dev/sdc points to 0
1 1 2. A similar situation is needed if a device is now removed. Do the
/dev/sd entries move up or do they remain unchanged. I'll have to test this,
in either case I'm more interested in the behavior on the 2.6 kernels.

-Don
 
Christoph Hellwig
Posted: Sun Jan 30, 2005 5:35 pm
 
On Sun, Jan 30, 2005 at 09:31:24AM -0500, Don Khan wrote:
Quote:
I'm wondering how this method affects the currently configured devices. For
example if host/channel/id/lun 0 1 1 2 is configured as /dev/sdb and 0 1 1
1 is then added. What device name is going to be used, the next device name
say /dev/sdc or does /dev/sdb now point to 0 1 1 1 and /dev/sdc points to 0
1 1 2. A similar situation is needed if a device is now removed. Do the
/dev/sd entries move up or do they remain unchanged. I'll have to test this,
in either case I'm more interested in the behavior on the 2.6 kernels.

When doing a bus reprobe already claimed devices remain unchanged.
 
 
Page 1 of 1    
All times are GMT
The time now is Sat Aug 30, 2014 2:35 am