Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to check used space for each partitions in Linux? Post 303003354 by freeaac on Wednesday 13th of September 2017 03:20:58 AM
Old 09-13-2017
How to check used space for each partitions in Linux?

we are using Disk utilization and filesystem utilization seperately. In AIX using
Code:
$lsvg
 rootvg 
datavg

Code:
$lspv hdisk1 
PHYSICAL VOLUME:    hdisk1                   VOLUME GROUP:     datavg 
PV IDENTIFIER:      00f65eab7acabb17 VG IDENTIFIER     00f65eab00004c00000001567b60a848
 PV STATE:           active 
STALE PARTITIONS:   0          ALLOCATABLE:      yes 
PP SIZE:            512 megabyte(s)          LOGICAL VOLUMES:  4 
TOTAL PPs:          899 (460288 megabytes)   VG DESCRIPTORS:   2
FREE PPs:           470 (240640 megabytes)   HOT SPARE:        no 
USED PPs:           429 (219648 megabytes)   MAX REQUEST:      256 kilobytes

I am able to get Total PPs,Free PPs and used PPs for hdisk0,hdisk1 using lspv and able to calculate disk utilization.
But in linux i tried like this,

Code:
$pvdisplay /dev/sda2  
--- Physical volume ---   
PV Name               /dev/sda2   
VG Name               VolGroup   
PV Size               15.51 GiB / not usable 3.00 MiB   
Allocatable           yes (but full)   
PE Size               4.00 MiB   
Total PE              3970   
Free PE               0   
Allocated PE          3970

Using this not able to understand Disk size,used space, Free space.
using "df" we are already calculating filesystem utilization. now i need to calculate disk utilization.
->currently using "cat /proc/partitions" able to get size of each disk but not able to get used space for each disk.

Last edited by freeaac; 09-13-2017 at 04:26 AM.. Reason: code not intended correctly
 

9 More Discussions You Might Find Interesting

1. Linux

File Sharing among NTFS Partition & RH Linux 9 Partitions

Well Guys, will anybody solve my problem? I have installed Win XP and RH Linux 9 (Dual Boot) on an Intel x86 Machine. Everything is going fine except that I cannot share files among the two operating systems. For example, if I download a PDF file from internet and save it in my Win XP partition... (1 Reply)
Discussion started by: Jawwad
1 Replies

2. Shell Programming and Scripting

check space !!!

The have written the below script :- ============================ SPACE=`bdf /DATA_TRANSFER|awk '{print $4}' |grep "%"` TEST="96%" if then echo "Continue ....." sleep 2 else echo " Current space for DATA_TRANSFER is less than 02 %" echo " Pls clear space and than continue ....."... (2 Replies)
Discussion started by: kamlesh_p
2 Replies

3. Linux

grub error 22,after removing linux partitions only windows is threre.Pc not booting.i

hi, in my pc linux and windows was there with 2 hdd in raid.i removed linux partititons.Now my ps is not booting giving grub error 22.Nothing works.I hace my data in windows.Hard disks are RAID.when tried to go to recovery mode from windoes boot cd,it says hard disk not detected.when tried with... (2 Replies)
Discussion started by: pankajd
2 Replies

4. Shell Programming and Scripting

Shell script partitions space monitor

Hello friends, I'm newbie in shell scripting... Until now i have this script: #!/bin/sh emailok = email1@domain.com emailissue = email2@domain.com limit="50" df -h | grep -vE '^Filesystem' | awk '{print $1 " " $4 " " $5}'|while read val do partition=$(echo $val | awk '{print... (9 Replies)
Discussion started by: john_doe
9 Replies

5. Linux

What is the minimum number of partitions you need to install Linux?

I think its 3. Just to know if I am correct. / /boot swap :confused: (2 Replies)
Discussion started by: nitin09
2 Replies

6. UNIX for Dummies Questions & Answers

Help needed to understand partitions in linux

Hi guys, It has been more than 2 month i switched to linux but i m still very much confused how linux handles and names the partitions. I have gone through couple of beginners material and found linux doesnt treat partitions as c: and d: instead it uses /dev/hda1 /dev/hda2 hda3 .But now i... (7 Replies)
Discussion started by: pinga123
7 Replies

7. SCO

check partitions size in MB

hi Howto check partitions size in MB on SCO 5.0.6? Using df command I can see just in blocks. (4 Replies)
Discussion started by: ccc
4 Replies

8. Shell Programming and Scripting

Check disk space

I am trying a script which will alert if disk space crosses some threshold, i googled it and got some scripts already, but they are not working with my server. The problem is, my filesystem names are big, so the sizes are moving to the second line. just like below any ideas? thanks in advance... (8 Replies)
Discussion started by: karthikeayan
8 Replies

9. Linux

Linux partitions and limitations

In recently reading an article on linux basics before I embark and my personal installation project I came across this passage - IDE drives have three types of partition: primary, logical, and extended. The partition table is located in the master boot record (MBR) of a disk. The MBR is the... (12 Replies)
Discussion started by: Synchlavier
12 Replies
gfs_quota(8)						      System Manager's Manual						      gfs_quota(8)

NAME
gfs_quota - Manipulate GFS disk quotas SYNOPSIS
gfs_quota <list|sync|get|limit|warn|check|init> [OPTION]... DESCRIPTION
gfs_quota is used to examine and change quota values in a GFS filesystem. This command has a number of different actions. ACTIONS
list List the contents of the quota file. Only IDs that have a non-zero hard limit, warn limit, or value are printed. sync Sync any local quota changes to the quota file. get Get the current data for the ID specified by the -u or -g argument. limit Set the current hard limit for the ID specified by the -u or -g argument to the value specified by the -l argument on the specified filesystem. The filesystem won't let the user or group use more than this much space. A value of zero here means that no limit is enforced. warn Set the current warn limit for the ID specified by the -u or -g argument to the value specified by the -l argument on the specified filesystem. The filesystem will start complaining to the user or group when more than this much space is used. A value of zero here means that the user won't ever be warned. check Scan a filesystem and make sure that what's out there on the disk matches what's in the quota file. This is only accurate if the filesystem is idle when this is running. If there is a mismatch, it is printed to stdout. Note: GFS quotas are transactional and a quota check is not needed every time there is a system crash. init Scan a filesystem and initialize the quota file with the values obtained from the scan. The filesystem should be idle when this is run. You should only need to do this if you upgrade a pre-quota GFS filesystem (pre-GFS 5.1). OPTIONS
-b The units for disk space are filesystem blocks. -d Don't include the space allocated to GFS' hidden files in what's reported for the root UID and GID values. This is useful if you're trying to get the numbers reported by gfs_quota to match up with the numbers reported by du. -f Directory Specifies which filesystem to perform the action on. -g GID Specifies the group ID for get, limit, or warn. It can be either the group name from the group file, or the GID number. -h Print out a help message describing available options, then exit. -k The units for disk space are kilobytes. -l Size Specifies the new value for the limit or warn actions. The value is assumed to be in the units specified by the -m, -k, -s, -b arguments. The default is megabytes. -m The units for disk space are megabytes. This is the default. -n Don't try to resolve UIDs and GIDs into user and group names. -s The units for disk space are sectors (512-byte blocks). -u UID Specifies the user ID for get, limit, or warn. It can be either the username from the password file, or the UID number. -V Print program version information, then exit. EXAMPLE
To set the hard limit for user "nobody" to 1048576 kilobytes on filesystem /gfs0 gfs_quota limit -l 1048576 -k -u nobody -f /gfs0 gfs_quota(8)
All times are GMT -4. The time now is 06:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy