Bug 427259

Summary: add scsi scan rescan tool
Product: [Fedora] Fedora Reporter: Juha Tuomala <tuju>
Component: sg3_utilsAssignee: Dan Horák <dan>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: andriusb, coughlan, dhorak, herrold, marting, pkoutoupis, xdl-redhat-bugzilla
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://www.garloff.de/kurt/linux/rescan-scsi-bus.sh-1.25
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-11-27 18:22:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 507379    

Description Juha Tuomala 2008-01-02 15:21:28 UTC
Description of problem:

Page:
 
  http://www.garloff.de/kurt/linux/

has scsi bus rescan script, similar that can already be
found from HP-UX and others. I think it should be added 
into sg3_utils or scsi-utils pakage as its own.

Now rescanning scsi bus in live system involves way too
much manual woodoo.

Expected results:

Easy to use system.

Comment 1 Juha Tuomala 2008-01-12 15:02:17 UTC
ping? any comments?

Comment 2 Juha Tuomala 2008-07-09 15:14:30 UTC
Does the sg_scan do the same from sg3_utils pkg?

https://admin.fedoraproject.org/pkgdb/packages/name/sg3_utils

don't have my scsi stuff hooked atm so can't try myself.

Comment 3 Juha Tuomala 2008-07-09 15:15:17 UTC
Another related pkg is:

https://admin.fedoraproject.org/pkgdb/packages/name/scsi-target-utils

thou it seems to be bit more specific.

Comment 4 Petros Koutoupis 2008-07-25 14:27:06 UTC
The problem with a SCSI rescan tool is that there may be issues in scanning if 
you are attached to an RAID controller whereas the loop is handled somewhat 
differently from a traditional JBOD. Forcing the Linux SCSI Layer to pick up 
these disk devices (LUNs) mapped from the RAID controller will not reveal any 
new devices.

Another problem with an automatic scanning is if your LUN mappings change and 
you have some of the devices already mounted. Let us say SCSI Device <0 0 0 0> 
is assigned a major/minor by sd_mod and udev allocates /dev/sda to it. You 
format and mount /dev/sda to /mnt and use it.

If the LUN mapping changes where now the SCSI Device is mapped as <0 0 0 1> and 
you invoke a rescan, forgetting that the older mapping is still mounted under 
the previously assigned major/minor/sda identifiers the /mnt mounted path is 
now stuck and in some cases using an umount operation will have it get stuck in 
flushing all cached pages and post a lot of SCSI I/O errors 
in /var/log/messages.

In a logical case, you would know that the mapping changes but in some, such as 
in LSI mpt fusion drivers, by default they enable hot pluggable support and if 
a path goes down (unknowingly to you and may later come back up) it has been 
known to cause some severe damage.

The SCSI Layer on Linux 2.6 supports hot plugging, it is the Host Bus Adapters 
(HBAs) that usually do not, and I say for good reason.

Comment 5 Bug Zapper 2008-11-26 09:15:17 UTC
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Dan Horák 2008-11-27 14:48:37 UTC

*** This bug has been marked as a duplicate of bug 469628 ***

Comment 7 Juha Tuomala 2008-11-27 16:46:51 UTC
*** Bug 469628 has been marked as a duplicate of this bug. ***

Comment 8 Juha Tuomala 2008-11-27 16:49:43 UTC
Dan, you didn't know that # is 427259 smaller than 469628 like is   date 2008-01-02 earlier to 2008-11-03?

Comment 9 Dan Horák 2008-11-27 18:22:12 UTC
Sure I know what bug is older, but I also know what bug I have worked on and closed earlier.

The rescan script is already included in the sg3_utils package.

Comment 10 Juha Tuomala 2008-11-27 19:16:46 UTC
> Sure I know what bug is older, but I also know what bug I have worked 
> on and closed earlier.

All right, Danny.

Comment 11 Juha Tuomala 2009-05-19 11:38:15 UTC
(In reply to comment #9)

> The rescan script is already included in the sg3_utils package.  


$ file $(rpm -q sg3_utils -l|grep bin)|grep -c -v ELF
0

Is it?

Comment 12 Juha Tuomala 2009-05-19 11:53:16 UTC
Group: Applications/System
Source0: http://sg.danny.cz/sg/p/sg3_utils-%{version}.tgz
Source1: http://www.garloff.de/kurt/linux/rescan-scsi-bus.sh-%{rescan_version}
URL: http://sg.danny.cz/sg/sg3_utils.html
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

It appears to be added into f10 branch but has not been built yet. Could you look this to the end as all it appears to need is rebuilding and testing?

Comment 14 Juha Tuomala 2009-05-19 13:35:31 UTC
/usr/bin/rescan-scsi-bus.sh

How about renaming it to /usr/sbin/scsi-rescan  ? Now it's not obvious name and that makes it harder to find with scsi<tab> command helping.

Comment 15 Fedora Update System 2009-06-23 10:03:15 UTC
sg3_utils-1.26-2.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/sg3_utils-1.26-2.fc10

Comment 16 Dan Horák 2009-06-23 10:08:22 UTC
(In reply to comment #14)
> /usr/bin/rescan-scsi-bus.sh
> 
> How about renaming it to /usr/sbin/scsi-rescan  ? Now it's not obvious name and
> that makes it harder to find with scsi<tab> command helping.  

I think I will keep the upstream name and create a symlink with more obvious name.

Comment 17 Juha Tuomala 2009-06-25 08:53:46 UTC
Did you already make the symlink? This entry is CLOSED and will be forgotten if you don't do it now. Also, imo the .sh extension is not needed.

Comment 18 Dan Horák 2009-06-25 09:12:41 UTC
(In reply to comment #17)
> Did you already make the symlink? This entry is CLOSED and will be forgotten if
> you don't do it now. Also, imo the .sh extension is not needed.  

The symlink is planned for next release. Could you open a new bug to track it? At least OpenSuSE distributes the script under its original name (rescan-scsi-bus.sh) and I will also use it as the primary name.

Comment 19 Juha Tuomala 2009-06-25 09:23:18 UTC
imo such tiny thing doesn't need own bug. put a post-it paper to your monitor frame for it :)

i requested the upstream to rename the whole beast.

Comment 20 Fedora Update System 2009-07-16 07:08:01 UTC
sg3_utils-1.26-2.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.