Tell hardrive size and type from command prompt

Posted on 2005-04-25
Medium Priority
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

JammyPak earned 500 total points
ID: 13861571
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

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

Accepted Solution

Darshan_Jadav earned 500 total points
ID: 13864722
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

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

Expert Comment

ID: 13867247
Thanks :-)

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month17 days, 12 hours left to enroll

829 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