Tell hardrive size and type from command prompt

Posted on 2005-04-25
Last Modified: 2013-12-15
I have a remote linux box.  I would like to know how to tell the type of harddrive inside it and get the total harddrive space from the command prompt.  Just the commands I mean.  I dont know where to begin.
Question by:Rebelnorth
    LVL 16

    Assisted Solution

    how about this:

    type 'df -h'

    this will output to you all of the partitions that are in use, and how big they are you'll see a line like this:
    Filesystem   Size  Used  Avail Use% Mounted On  
    /dev/sda1   10G    2G    8G    20%      /
    /dev/sda2   10G    5G    5G    50%      /usr

     sda represents the first SCSI disk. If it's hda, then it's an IDE disk. hdb is the second IDE drive, sdb is the second SCSI drive, etc.

    So - I have one SCSI drive called sda - it has 2 partitions of 10GB each...

    If you want to see more details on each drive, then run 'fdisk /dev/hda' or 'parted /dev/hda' to see info on hda. There could be space on hda that's unpartitioned, and fdisk would help see that. Be careful, cause those commands can be used to delete your partitions...

    LVL 38

    Expert Comment

    > I have a remote linux box.
    If you have Xwindow running, then you can type
    to see the harddrive and the disk controller.
    LVL 2

    Accepted Solution

    Switch to /proc/ide or scsi depending on the HDD u r using, and then to the device directory, in my system i have an Seagate IDE HDD, so /proc/ide/hda, here u have all the info u need for the HDD like driver, model, settings, cache etc. For checking the disk usage nuthin better then df -h  

    [root@linuxserv hda]# pwd
    [root@linuxserv hda]# ls
    cache     driver    identify  model     smart_thresholds
    capacity  geometry  media     settings  smart_values

    df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/hda1             4.8G  2.2G  2.3G  48% /
    /dev/hda2              19G  1.9G   16G  11% /opt
    none                  251M     0  250M   0% /dev/shm
    /dev/hda5             3.8G  3.5G  187M  95% /usr
    /dev/hda3             4.8G  1.8G  2.8G  38% /var

    U can tweak yr IDE HDD paramters with HDPARM, or get the HDD parameters with

    [root@linuxserv hda]# hdparm -i /dev/hda


     Model=ST340810A, FwRev=3.99, SerialNo=5EX13311
     Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
     RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
     BuffType=unknown, BuffSize=2048kB, MaxMultSect=16, MultSect=16
     CurCHS=16383/16/63, CurSects=-66060037, LBA=yes, LBAsects=78165360
     IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
     PIO modes: pio0 pio1 pio2 pio3 pio4
     DMA modes: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5
     AdvancedPM=yes: unknown setting
     Drive Supports : Reserved : ATA-1 ATA-2 ATA-3 ATA-4 ATA-5 ATA-6


    Author Comment

    I split the points between 1 and 3 because I couldnt do 2 because its only accessible through the command prompt.
    LVL 2

    Expert Comment

    Thanks :-)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    The purpose of this article is to demonstrate how we can use conditional statements using Python.
    It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now