Operating System - HP-UX
1833536 Members
3130 Online
110061 Solutions
New Discussion

How can i extend my root partition

 
Sakui
Frequent Advisor

How can i extend my root partition


I have a rx 4640 itanium server with hp-ux 11i ver 11.23. my root file system is full .How do i extend the root partition without damaging the OS.
6 REPLIES 6
Coolmar
Esteemed Contributor

Re: How can i extend my root partition

Use Ignite-UX to accomplish this. Run a "make_tape_recovery" then boot from the tape and interact with the recovery screen. You can then go to the filesystems and change the size of root partition.


# make_tape_recovery -a /dev/rmt/0mn -I -x inc_entire=vg00

Steven E. Protter
Exalted Contributor

Re: How can i extend my root partition

Shalom,

root partition must be contiguous and should contain no files.

It can not be extended.

You can use make_tape_recovery or make_net_recovery to make an image of the system, boot off it and use the interactive recovery option to lay the system down with a larger root partition.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sp4admin
Trusted Contributor

Re: How can i extend my root partition

Hi Sakui,

You can use a ignite reovery tape to extend the / filesystem. You first will need to create the ignite tape. Then boot from the ignite tape follow the menu and exented the file systems the reboot. of course the ill take ome down time.


sp,
Raj D.
Honored Contributor

Re: How can i extend my root partition

Sakui,

i)You need make_tape_recovery and then restore it and while restoration you can define a bigger root partition size.


ii) Or Reinstall the OS freshly with a new root partition ,after taking all backup.

Btw, how much is your root FS.


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Bill Hassell
Honored Contributor

Re: How can i extend my root partition

Extending the root filesystem is not possible without a complete reinstallation (such as using Ignite/UX). But it is very, very seldom necessary. The reason is that / never changes size significantly unless mistakes have been made. The most common reason is from a misspelled backup command that refers to a non-existent tape device (like /dev/rmt/om). Or a very large file is transferred to the / directory, most often caused by leaving root's HOME directory in the default (very bad) location.

So start by finding where the largest directories (NOT largest files) are located:

du -kx / | sort -rn | head -20

A 'normal' ia64 system will have directories about this size:

262016 /
139616 /sbin
121968 /etc
97576 /etc/vx
84200 /etc/vx/type
35536 /sbin/fs
34560 /etc/vx/type/static
22312 /etc/vx/type/gen
20792 /etc/opt
16280 /sbin/fs/vxfs
16216 /etc/vx/type/raid5

If you see /dev at the top of your list, you have a rogue file. Find (and remove) the file like this:

find /dev -type f

There are never any (ordinary) files in /dev, especially files like /dev/null2 or even /dev/nul -- those are spelling errors.

If you see any other directory near the top of the list, it has been created in the wrong place. It is far, far easier (and safer) to fix the error(s) in the filesystem than to make the filesystem bigger.


Bill Hassell, sysadmin
Geoff Wild
Honored Contributor

Re: How can i extend my root partition

Not for the faint of heart.

No outage required , if you have online jfs.
If you do not have online jfs , do all the following in LVM maintenance mode.
Note: this will only work if SWAP is NOT the next lvol after /

a. Login as root.
b. Find out a free disk / un mirror the rootvg and make that disk free.
c. find out the next logical volume after lvol3(assumed lvol3 is root)
d. pvmove that logical volume onto the newly added disk
[ pvmove -n /dev/vg00/lvol4 /dev/dsk/CURRENT /dev/dsk/NEW]
e. now you should be able to increase root filesystem to an additional `size_of_the_lvol4`.
f. pvmove the lvol4 back to root vg ( vg00)

boot,swap and root are the only lvols that needs a contegeous policy. so , it does not matter where lvol4 is.

Example, move lvol4 away from lvol3 , thus creating a contegeous space right after lvol3. If you need more space on "/" you will be able to move lvol5 ...6 to the next disk and do the stuff. Do remember to migrate them back to the original disk.

Now, if you have mirrored root vg, then break the mirror before you do this.


Practical Example (actual test)

# bdf |grep vg00
/dev/vg00/lvol3 204800 151616 53184 74% /
/dev/vg00/lvol1 125808 49064 64160 43% /stand
/dev/vg00/lvol7 4194304 2501208 1680472 60% /var
/dev/vg00/lvol6 3145728 1856304 1279456 59% /usr
/dev/vg00/lvol5 524288 160992 361104 31% /tmp
/dev/vg00/lvol4 2097152 1833496 261656 88% /opt
/dev/vg00/lvol8 1048576 622656 422632 60% /home
/dev/vg00/lvol10 2097152 1270980 774595 62% /app


Find a spare disk:

strings /etc/lvmtab |grep c7t0d6
pvcreate -f /dev/rdsk/c7t0d6
vgextend /dev/vg00 /dev/dsk/c7t0d6
lvdisplay -v /dev/vg00/lvol4 |more
lvreduce -m 0 /dev/vg00/lvol4
lvdisplay -v /dev/vg00/lvol4 |more
pvmove -n /dev/vg00/lvol4 /dev/dsk/c0t6d0 /dev/dsk/c7t0d6

lvextend -L 1024 /dev/vg00/lvol3
fsadm -b 1024M /

pvmove -n /dev/vg00/lvol4 /dev/dsk/c7t0d6 /dev/dsk/c0t6d0
vgreduce /dev/vg00 /dev/dsk/c7t0d6

lvextend -m 1 /dev/vg00/lvol4


# bdf |grep vg00
/dev/vg00/lvol3 1048576 151640 890456 15% /
/dev/vg00/lvol1 125808 49064 64160 43% /stand
/dev/vg00/lvol7 4194304 2506048 1675672 60% /var
/dev/vg00/lvol6 3145728 1856304 1279456 59% /usr
/dev/vg00/lvol5 524288 160992 361104 31% /tmp
/dev/vg00/lvol4 2097152 1833552 261600 88% /opt
/dev/vg00/lvol8 1048576 622656 422632 60% /home
/dev/vg00/lvol10 2097152 1270980 774595 62% /app


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.