Operating System - HP-UX
1833998 Members
2487 Online
110063 Solutions
New Discussion

Actual usage of allocated blocks

 
SOLVED
Go to solution
John Jayaseelan
Super Advisor

Actual usage of allocated blocks

Hi,

I have a filesystem/logical volume occupying 3 physical disks, Is there any way to find how much of the allocated blocks are currently being used by data on each hard disk.

Regards,
John Jayaseelan
8 REPLIES 8
harry d brown jr
Honored Contributor

Re: Actual usage of allocated blocks

lvdisplay -v /dev/vg##/lvol##

live free or die
harry
Live Free or Die
Pete Randall
Outstanding Contributor

Re: Actual usage of allocated blocks

lvdisplay -v will show where extents have been allocated but I know of no way to tell whether there's data in them or not.

Pete

Pete
John Jayaseelan
Super Advisor

Re: Actual usage of allocated blocks

Harry,

lvdisplay -v /dev/vg/lv will give all the allocated extents/blocks not actual blocks being used by the current data.

Regards,
John Palmer
Honored Contributor

Re: Actual usage of allocated blocks

I don't know anything that provides a logical volume map. I suppose that a combination of lvdisplay -v (for the extent map) and fsdb may be possible but it wouldn't be easy.

Regards,
John
Pete Randall
Outstanding Contributor
Solution

Re: Actual usage of allocated blocks

Just a thought - if you used dd to exercise the lvol (dd if=/dev/vg??/rlvol?? of=/dev/null bs=1024k) and then monitored the activity with glance, you might be able to watch the activity move from one disk to another and get an idea from that.

Pete

Pete
John Poff
Honored Contributor

Re: Actual usage of allocated blocks

Hi,

You could try something like this:

ncheck -F vxfs -oblock=- /dev/vg00/rlvol4

[This was on my /tmp filesystem]

It returns a listing of the inodes and the blocks for each item in the filesystem. You might be able to figure out how the blocks from that report correspond with the filesystem blocks.

JP
Jean-Louis Phelix
Honored Contributor

Re: Actual usage of allocated blocks

Amazing John !

I would give you points if I could. I always thought it was impossible to find out which files are impacted by a stale PE for example. Reading you answer I immediatly had a look to man ncheck_vxfs and there are lots of useful options. That's exactly what I like here in forums. I really learn a lot.

Thank you very much.

Jean-Louis.
It works for me (© Bill McNAMARA ...)
John Poff
Honored Contributor

Re: Actual usage of allocated blocks

Jean-Louis,

You're welcome! I had seen the ncheck command before when I was playing around one day [actually, I manage to play around lots of days, but I hope my boss doesn't read this post!]. I remembered it when I read this question.

I've run it on the /tmp filesystem on one of my boxes, and I've been looking at the output from that and also from lvdisplay, fstyp -v, and vgdisplay to try to understand it all better. Looking at the output, it is interesting to note that there are gaps in the available blocks. I'm wondering if I ran fsadm to defrag and reorg the filesystem if it would help make them more contiguous. I read another post recently about reducing the size of a filesystem, and Jim Ferguson mentioned defragging the filesystem as a way to make LVM happy and allow you to reduce the size. Maybe this will give a good map to see why LVM complains sometimes about reducing filesystems.

Fun stuff!

JP

"Live free or die"