[Cialug] how to discover what device your path is on

Kenneth Ristau kristau at kristau.net
Sat Jun 11 00:01:45 CDT 2005


Jerry Weida wrote:
> You can issue a 'df -k' (or 'df -h' if you system supports it). If you are 
> on /var/spool then look for an entry that says /var. This will tell you the 
> device that directory sits on. If you don't see an entry for /var then it 
> probably is part of the root filesystem, /. Then you just check the device 
> that this sits on.
> 
> i.e.
> [user at host ~]$ df -h
> Filesystem Size Used Avail Use% Mounted on
> /dev/md0 2.0G 121M 1.9G 7% /
> /dev/md3 25G 423M 25G 2% /home
> /dev/md1 7.9G 885M 7.0G 12% /usr
> /dev/md2 40G 895M 39G 3% /var
> 
> In this case, the /var is on /dev/md2. Your mileage may differ.

Correct.  And the following will list just the directory in question:

  df -h /var/spool

In fact, /var and /var/spool could be on two different devices.  If they
were, then you should see an entry for both paths using the form Jerry
presented.  For example:

[user at host ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md0 2.0G 121M 1.9G 7% /
/dev/md3 25G 423M 25G 2% /home
/dev/md1 7.9G 885M 7.0G 12% /usr
/dev/md2 40G 895M 39G 3% /var
/dev/md4 10G 1G 9G 10% /var/spool

If I'm looking for free space, I use Jerry's method.  If I'm looking for
the device a path resides on I use mine.  Both work, so 'tis just a
matter of opinion :)

later,
kristau
-- 
Tired programmer
Coding late into the night
The core dump follows

My GNUPG public key is available at http://www.kristau.net/public_key.asc


More information about the Cialug mailing list