- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Disk Usage
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2002 03:24 AM
тАО03-25-2002 03:24 AM
What is is the best way to determine how much disk space is used (in kb or mb, not blocks) in a filesystem? I have been moving files around over the weekend and I need to make sure they will all fit on their DLT tapes.
Cheers,
Christian Briddon
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2002 03:30 AM
тАО03-25-2002 03:30 AM
SolutionYou can use bdf or df -k to get a file system usage overview. Alternatively you can use du -k on directories, files etc.
See man pages for more info.
HtH,
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2002 03:32 AM
тАО03-25-2002 03:32 AM
Re: Disk Usage
This gives Disk Usage in kb. If you want more detailed information for the filesystem you can omit the 's' flag.
HTH,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2002 03:34 AM
тАО03-25-2002 03:34 AM
Re: Disk Usage
You can use bdf and then the result are in bytes.
If you use du command the result are in 512 bytes blocks.
Regards,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2002 04:14 AM
тАО03-25-2002 04:14 AM
Re: Disk Usage
You may use the command :
# df -k
for displaying all used and free spaces on file-systems in Kilo-Bytes.
or
# df -k
for displaying only a specific directory used and free spaces on a file-system in Kilo-Bytes.
Then calculate the total amount to check if it stand on DLTs.
Magdi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2002 04:37 AM
тАО03-25-2002 04:37 AM
Re: Disk Usage
Clean way is , put this in a script file, say neat-bdf:
****
/bin/bdf "$@" 2>&1 | awk ' { if(NF == 1) { getline n; sub("^[ ]*", " ", n); print $0" "n; next } }
{ print }'
****
and execute it:
#neat-bdf >bdf.out
that will give the sizes of each filesystem in a single line in kbs
HTH
raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2002 04:40 AM
тАО03-25-2002 04:40 AM
Re: Disk Usage
if you like to use du or bdf, i would prefer to use du -sk
bdf -kl
1. If you backup only subdirs of a filesystem, bdf -kl will not match at all because it only shows complete filesystems.
2. bdf -kl does not count the size a sparse file will use on tape.
But even du does not count real bytes, because it is block-aligned. If you need the exact size you can use ll or find and ll to add them up.
Heiner
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2002 04:57 AM
тАО03-25-2002 04:57 AM
Re: Disk Usage
If you only want a certain tree of it you can use 'du -k /dir' to get Kb.
Here is a small script I have written to better display larger figures (Mb, Gb):
du_it()
{
bytes=`du -s | cut -f1 -d" "`
if [ $bytes -le 999999 ]
then
bytes=`expr $bytes \* 512`
kbytes=`expr $bytes \/ 1000`
else
kbytes=`expr $bytes \/ 2`
fi
if [ $kbytes -gt 999 ]
then
mbytes=`expr $kbytes \/ 1000`
xbytes=`expr $mbytes \* 1000`
kbytes=`expr $kbytes - $xbytes`
if [ $kbytes -le 10 ]
then
kbytes="00$kbytes"
fi
if [ $kbytes -le 100 ]
then
kbytes="0$kbytes"
fi
if [ $mbytes -gt 999 ]
then
gbytes=`expr $mbytes \/ 1000`
xbytes=`expr $gbytes \* 1000`
mbytes=`expr $mbytes - $xbytes`
if [ $mbytes -le 10 ]
then
mbytes="00$mbytes"
fi
if [ $mbytes -le 100 ]
then
mbytes="0$mbytes"
fi
echo "In `pwd`\t you have used $gbytes,$mbytes Gbytes."
else
echo "In `pwd`\t you have used $mbytes,$kbytes Mbytes."
fi
else
echo "In `pwd`\t you have used $kbytes Kbytes."
fi
}
if [ $# -gt 0 ]
then
startdir=`pwd`
for dirs in $*
do
if [ -d "$dirs" ]
then
cd $dirs
du_it
fi
cd $startdir
done
else
du_it
fi
Regards,
Trond