know my storage devices, (df -h)

Posted on 2007-08-02
Last Modified: 2010-04-20
i need to know the available space that i have on my linux machine, so i used df -h command
and it gave me the following:
/dev/sdb2             21G      5.8G       15G    .....       /
udev                     2.0G     152K       2.0G   ......     /dev
/dev/sdb3             444G    2.2G        442G  .....      /home

i need to know if those are the storage devices that i have on the machine?

another thing is: executing iostat -k generated the following:
sda       0.00          0.00     ....
sdb       4.95          0.12    

the question:
so what are sda and sdb and what are sdb2, sdb3 and udev ?
which of those are my storage devices?
thanks in advance
Question by:mte01
    LVL 43

    Accepted Solution

    sdX - are scsi disks, where scsi means scsi, sata, usb, etc (and ata disks as well in very fresh kernel)
    sdaX - are partition numbers within first scsi disk
    udev is special virtual(in-memory only) device mounted on /dev folder.

    Seems like first disk is unused (not mounted anywhere).
    LVL 3

    Author Comment

    so, if i want to calculate my storage size, and the used size, do i simply run the command: df -h
    and then calculate the total values?
    what about the dvd or cd rooms will they be displayed?
    thanks a lot for the fast reply.
    LVL 43

    Expert Comment

    > what about the dvd or cd rooms will they be displayed?
    Only if they are used (loaded and [auto]mounted).

    Basically df shows currently known(in-use) storage. In the provided output there's no partition from /dev/sda mounted. Since it's unused, it's not shown along df output.
    Also check /proc/partitions file, it contains all known block devices/partitions along with total sizes.
    LVL 3

    Assisted Solution

    As said above, 'df' will only show you mounted partitions.

    You can look what partitions the disks have by (carefully) using the 'fdisk' command.

    So, if you want to see the partitions on /dev/sda you would do (as root):

    fdisk /dev/sda

    That will tell you the total size of the disk, plus partition sizes (in KB, I think).

    If there are partitions on /dev/sda, then you would have to mount them to see how much free space they have.
    LVL 43

    Expert Comment

    > fdisk /dev/sda
    > p
    even safer: fdisk -l /dev/sd[a-z]
    LVL 34

    Assisted Solution

    by:Duncan Roe
    Also, "swapon -s" will show you partitions being used for swap

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
    Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    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

    19 Experts available now in Live!

    Get 1:1 Help Now