LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
LinkBack Search this Thread
Old 01-10-2005, 02:55 PM   #1
mali
LQ Newbie
 
Registered: Sep 2004
Posts: 10

Rep: Reputation: 0
Number of hard disks/drives info?


Hi,

I have a server with Linux Ent. 3, and I'm trying to find out how many hard disks does it have (thru command prompt). Is there a command that can do get this info?

Please help.

Thank you!

p.s. I tried searching for "hard disk" but didn't find any info.
 
Old 01-10-2005, 03:03 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,821

Rep: Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116
there's no program that will give you an output saying "this machine has 3 IDE drives and 2 SCSI drives", but there are a billion (not literally) quick fixes... just run "fdisk -l" and you should get a list of every partition on every drive on the system.

another way is to look at the contents of /proc/ide/. each occurence of hd? or sd? will be an ide or scsi device respectively.
 
Old 01-10-2005, 03:06 PM   #3
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Rep: Reputation: 58
Heres one way...works with ide drives, not sure of scsi:
Code:
# dmesg | grep hd | grep DISK | wc -l
OK, here we go:
Code:
# echo $( dmesg | grep hd | grep DISK | wc -l ) "ide drives " \ 
$( dmesg | grep sd | grep DISK | wc -l ) "scsi drives"
(That should be on one line...I just hate having to scroll horizontally) This is probably not infallable...I don't know how scsi drives identify themselves in dmesg, and you may get a few false positives...

Last edited by bulliver; 01-10-2005 at 03:18 PM.
 
Old 01-10-2005, 03:59 PM   #4
mali
LQ Newbie
 
Registered: Sep 2004
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks guys, I'll give it a try.

Very appreciated.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting several drives to one mountpoint? (redhat 9, IDE disks) ozric Linux - Newbie 3 02-01-2005 10:11 AM
looking for a way to dump line number info jbreazeale Linux - Software 2 09-22-2004 12:02 PM
maximum number of Hard drives Spyder_doo Linux - Hardware 5 08-19-2004 02:46 PM
Upgrading hard drives on Software raid 1 boot drives. linuxboy123 Linux - General 0 12-11-2003 03:28 PM
number of hard drives on a network sadiboyz Linux - Software 0 08-11-2003 04:46 AM


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

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration