Unix/Linux Go Back    

Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

Get unallocated disk space. ?

Red Hat

Closed Linux or Unix Question    
Thread Tools Search this Thread Display Modes
Old Unix and Linux 03-06-2012
vasukv vasukv is offline
Registered User
Join Date: Sep 2010
Last Activity: 6 March 2012, 7:36 AM EST
Location: Atlanta
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
Java Get unallocated disk space. ?


How can i get unallocated disk space. ?

Below as per volume group details, total 100 GB (Allocated 50 GB and Free 50 GB), but df -h gives total count for all 100 GB.

I'm getting used and free disk space, so how can i get unallocated disk space. ? vgdisplay, pvdisplay and df -h is not the right way. ?

Thanks in advance.!

# vgdisplay
--- Volume group ---
VG Name datavg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 7
VG Access read/write
VG Status resizable
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 100.00 GB
PE Size 4.00 MB
Total PE 25599
Alloc PE / Size 12800 / 50.00 GB
Free PE / Size 12799 / 50.00 GB
VG UUID sv0h-Lng0-Fwo1-W1L9-OQgx-GgchFu

# pvdisplay
--- Physical volume ---
PV Name /dev/sddlmaa
VG Name datavg
PV Size 100.00 GB / not usable 4.00 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 25599
Free PE 12799
Allocated PE 12800
PV UUID aDv7gi-jgx1-QfYd-SaTt-OWa6-gQMts6

# df -h
Filesystem Size Used Avail Use% Mounted on
3.8G 2.0G 1.7G 54% /
1.9G 163M 1.7G 9% /var
1.9G 244M 1.6G 14% /home
5.7G 140M 5.3G 3% /shared
/dev/sda1 99M 13M 82M 14% /boot
/tmpfs 7.9G 0 7.9G 0% /dev/shm
9.9G 4.7G 4.7G 51% /opt/IBM
6.9G 2.3G 4.4G 34% /opt/FNet
9.9G 2.1G 7.3G 22% /waps
5.0G 451M 4.3G 10% /apps
50G 416M 47G 1% /cstoreTW


Moderator's Comments:
Please use [CODE] tags when posting console output

Last edited by pludi; 03-06-2012 at 08:59 AM..
Sponsored Links
Old Unix and Linux 03-06-2012
Tommyk Tommyk is offline
Registered User
Join Date: Aug 2011
Last Activity: 19 October 2015, 9:01 AM EDT
Location: Ripon, North Yorkshire
Posts: 148
Thanks: 4
Thanked 14 Times in 14 Posts
How can i get unallocated disk space. ?
What are you trying to get unallocated disk space for? The vgdisplay command is showing you have 50GB of unallocated disk space within that volume group.

If you wanted to know how much unallocated disk space you have i.e. that is not allocated to any LVM or local filesystems you should use the fdisk command.

fdisk -l *

This will show all disks sizes and how much of that disk has been partitioned into useable partitions. Take away the total of all the partitions from the total size of the disk and that will give you the disk space that has not yet been allocated for any use.
Sponsored Links
Old Unix and Linux 03-06-2012
fpmurphy's Unix or Linux Image
fpmurphy fpmurphy is offline Forum Staff  
Join Date: Dec 2003
Last Activity: 12 February 2016, 2:18 AM EST
Location: /dev/ph
Posts: 4,983
Thanks: 70
Thanked 473 Times in 436 Posts
If your disks have a GPT label, you should use gdisk or parted, instead of fdisk.
Old Unix and Linux 03-06-2012
thmnetwork thmnetwork is offline
Registered User
Join Date: Mar 2004
Last Activity: 13 April 2013, 4:20 PM EDT
Location: Boise, Idaho, United States
Posts: 144
Thanks: 13
Thanked 6 Times in 6 Posts
My sense in what you're saying is that "df" doesn't seem to reflect what you think the LV should be, and you're wanting to know what to use instead. In addition to what Tommyk pointed out about finding unallocated parts of the HDD, it looks like you have two different volume groups (rootvg, and datavg) datavg is the one you did the vgdisplay for. Since /cstoreTW is the only LV in vgdata (I'm assuming since it's consuming 100% of the 50gigs) it seems to match the output of your vgdisplay. "df" measures filesystem usage so there's overhead on the filesystem metadata and LVM metadata but the numbers should be basically close.

If you're wanting to have it take up the remaining 50 gigs that are still free in the datavg volume group:

1. Shutdown anything using /cstoreTW

2. unmount the LV:
# umount /cstoreTW

3. Extend it:
# lvextend -L +<numberofGigsToIncreaseBy>G /dev/mapper/datavg-cstoretwvol

4. Resize the filesystem (this is assuming it's ext3/ext4):
# resize2fs /dev/mapper/datavg-cstoretwvol

5. Mount and enjoy:
# mount /dev/mapper/datavg-cstoretwvol /cstoreTW
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
unallocated space manoj.solaris Red Hat 1 03-24-2011 08:40 AM
Disk Space ab52 Shell Programming and Scripting 3 09-06-2010 09:54 AM
Solaris 8-How to check unallocated physical volumn and how allocate it to a disk? Wanida Solaris 2 07-23-2010 12:16 PM
disk space kingsto88 Filesystems, Disks and Memory 3 12-06-2006 05:28 AM
available disk space on disk device??? alan UNIX for Dummies Questions & Answers 4 01-02-2004 03:06 AM

All times are GMT -4. The time now is 05:01 PM.