Operating System - HP-UX
1829456 Members
2558 Online
109992 Solutions
New Discussion

Re: Extending and reducing file systems

 
SOLVED
Go to solution
NOreen Merrick
Frequent Advisor

Extending and reducing file systems

Hi Guys,


Could I check some extend and reduce LVm commands before I execute them? I have a hp-ux 11.0 and I need to reshape the partitions. I want to extend / /opt and /home and I want to decrease /var and /usr.

It is not mirrored. Only contains 1 17GIG disk and I will take it offline when doing all. I don't have online JFS. I have only one volume group vg00.

Are the following commands correct?

For extending root

/sbin/lvextend -L 2000 /dev/vg00/lvol3
/sbin/extendfs /dev/vg00/rlvol3

For extending /opt

/sbin/lvextend -L 744 /dev/vg00/lvol6
/sbin/extendfs /dev/vg00/rlvol6

For reducing /var

fsadm -F vxfs -n 920 /dev/vg00/lvol8
lvreduce -l 920 /dev/vg00/lvol8

Am not sure is vxfs correct here?


For reducing /home

fsadm -F vxfs -n 1196 /dev/vg00/lvol5
lvreduce -l 1196 /dev/vg00/lvol5


For reducing /usr

fsadm -F vxfs -n 920 /dev/vg00/lvol7
lvreduce -l 920 /dev/vg00/lvol8


I have checked that the amount I am reducing to is greater that what is currently the percentage being used.

Also any comments on the sizes of the file systems? I had stuck with the default sizes when I installed the OS but now I need it to be the same as another box and also will be adding 3 more file systems for Oracle but am concerned about / and /var size, are they ok? do you think?


Thanks
Noreen






8 REPLIES 8
James R. Ferguson
Acclaimed Contributor
Solution

Re: Extending and reducing file systems

Hi Noreen:

> I need it to be the same as another box and also will be adding 3 more file systems for Oracle

Let's stop and begin there. I hope that you are *not* going to add Oracle (or any application) filesystems to vg00. To do do will make the on-going management, upgrade and potential recovery of vg00 more difficult than it needs to be. The boot disk should be reserved for the standard operating system logical volumes *only*.

Next, you are not going to be able to extend lvol3 ("/") without first "moving" the adjacent logical volume's extents. The extents of the root filesystem need to be contiguous.

If you *really* insist (must) resize your vg00 logical volumes I urge you to take an Ignite make_tape_recovery image and re-Ignite your server. Use Ignite's advanced installation mode if you do and you will be able to (re)size the logical volumes to your taste.

Regards!

...JRF...
Michael Allmer
Frequent Advisor

Re: Extending and reducing file systems

You commnads to extend the logical volume and extend the file system are correct.

I do not thinkg that you can reduce /var or /usr. lvreduce only reduces the physical extents not the file system. If you run those commands you could risk data loss and/or corruption.

See "man lmreduce" for more details.
Pete Randall
Outstanding Contributor

Re: Extending and reducing file systems

Noreen,

Your primary issue with this is not the syntax of your commands, it's the fact that you have to unmount the file system in order to run extendfs unless you have onlineJFS, in which case you use fsadm, not extendfs.

The other major problem is that / needs to be contiguous with swap and /stand, so the only way to extend either involves a lot of simultaneous shuffling of other file systems or using an Ignite backup to recover your root volume, resizing things in the process. By far the easiest is the Ignite approach.


Pete

Pete
Court Campbell
Honored Contributor

Re: Extending and reducing file systems

I agree with james. the / fielsystem should be contiguous. Install ignite. Then use:

make_tape_recovery -I -x inc_entire=vg00

Boot of the tape and you will get an interative install. You could change the sizes during this.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
NOreen Merrick
Frequent Advisor

Re: Extending and reducing file systems

Hi Guys,


thanks for the instant comments, brilliant.

I don't particularly want to increase / and I don't have ignite? What's ignite? Maybe I have it, does this mean to basically install the OS again and do advanced install so I can avoid the default space allocation? The data on the system is not important so am not worried about losing it (theres nothing there really anyway) but I need the config to be the "same " or as close to the other box as possible. Would it be ok to leave / at the size it is currently 140 MB?

Here is bdf from the other box. I guess this is incorrectly configured, probably cos we don't have a dedicated sys admin and they are only test boxes.


bash-2.04# bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 2048000 32903 1890321 2% /
/dev/vg00/lvol1 83733 34882 40477 46% /stand
/dev/vg00/lvol13 942080 514918 401429 56% /var
/dev/vg00/lvol12 942080 799956 134121 86% /usr
/dev/vg00/lvol11 921600 32166 835595 4% /tmp
/dev/vg00/lvol10 1388544 338711 989144 26% /ora03
/dev/vg00/lvol9 1441792 1438179 3454 100% /ora02
/dev/vg00/lvol8 4124672 4014563 103336 97% /ora01
/dev/vg00/lvol7 761856 329887 405251 45% /opt
/dev/vg00/lvol6 2043904 4051 1914794 0% /misc
/dev/vg00/lvol5 1224704 725759 467906 61% /home
/dev/vg00/lvol4 798720 15222 737209 2% /app
bash-2.04#


Question Mike what does this mean "lvreduce only reduces the physical extents not the file system" ? Is fsadm -F .... incorrect?


Could I get away with leaving / as is, extending /opt , reducing /var, /home and /usr and making the three new lvols mounted on /ora1 /ora2 and /ora3 on vg00 ( from sys admin point of view i know its wrong but from "can do " point of view is it possible?) Btw i didnt config the other box. Its bin like that since well before I got here. In fact just checked another box and its the same, ora 1 2 3 on same vg as root so perhaps there is a reason for it, no manager around to ask at the moment. I mean can I create another vol grp on the same disk as root. I mean if the disk fails then everything fails?

Maybe am not making sense its late in the day ...

noreen











Thanks

Noreen




Court Campbell
Honored Contributor

Re: Extending and reducing file systems

Ignite is basically a tool used to create images of an HP-UX box. you can see of you have ignite via:

swlist | grep -i ignite

if something is output on your screen saying Ignite, then you have it installed.

If you have a tape drive use the command I mentioned earlier. It will basically snapshot your current installation. You can then reboot, interrupt the boot process, and then boot from tape. You will be shown an installation screen in which you can make changes to the way the OS is laid out, etc. If you only make mods to the filesystem sizes, everything else should be the same. Hope that helps.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Court Campbell
Honored Contributor

Re: Extending and reducing file systems

Almost forgot, if you don;t have ignite it can be downloaded from http://software.hp.com. It's free, so get it if you don't have it.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
NOreen Merrick
Frequent Advisor

Re: Extending and reducing file systems

Hi Court,

I don't have ignite i just checked. I'll try download it now.

N