Find the answer to your Linux question:
Results 1 to 4 of 4
Can someone here pls tell me any command to get number of hard disks in linux. I have used fdisk -l and df -h. but is tehre any other sure ...
  1. #1
    Just Joined! achak01's Avatar
    Join Date
    Jan 2007
    Posts
    6

    Number of Hard disks in linux

    Can someone here pls tell me any command to get number of hard disks in linux. I have used fdisk -l and df -h. but is tehre any other sure shot method of knowing this. Kindly help me out on this

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Code:
     dmesg | grep sd | grep DISK | wc -l
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    dmesg | grep sd | grep DISK | wc -l
    It says 0 on my computer

    but
    dmesg | grep sd | grep disk | wc -l
    works.
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  4. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    I forgot that Linux is case sensitive.
    Thanx b2bwild !
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...