LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 06: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, 06:30 AM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
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, 06: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, 06:48 AM   #4
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

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

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-10-2013, 11:02 PM   #6
piradeep
LQ Newbie
 
Registered: May 2012
Distribution: RedHat/CentOS
Posts: 27

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


Reply



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 02:10 PM
Command explaination? ggarrette Linux - Newbie 2 07-02-2008 11:16 AM
script explaination maooah Programming 4 06-01-2008 01:30 AM
Userdel command , Need explaination srihariv Linux - General 4 03-07-2008 02:57 AM
Command to discover new LUNS with QLOGIC HBA mr_mightyman Red Hat 1 10-04-2006 02:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:31 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
Open Source Consulting | Domain Registration