How to scan for new disk in Linux(Redhat) without rebooting?
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
How to scan for new disk in Linux(Redhat) without rebooting?

 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Storage System
Author Message
Boll Weevil
Guest





Posted: Wed Dec 15, 2004 3:00 am    Post subject: How to scan for new disk in Linux(Redhat) without rebooting? Reply with 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.
Back to top
vinayg@gmail.com
Guest





Posted: Wed Dec 15, 2004 4:00 am    Post subject: Re: How to scan for new disk in Linux(Redhat) without reboot Reply with 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
Back to top
RPR
Guest





Posted: Wed Dec 15, 2004 4:40 am    Post subject: Re: How to scan for new disk in Linux(Redhat) without reboot Reply with quote

Did you use
echo "scsi add-single-device <hostadapter> <channel> <ID> <LUN>"
Quote:
/proc/scsi/scsi
? That should do it.


Ralf-Peter
Back to top
Christoph Hellwig
Guest





Posted: Wed Dec 15, 2004 4:40 am    Post subject: Re: How to scan for new disk in Linux(Redhat) without reboot Reply with quote

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.
Back to top
Maxim S. Shatskih
Guest





Posted: Wed Dec 15, 2004 4:40 am    Post subject: Re: How to scan for new disk in Linux(Redhat) without reboot Reply with quote

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 :). 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
Back to top
Yura Pismerov
Guest





Posted: Fri Dec 17, 2004 2:45 am    Post subject: Re: How to scan for new disk in Linux(Redhat) without reboot Reply with quote

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
Back to top
vinayg@gmail.com
Guest





Posted: Fri Dec 17, 2004 4:43 am    Post subject: Re: How to scan for new disk in Linux(Redhat) without reboot Reply with 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
Back to top
Don Khan
Guest





Posted: Fri Dec 17, 2004 4:43 am    Post subject: Re: How to scan for new disk in Linux(Redhat) without reboot Reply with quote

"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
Back to top
Maxim S. Shatskih
Guest





Posted: Fri Dec 17, 2004 4:43 am    Post subject: Re: How to scan for new disk in Linux(Redhat) without reboot Reply with quote

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
Back to top
Yura Pismerov
Guest





Posted: Fri Dec 17, 2004 4:43 am    Post subject: Re: How to scan for new disk in Linux(Redhat) without reboot Reply with quote

Funny, I am currently fighting DS4300 connected to pair of Qlogic 2312 HBAs...
What a coincidence ! :)
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
Back to top
Drink_Chai
Guest





Posted: Tue Dec 21, 2004 7:59 am    Post subject: Re: How to scan for new disk in Linux(Redhat) without reboot Reply with quote

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
Back to top
Stefan Schluppeck
Guest





Posted: Sat Jan 29, 2005 3:01 pm    Post subject: Re: How to scan for new disk in Linux(Redhat) without reboot Reply with 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.
---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.
Back to top
Don Khan
Guest





Posted: Sun Jan 30, 2005 7:31 pm    Post subject: Re: How to scan for new disk in Linux(Redhat) without reboot Reply with quote

"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
Back to top
Christoph Hellwig
Guest





Posted: Sun Jan 30, 2005 9:56 pm    Post subject: Re: How to scan for new disk in Linux(Redhat) without reboot Reply with quote

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.
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Storage System All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB