Disk space for root partition


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Disk space for root partition
# 1  
Old 07-24-2007
Disk space for root partition

Hello,
I am trying to monitor disk space for each node on the machine. I am able to get all individual nodes but for the '/' node. For example:
df -k:
bash-2.05b# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xxx 4127108 2415340 1502120 62% /
/dev/yyy 77750 20614 53122 28% /boot
/dev/zzz 410898760 73467776 316558536 19% /opt
/dev/aaa 4127108 619428 3298032 16% /var

if I say df -k | grep /opt: I can get disk space for /opt. As I get all the nodes if I grep for just '/', can you please let me know how I can get disk space for /

Thanks
Chiru
# 2  
Old 07-24-2007
Hi chiru_h

You can try running command:

df -k /

I hope it helps

Erwin
# 3  
Old 07-24-2007
Thanks Erwin, that indeed is giving only the root disk space. But actually I am using it in a script for monitoring:
df -k | egrep '/opt|/var|/' | awk '{print $6"\t"$5}' | while read LINE; do DISK=`echo $LINE | cut -d"%" -f1 |awk '{ print $2 }'`; if [ $DISK -gt 80 ]; then echo "${LINE}"; fi; done

How can I incorporate it in the script?
# 4  
Old 07-24-2007
You can use the '$' symbol to indicate the end of the line.

In your script, the first line should look like this:

df -k | egrep '/opt|/var|/$' | awk '{print $6"\t"$5}'| while read LINE

Regards,

Erwin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Listing files/space used on root partition

For instance, root partition is full so I don't need to know about /ABC/XYZ when /ABC/XYZ is a separate mount point. (But /ABC isnt). Can I run a du command or similar and just look at contents effecting the space on that mount point (/)? (2 Replies)
Discussion started by: psychocandy
2 Replies

2. Ubuntu

Regarding OS partition and root user

Dear Concern, I am new in ubuntu. Is root user disable in ubuntu? Also, is os partition default in ubuntu? I don't find any feature to create customize mount point to install OS. Below is my current OS partition. amirislam@blnidapp03:~$ df -h Filesystem Size Used... (1 Reply)
Discussion started by: makauser
1 Replies

3. SCO

Resize root partition

I have SCO Openserver 5.0.5 Root partition is 96% full and I would like to make it bigger. How can this be done? 1) Can I use 'dd' to backup 'root' and then backup '/u' to a third hard disk, then divvy the primary hard disk to have a larger 'root' filesystem (i.e. previous root + u) 2) ... (5 Replies)
Discussion started by: grips03
5 Replies

4. Linux

How to increase root space from another partition?

Hi OS Experts I would like to increase root partition from another partition so that I can save more documents in Home and Desktop. whether it is possible without formating root partition if so please explain here is o/p of df -h Filesystem Size Used Avail Use% Mounted on /dev/sda9... (8 Replies)
Discussion started by: Akshay Hegde
8 Replies

5. Solaris

Need to partition root

Hello guys, I am using Solaris 10 x86 OS. While installing OS i have allocated entire 10 GB space to the root. Now i am not able to create new partition it says me "out of range" or "<cylinder number> not expected". Can someone please help me to allocated a default recommended space i.e 8GB or... (2 Replies)
Discussion started by: bhargav90
2 Replies

6. Solaris

Lost Root Password on VXVM Encapsulated Root Disk

Hi All Hope it's okay to post on this sub-forum, couldn't find a better place I've got a 480R running solaris 8 with veritas volume manager managing all filesystems, including an encapsulated root disk (I believe the root disk is encapsulated as one of the root mirror disks has an entry under... (1 Reply)
Discussion started by: sunnyd76
1 Replies

7. Solaris

Root partition filling up

I have a T1000 Sparc server that has a relatively small root partition which is 24Gb and a larger partition dedicated to /export/home that is approximately 100 Gb. We have a lot of data going to /var/audit and to /var/core/corefiles. Is there any non-destructive way to redirect files from... (4 Replies)
Discussion started by: goose25
4 Replies

8. Linux

shrinking root partition and using free space to create a block device

We are intending to protect a set of user specified files using LVM mirroring where the protected space on which the user files are stored is mirrored on an LV on a different disk. Our problem is that for a user with a custom layout has installed linux with 2 partitons for swap and / and there is... (0 Replies)
Discussion started by: kickdgrass
0 Replies

9. Solaris

Help: root partition crashed, fsck failed. Disk problem?

recently this sunfire 280R (solaris 10) is having problme, it was able to boot up, then all suddent, it failed, and I can't even mount the first disk which contains root partition when I boot up from cdrom. 2 X 36G hard drive, I scan first hard drive by "read", there is no bad block. The... (2 Replies)
Discussion started by: steeles
2 Replies

10. Filesystems, Disks and Memory

Ran out of space on /dev/root partition

hi, I have a SCO unix server which has a 36gb hard drive, but the IT company who supplied it assigned 1gb to /dev/root, 15mb to /dev/boot and 33gb to /dev/u. The /dev/root partition is now full, is there a way I can use the 33gb assigned to /dev/u without loosing any data, preferably... (2 Replies)
Discussion started by: Martyn
2 Replies
Login or Register to Ask a Question