Operating System - HP-UX
1753325 Members
5215 Online
108792 Solutions
New Discussion юеВ

Re: filesystems under root

 
SOLVED
Go to solution
Gord Moore
Frequent Advisor

filesystems under root

This may be a "newbie" type of question but I
can't seem to find an answer. Maybe I can't
find the right way to ask the question.

How can I easily find out which filesystems are
under root and which have their own mountpoint.

For instance:
/home/gmoore1> bdf /
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 1048576 532792 511800 51% /
/home/gmoore1> bdf /etc
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 1048576 532792 511800 51% /
/home/gmoore1> bdf /var
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol8 8904704 1528136 7319776 17% /var

/etc is under the / directory, but /var is not.
This came up because a DBA filled up the / directory, and I couldn't quickly find what
sub-directory he filled up. The usually suspect
is /tmp, but like /var, it is a separate
mountpoint and not included in the totals for
the / directory.

How do I easily find out what is a sub-directory
of the / directory, and what is a separate
mountpoint?




8 REPLIES 8
Helen French
Honored Contributor
Solution

Re: filesystems under root

# bdf

This command will tell you which are the mounted file systems.

# ls -al /

This command will tell you call files and subdirectories on root (/) including mount_points. All directories except the one mounted are subdirectories in root file system.

Also, to see which subdirectory on root (/) holds the maximum space, use this command:

# du -k -x / | sort -rn | pg

This will list and sort all subdirectories in root, excluding the mount points.
Life is a promise, fulfill it!
Bryan D. Quinn
Respected Contributor

Re: filesystems under root

Hello,

Well if you just do a bdf without any options, you will see all of your mounted file systems.

If you are in root and do and ll | more , then you can page through and see everything (files and sub-dirs). If you look at the sub-dir and it does not show up in bdf then it is not mounted seperately.

Hope this helps!
-Bryan
James A. Donovan
Honored Contributor

Re: filesystems under root

cd /
ll -iF

...directories shown will have a "/" appended, and the inode of a filesystem mountpoint will always be 2. A standard directory under the root directory will have an inode number >2.
Remember, wherever you go, there you are...
Gord Moore
Frequent Advisor

Re: filesystems under root

Ok. Thanks people. The short answer seems to
be "not possible" except by manually comparing
two lists (a bdf and ls -al, for example),
or using some knowledge of what inodes equal
to 2 in a ll -iF means and again manually
parsing the list.

Maybe that's why I've never found a clean,
simple answer!
Mark Greene_1
Honored Contributor

Re: filesystems under root

run mount to see want is mounted as a file systems. Any directory not in that list is a regular directory.

mark
the future will be a lot like now, only later
Tim Jaster
Advisor

Re: filesystems under root

You could additionally grep the results of ll -iF to get exactly which sub-dirs are not mounted...

ll -iF | grep dr | grep -v '2 dr'

And those that are mounted...

ll -iF | grep ' 2 dr'
(put a space before the 2)
James Lynch
Valued Contributor

Re: filesystems under root

If all you are looking for is quick way to find large files under a directory in the root filesystem, you can use the following command:

find / -xdev -size +2048 -print 2>/dev/null | xargs ll -d

This command will find all files in the '/' filesystem that are larger than 1MB (i.e. 2048 512byte blocks) and then using xargs, produce a ll listing for it. The -xdev option tells find not to cross (traverse) mount points.

As long as you a root when you run this, you should find all large files. You can also change the threshold at which find reports a largefile by increasing the +2048 number. i.e. to find files larger than 10MB make th e number +20480.

JL
Wild turkey surprise? I love wild turkey surprise!
Joshua Scott
Honored Contributor

Re: filesystems under root

if it's not one of these:

/stand
/
/home
/opt
/tmp
/usr
/var

and you didn't mount it, then it's a subdir of root.

these are the default mount points for hpux.
What are the chances...