LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-28-2006, 11:05 PM   #1
osiosi
LQ Newbie
 
Registered: Jun 2006
Posts: 10

Rep: Reputation: 0
Question How do you scan for all the disk drives on a system.


I am a newbie on Linux, I need to know how do I scan for all the disk drives on a system, like on Sun we can run format and on HPUX we have ioscan. Is there a similar command on RedHat Linux.


Thanks
 
Old 06-28-2006, 11:22 PM   #2
devhen
LQ Newbie
 
Registered: Mar 2001
Location: SLC, UT
Distribution: RHEL4, CentOS 4, Fedora 5, Ubuntu
Posts: 24

Rep: Reputation: 15
hmm... df will show you the mounted drives and their capacity/use. fdisk should do the rest for you.
 
Old 06-28-2006, 11:44 PM   #3
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
fdisk -l or cat /proc/partitions should show you the list of known partitions.
 
Old 06-29-2006, 10:22 AM   #4
osiosi
LQ Newbie
 
Registered: Jun 2006
Posts: 10

Original Poster
Rep: Reputation: 0
Actually I am more concerned about the disks which are on the system but they have not been partitioned or mounted, for example a brand new disk on the system but not used atall so how would a new SA would know if there is this disk sitting on the system not being utilized.
 
Old 06-29-2006, 11:04 AM   #5
migantc1
LQ Newbie
 
Registered: Aug 2005
Posts: 11

Rep: Reputation: 0
You can try running lvmdiskscan it will show you everthing lvm can see even the disk that are not being used.
 
Old 06-29-2006, 12:12 PM   #6
osiosi
LQ Newbie
 
Registered: Jun 2006
Posts: 10

Original Poster
Rep: Reputation: 0
What about the disks that are not under LVM meaning not being partitioned or initialized.
 
Old 06-29-2006, 01:56 PM   #7
devhen
LQ Newbie
 
Registered: Mar 2001
Location: SLC, UT
Distribution: RHEL4, CentOS 4, Fedora 5, Ubuntu
Posts: 24

Rep: Reputation: 15
try running fdisk on the usual devices. for example, if your system uses ATA try

Quote:
/sbin/fdisk /dev/hda
/sbin/fdisk /dev/hdb
/sbin/fdisk /dev/hdc
and so on. you'll get an 'unable to open dev/hdx' message if there is no drive present. another note: on more recent systems fdisk is in /sbin/ or /usr/sbin/ so simply 'fdisk' will give you an unknown command error. run the program as above, with the full path.

alternatively, if your system uses SATA your drives would most likely be at /dev/sda, /dev/sdb, /dev/sdc, etc.

Last edited by devhen; 06-29-2006 at 01:59 PM.
 
Old 06-29-2006, 03:25 PM   #8
osiosi
LQ Newbie
 
Registered: Jun 2006
Posts: 10

Original Poster
Rep: Reputation: 0
thanks Devin. So there is no one command that could determine all the disks on a system, a new person really needs to search in the system for the disks.


thanks
 
Old 06-30-2006, 12:10 AM   #9
avijitp
Member
 
Registered: May 2005
Location: India
Distribution: FC11, Debian/Ubuntu, RHEL, Solaris, AIX, HP-UX
Posts: 161

Rep: Reputation: 32
just run:
Quote:
/sbin/fdisk -l |grep Disk | awk '{print $2}'|awk -F\: '{print $1}'
This will show the drives attached to the running system.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
scan hot plug drives support !! vinay_r99 Linux - Hardware 5 07-08-2008 12:10 AM
No disk scan after hard shutdown Maestro485 Slackware 5 07-02-2005 12:28 PM
Scan disk for linux? djgerbavore Linux - General 8 12-28-2004 08:34 AM
How can I turn off the auto scan for SATA drives during boot? Mike23 Linux - Hardware 5 05-06-2004 04:16 AM
DVD-ROM + CD-RW with XCDROAST - not detecting drives during scan rehab junkie *BSD 9 01-03-2004 04:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:54 AM.

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