spartacus
16th July 2003, 10:44
Using the unix command "df" I get an overview of free diskspace on the different devices

Let's say, I have a folder "/export/user/test"

How can I determine to which device this folder belongs, so that I can see the influence of this folder to the available diskspace?

Spartacus

OmeLuuk
16th July 2003, 10:58
use "du" disk usagebshell6.1> pwd
/home/bsp
bshell6.1> df -k .
/home (/dev/vg00/lvol5 ) : 20278 total allocated Kb
3773 free allocated Kb
16505 used allocated Kb
81 % allocation used
bshell6.1> du -ks
7924 .
bshell6.1>Out of 20278 Kb on /dev/vg00/lvol5 some 7924 Kb is used for the current home directory of bsp.

NPRao
16th July 2003, 10:59
Spartacus,

you can look up the man for the commands - du and bdf.

I usually use:

bdf [directory path] which gives me the info, volume groups/mount points, free/used space etc.

[DEV:bsp]/app/lms/lmss/opt/bse
>bdf .
Filesystem kbytes used avail %used Mounted on
/dev/vg_lmss_01/lv_opt
6160384 5471467 649240 89% /app/lms/lmss/opt
[DEV:bsp]/app/lms/lmss/opt/bse
>

maximus
16th July 2003, 11:04
Hi,

1. As per your example folder name you may use "du <folder name> to get the space the occupied by the contents of the folder.

2. The location of that folder on a particular disk can be found out from the mount table / df output.

for example the df out put states that the /export refers to the disk3 and there is no entry for /export/user or /export/user/test in the df output, it means that the test folder is located in a directory mounted as /export on disk3

so thats the disk it is affecting.

There must be some unix command with an option to find the data you are looking for, I will try to find out, meanwhile you may use this way.

Regards
Max

tjbyfield
16th July 2003, 11:14
Hi

I think different unixes have different commands for this.

For example the 'bdf' command that NPRao used is not in AIX

With AIX the df lists the logical volume name. You can use lslv -l [ lv ] to get the phisical device name.

Terry

patvdv
16th July 2003, 11:48
bdf is HP-UX only. If you want a consistent output across all UNIX platforms, then use the -P parameter (POSIX): df -P

spartacus
16th July 2003, 13:32
Hi all,

thanks for your replies. Didn't thought to start such a big thread!

Think I'm working on a SUN Unix. Didn't find bdf or lslv. Tried with the "find" function. But maybe I have not the permissions to right the related folders.

If I try to find "export" somehow in the output of df or in the mntab, I find nothing.

Is it possible, that my "/export/user/test" belongs to "/" ?

Spartacus

OmeLuuk
16th July 2003, 13:35
What does "df -k /export/user/test" give as output?

spartacus
16th July 2003, 14:12
Hi,
greetings to the Netherlands !!!

"df -k /export/user/test" shows me in the column "Filesystem" the device I'm lokking for. In fact it is the rootdevice "/".


So thanks, this is a solution for my problem.


Spartacus