Operating System - HP-UX
1753359 Members
6666 Online
108792 Solutions
New Discussion юеВ

File system utilization vary checking by root and normal user

 
Indrajit Bhagat
Regular Advisor

File system utilization vary checking by root and normal user

While checking as root the file system utilization is:

idcxpr0012# du -sh ./*
0K ./bin
308M ./db
0K ./kms
758K ./local
18M ./lost+found
761G ./netbackup
0K ./replication_status
593K ./var
5.4M ./volmgr
92M ./vxul
92M ./vxul.tar.gz

And by normal user for same file system:
idcxpr0012: du -sh ./*
0K ./bin
308M ./db
0K ./kms
758K ./local
18M ./lost+found
idcxpr0012: du -sh ./*
0K ./bin
308M ./db
0K ./kms
758K ./local
18M ./lost+found
110G ./netbackup -This huge difference is there
0K ./replication_status
593K ./var
5.4M ./volmgr
92M ./vxul
92M ./vxul.tar.gz 0K ./replication_status
593K ./var
5.4M ./volmgr
92M ./vxul
92M ./vxul.tar.gz



110G ./netbackup -This huge difference is there

For this file system huge difference is there , please suggest how this big difference is there
3 REPLIES 3
Bill Hassell
Honored Contributor

Re: File system utilization vary checking by root and normal user

Is this an HP-Us system? Using standard /usr/bin/du, I see:

# du -sh ./*
du: illegal option -- h
usage: du [-a|-s] [-kbrx] [-H|-L] [-t type] [name ...]

The difference (on any flavor of Unix) is due to directory permissions. Ordinary users are not allowed to read every directory, thus du will fail to count that space. However, using a standard du command on HP-UX, unreadable directories will produce the following message:

du: cannot open < ./blh >

What happens when you issue this command:

type du

This might help clarify the problem.


Bill Hassell, sysadmin
Indrajit Bhagat
Regular Advisor

Re: File system utilization vary checking by root and normal user

Hi All

I resovled my problem , as I get to know that user are not having permission on all the directory and file under netbackup directory, so while checking the size of the file system, the user is not able to get the size of those file and directory which users are not having permission, while root is able to calculate it.

Also i tried below option:
cd /opt/VRTSnbu
*du -h ./** | sort -k 2 > /tmp/xn
---------
then as root:

Code:
---------
cd /opt/VRTSnbu
*du -h ./** | sort -k 2 > /tmp/xr
---------
Then use com m or diff to determine what is different.
Dennis Handly
Acclaimed Contributor

Re: File system utilization vary checking by root and normal user

>And by normal user for same file system: du -sh ./*

This "*" will also skip any "." files and directories, at the top level.