Get unallocated disk space. ? | Unix Linux Forums | Red Hat

  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 Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 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. ?

Experts,

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.!


Code:
# vgdisplay
--- Volume group ---
VG Name datavg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 7
VG Access read/write
VG Status resizable
MAX LV 0
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


Code:
# 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


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

Thanks,
Vasu.


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

Last edited by pludi; 03-06-2012 at 07:59 AM..
Sponsored Links
    #2  
Old 03-06-2012
Tommyk Tommyk is offline
Registered User
 
Join Date: Aug 2011
Last Activity: 1 July 2014, 10:30 AM EDT
Location: Ripon, North Yorkshire
Posts: 146
Thanks: 4
Thanked 14 Times in 14 Posts
Quote:
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.


Code:
 
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
    #3  
Old 03-06-2012
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
who?
 
Join Date: Dec 2003
Last Activity: 27 July 2014, 6:22 PM EDT
Location: /dev/ph
Posts: 4,772
Thanks: 59
Thanked 423 Times in 392 Posts
If your disks have a GPT label, you should use gdisk or parted, instead of fdisk.
    #4  
Old 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:

Quote:
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 Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 07:40 AM
Disk Space ab52 Shell Programming and Scripting 3 09-06-2010 08:54 AM
Solaris 8-How to check unallocated physical volumn and how allocate it to a disk? Wanida Solaris 2 07-23-2010 11:16 AM
disk space kingsto88 Filesystems, Disks and Memory 3 12-06-2006 04:28 AM
available disk space on disk device??? alan UNIX for Dummies Questions & Answers 4 01-02-2004 02:06 AM



All times are GMT -4. The time now is 12:12 AM.