Showing results for 
Search instead for 
Do you mean 

HP-UX 11.0 and LVM oddness

Go to Solution
Occasional Visitor

HP-UX 11.0 and LVM oddness

It's been about 5 years since I've done any "real" sysadmin work on HP-UX, so please bear with me. I'll try to keep a long story not so long.

I'm helping a company migrate data from one system to another and I'm poking around one of their VGs and I notice that there are 4 PVs - 1 100GB EMC LUN, 1 36GB external SCSI drive and 2 18GB internal SCSI drives. I was incredibly shocked at this VG to say the least.

My main goal at this point was to get rid of the SCSI drives and keep the EMC LUN in the VG. I backed up the data and vgreduced 2 of the PVs (they had no data allocated). The last SCSI drive had data from one of the LVs. I umounted the LV, lvreduced the LV, vgreduced the last SCSI drive and then lvextended again (presumably from the EMC LUN). I tried to mount the LV and had to run an fsck. Afterwards I was able to successfully remount and it appears that all of my data is there! I've done some spot checks and everything looks good.

Although the lvreduce doesn't necessarily remove the data, the fact that I removed a drive with data on it from the VG does bother me when I can't find any data loss. The other odd thing is no matter what size I create the LV (using the same name, so maybe that is the issue), when I do a bdf, it reports the original size (35G when I only allocated say 30G). I have yet to reboot, so maybe something hasn't been cleared out of memory/cache yet.

Anyway, hope this makes sense. I would love any insight someone could give. Thanks...
Honored Contributor

Re: HP-UX 11.0 and LVM oddness

You vgreduced the PV's which didn't have any PE allocated to an lvols.... this is ok to do. Then you unmounted the lv and lvreduced... ouch. :) That lvol had a filesystem on it.

How did you reduce the lvol? Which commands and was online jfs used by any chance?

Idealy you'd reduce the size of the filesystem (if online jfs) then reduce the size of the lvol. If no online jfs is availa, you'd lvreduce... then newfs and restore the data.

To play it safe at this point, I would remove the lvol and create it at the needed size. Then newfs and restore the data from backup.

If it's a learning experience and nothing too critical that you need to get stable asap, I'd mess around a bit more then reboot and then would play some more... then newfs and restore.

Occasional Visitor

Re: HP-UX 11.0 and LVM oddness

Thanks for the response, Denver.

I simply did an lvreduce -l 0 /dev/vg/lv.

It looks like my biggest problem was not doing a newfs. I swear I did, but apparently not since I just ran the newfs and everything was wiped and the lv is at the proper size now (which is what I wanted in the first place). I'm currently restoring the data now.

I used to be pretty good at this stuff years ago! ;-) Thanks again.