Assuming that you have more than one filesystem mounted on directories under /db (as in /db/database2, /db/database2, ...), try:
Assuming that you have more than one filesystem mounted on directories with names starting with db (as in /db1, /db2, ...), try:
Note that there is no -h on the df invocations. Human readable output is fine if it is being read by a human. It is a nuisance if you're trying to add numbers (some of which are in terabytes, some of which are in gigabytes, some of which are in megabytes, ...).
Note that you can tell df which filesystems to process which makes it run faster since it doesn't have to process filesystems you don't care about and it gets rid of the need for the grep.
In both of the above suggestions, if you want to print the individual df output lines and print the total, change:
in the above scripts to:
if you just want to print the sizes with a total at the end, or to:
if you want to print the entire lines from df followed by the total available space on those filesystems.
I would try it ,however i have other filesystem with archive too which needs to be added apart from db filesystems .i just need the sum of allocated space to filesystems.
I though of using the below
Let me know any other alternative...
Moderator's Comments:
Please use CODE tags when displaying sample input, sample output, and code segments.
Last edited by Don Cragun; 01-27-2016 at 12:05 AM..
Reason: Add CODE tags again.
Hi all,
I am interning in a unix department and am very new to programming. I am supposed to write a script that counts the amount of filesystems a server has allocated, and the amount free. This is what I was given to start with:
#!/bin/ksh
df -m | grep -v ":"|grep -v Free|grep -v "/proc"|... (6 Replies)
Hey guys,
I am somewhat new to Solaris - and very new when it comes to mounts.
My problem is that when I installed Solaris, I allocated way too little diskspace to my / mount (it first became obvious now, however, because of new needs).
bash-3.00# df -h
Filesystem size ... (25 Replies)
I am trying to copy a filesystem from one server to another using rsync over the WAN. As far as I can tell, the two filesystems are identical but for some reason I cannot copy the last file because I keep running out of space.
SERVER 1:
mkfs -m <lvol>
mkfs -F vxfs -o... (1 Reply)
i am working with solaris 9 and my disk usages are
# df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 2148263 1902721 202577 91% /
/proc 0 0 0 0% /proc
mnttab 0 0 0 ... (3 Replies)
Hi All,
Will df+du=Total space allocted for a file system??
Is the above correct. Please correct me If iam wrong.
In one my programs the above is not happening.
Please help me out.
Many thanks.
Regards,
Manas (2 Replies)
Hi there,
When I run top on my machine it says I have 497M swap space in use, and 380M swap space free,
but I have only allocated 512M swap space to the machine!!!!
Does anyone know how swap used is calculated in the top command?
Thanks... (1 Reply)