LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-03-2013, 07:08 AM   #1
piradeep
LQ Newbie
 
Registered: May 2012
Distribution: RedHat/CentOS
Posts: 27

Rep: Reputation: Disabled
Deecting luns - Any explaination for the command


I recently had an opportunity to see how luns are scanned. Just need help in understanding the below command.

# echo "- - -" > /sys/class/scsi_host/host1/scan

I am not sure what "- - -" explains? Anyone?
 
Old 11-03-2013, 07:30 AM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,036

Rep: Reputation: 96
The /sys folder in Linux is special in that the files in the structure are intended to provide an interface with the Linux kernel directly.

As such, when you are writing "- - -" to the /sys/class/scsi_host/host1/scan special file, you are sending a request to the Linux kernel to scan the scsi connections on the scsi bus "host1"
 
1 members found this post helpful.
Old 11-03-2013, 07:40 AM   #3
piradeep
LQ Newbie
 
Registered: May 2012
Distribution: RedHat/CentOS
Posts: 27

Original Poster
Rep: Reputation: Disabled
Thanks a lot. And, what if we give "1" instead of "- - -". Does it make any difference?
 
Old 11-03-2013, 07:48 AM   #4
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,036

Rep: Reputation: 96
I would imagine that the kernel developers decided to use "- - -" specifically and that it would not accept other input.
 
Old 11-03-2013, 07:58 AM   #5
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
Each SCSI controller can have a number of buses, each bus can serve a number of devices, and each device can have one or more Logical Units.

The dashes act as wildcards. "- - -" simply means "scan all buses, all devices and all LUNs". The string "0 - -" would mean "scan all devices and LUNs on bus 0", while "- - 0" would mean "scan LUN 0 on all devices on all buses".

If you try to reference a non-existent bus/device/LUN, echo will return "write error: Invalid argument".
 
1 members found this post helpful.
Old 11-11-2013, 12:02 AM   #6
piradeep
LQ Newbie
 
Registered: May 2012
Distribution: RedHat/CentOS
Posts: 27

Original Poster
Rep: Reputation: Disabled
Thank you very much.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command explaination? for OpenNMS install ggarrette Linux - Software 3 07-03-2008 03:10 PM
Command explaination? ggarrette Linux - Newbie 2 07-02-2008 12:16 PM
script explaination maooah Programming 4 06-01-2008 02:30 AM
Userdel command , Need explaination srihariv Linux - General 4 03-07-2008 03:57 AM
Command to discover new LUNS with QLOGIC HBA mr_mightyman Red Hat 1 10-04-2006 03:03 PM


All times are GMT -5. The time now is 12:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration