Used Space on Logical Volumes

Hi Everybody,

Is there any way to know the used space on a specific Logical Volume?

Note, my question related to the LVs that have no mount point & not belong to any FileSystem.

Thanks in advance :rolleyes:

Which filesystems do you mean and are these on rootvg by chance? You can run the command lsvg -l <vgname> to show to number of LP / PP being used.

Thank johnf for your reply.

I will clarify my question with a small example.

Lets say, we have a new Physical Volume with size of 400GB. A new Volume Group has been created on this PV, after that we created 5 Logical Volumes on this VG each LV with 10 PPs.

How can I know after that how much space really used on these LVs?

lslv <lvname>

dear
follow the followinf steps:

1- lsvg <VG_Name>
from the result of the above command locate the PP size:

2- lsvg -l <VG_Name>
this will give you the list of the logical volumes that has been created on the <VG_Name> along with how many PP's has been assigned to them.

3- to know how much size is occupied by a certain LV multiply the PP size (from step1) by the No of PP's allocated for the LV (from step2)

4- consider if there are any mirroring configured for the LP from step2 unedr LP.
if the value is more than 1 then the logical partition is mirrored and the total size is double than that got from step3

An LV is basically a raw storage unit from an operating system point of view. It will be hard for the operating system commands to say 'how much is actually used'. Let's say if there is,

a). A filesystem on that, filesystem commands [ df ] needs to be used to identify the usage.
b). If that is a paging space, then you may use lsps command.
c) If that is used by an application like oracle or so for raw storage, the application will be able to tell you how much of that space is 'actually used'.

It is as simple as I gave you some money , You invested it in many places that I have no control on. Now if someone asks ME , how much of that money is actually used, I may not have an answer, unless 'you tell me'. But for sure, you will have an answer. "I" am the operating system, "money" is a logical volume and "you" are an application responsible for data storage [filesystem ... etc ]

Regards, Kaps

Thanks alot guys for the responds, and special thank for kapilraj because he exactly answer my question.

So, as I understand from kapilraj answer there is no way to know the used space on a specific LV unless it is belong to a specific FileSystem, or through the Application that using this LV.

This was the point of my first answer. It depends on what type of filesystem is mounted on the logical volume. A normal jfs or jfs2 can be analysed just using df however a sysdump device is not used for normal files and can only be analysed by the lsvg or sysdumpdev command.