Operating System - HP-UX
1833873 Members
2232 Online
110063 Solutions
New Discussion

Re: I need to squeeze out some didk space

 
SOLVED
Go to solution
Marty Metras
Super Advisor

I need to squeeze out some didk space

I need some more disk space in my /use partition. I do not have any more free space in vg00.
I have a bunch of free space in /opt that is also in vg00.
There are process running using /opt so I have to play some games to get some down time.
Here is my thoughts how I can fix this problem using my skill level.
First use "shutdown 0" to get it into single user mode.
mount /usr so I can get the commands I need.
copy /opt to another location.
Drop and recreate the /opt partition makeing it smaller.
Then copy /opt back to this new location.
Then bring the system back up.
Then extend the size of of /usr.
Woops! I forgot I wont have "sam' will I?
What are the commands I would use to drop /opt and recreate it?
I should learn that.
Can you guide me with this?
Marty
Using HP-UX 11.0 here.

The only thing that always remain the same are the changes.
14 REPLIES 14
Pedro Cirne
Esteemed Contributor

Re: I need to squeeze out some didk space

Hi,

That's a risky approach, I really don't know if it will work. An easier and clean solution would be to make a ignite tape_recovery including all vg00. Then you may boot from tape and resize filesystems as you want:

#make_tape_recovery -v -I -x inc_entire=vg00

The boot from this tape, reboot the server and interrupt the boot on the 10 seconds messages, search for bootable devices, select the tape drive and follow instructions :)

Another alternative would be to do it on-line, but this is possible only if you have "On-Line JFS" installed. You may check if you have it by:

root@porsx011:/# swlist -l product|grep -i online
OnlineJFS B.11.11 Online features of the VxFS File System


Enjoy :)

Pedro
Simon Hargrave
Honored Contributor

Re: I need to squeeze out some didk space

I'm assuming you don't have OnlineJFS, otherwise you could do this online (swlist OnlineJFS".

Yes I would backup /opt to tape with tar.

To remove and recreate your /opt you would: -

unmount /opt

lvreduce -L newsize /dev/vg00/lvol4

This will reduce the logical volume to "newsize". No need to remove and recreate since you are recreating the filesystem anyway.

Then newfs -Fvxfs /dev/vg00/rlvol4

Then mount the filesystem.

Then restore your tape.

You can then unmount /usr, then use vgextend and extendfs to grow /usr.

However I'd seriously consider investing on OnlineJFS if you don't have it already, saves a lot of headaches!
Pete Randall
Outstanding Contributor

Re: I need to squeeze out some didk space

Marty,

You can use SAM in single user mode. Just do a "mount -a" when it comes up. Then umount /opt. Shrink /opt, then umount and grow /usr. You won't have SAM available but all you have to do is lvextend and extendfs. Then come back up.


Pete

Pete
Marty Metras
Super Advisor

Re: I need to squeeze out some didk space

Pedro,

I do not have JFS.
Ignite tape should work. I haven't done a boot from Ignite. It may be goot time to learn. I have been doing the Make_Tape_recover tapes for quite a while.
Thanks,
Marty
The only thing that always remain the same are the changes.
Marty Metras
Super Advisor

Re: I need to squeeze out some didk space

How would you do this with OnlineJFS?

Marty
The only thing that always remain the same are the changes.
Mel Burslan
Honored Contributor

Re: I need to squeeze out some didk space

as an example you have a 2GB /opt and you want it to become 1GB

fsadm -F vxfs -b 1000M /opt

is the command
________________________________
UNIX because I majored in cryptology...
Pedro Cirne
Esteemed Contributor

Re: I need to squeeze out some didk space

Hi,

Mel didnt mention that before extending filesystem with fsadm you must extend lvol:

lvextend -L 1000 /dev/vg##/lvol##

Enjoy :)

Pedro
Mel Burslan
Honored Contributor

Re: I need to squeeze out some didk space

Pedro,

We are talking about reducing the filesystem size not extending it.

Actually after the fsadm command, one needs to shrink the size of the logical volume with lvreduce command.

But again, reducing filesystem and logical volume sizes are very risky at best.

My advice: have a known-good backup before committing to any of this.
________________________________
UNIX because I majored in cryptology...
Pedro Cirne
Esteemed Contributor

Re: I need to squeeze out some didk space

Hi,

Mel, yes you are right, but Marty also wants to extend /usr :)

Enjoy :)

Pedro
Marty Metras
Super Advisor

Re: I need to squeeze out some didk space

Guys,
Entending /usr is not a problem.
I can do that in "sam" any time. I have done that already. I just need some space.
It is taking space back from /opt that I was not sure about.
When I said I did not have OnlineJFS I may have been mistaking.
As you see I do have it.
B3929BA B.11.00 HP OnLineJFS (Advanced VxFS)
PHKL_22393 1.0 VxFS 31 OnlineJFS cumulative patch
PHKL_24201 1.0 JFS;stickybit;quota access;vx_maxlink tunabl

I also have the "fsadm" command.
Some time I use thing I do not know have.
I know reducing space is always risky.
And I preach Backup!, Backup! Backup.
I keep 4 online copies of the out production database and put it on tape too.
Wait, stop preaching Marty.

So to do this reduce thing.
After the backup, use the fsadm command and then restore the /opt backup.
Since I have JFS do I still have to still go down to single user mode?
Marty
The only thing that always remain the same are the changes.
Mel Burslan
Honored Contributor
Solution

Re: I need to squeeze out some didk space

if you reduce the size of /opt, using fsadm, you should not need to go down to single user or restore the contents of the /opt right away. When you take away some space from logical volume, which /opt is sitting on is the risky part.

againg with the example for from 2G to 1G

fsadm -F vxfs -b 1000M /opt

(completes successfully)

lvreduce -L 1000 /dev/vg00/lvol5

if this completes successfully as well, you should be good to go with extending /usr. If not, well, bring out the backup tapes, recreate lvol5, then newfs, then mount /opt, then restore from tape... worst case scenario.
________________________________
UNIX because I majored in cryptology...
Pedro Cirne
Esteemed Contributor

Re: I need to squeeze out some didk space

Hi,

You have On-line JFS so it's much easier!

1ºHave a good backup, just-in-case :)
2ºfsadm -F vxfs -b new_size_optM /opt
3ºlvreduce -L new_size_opt /dev/vg00/lvol##
4ºlvextend -L new_size_usr /dev/vg00/lvol##
5ºfsadm -F vxfs -b new_size_usr /usr

That's all, don't forget the "M" after the size on fsadm!

Enjoy :)

Pedro
A. Clay Stephenson
Acclaimed Contributor

Re: I need to squeeze out some didk space

Sadly, reducing the size of a vxfs with your version of Vxfs (3.1) is prone to data corruption. My approach to this would be to backup the /usr file system and delete the LVOL and recreate it. Newer versions handle shrinking the filesystem well but your version often corrupts the filesystem.
If it ain't broke, I can fix that.
Marty Metras
Super Advisor

Re: I need to squeeze out some didk space

Thanks for all your help.
I understand the risk in changing any thing to do with the OS and FS so I will have a double backup and make see what I can do.

Thanks again for your help.
Marty
The only thing that always remain the same are the changes.