Operating System - HP-UX
1753729 Members
4697 Online
108799 Solutions
New Discussion юеВ

How to increase root filesystem size.

 
SOLVED
Go to solution
Prasad Joshi
Regular Advisor

How to increase root filesystem size.

Hi All,

I have installed HP-UX on a machine. But, by mistake i made root (/) very small about 500 MB.

I have about 9GB unallocated.

Is there any way to increase the size of the root filesystem.

I need to unmount the filesystem which we want to increase, but I can not unmount root.


So pl. can any one help me ?
I do not want to reinstall OS again, Is there any way around?

Thanks & regards.
Prasad
10 REPLIES 10
RAC_1
Honored Contributor

Re: How to increase root filesystem size.

500 MB should be enough. root is static file system and should not grow much. If you want to increase it, you can take ignite backup and start recovering the system. There is also a unsupported method. In this method, the next lvol (after root) is moved and then root is extended.
There is no substitute to HARDWORK
Arunvijai_4
Honored Contributor

Re: How to increase root filesystem size.

Hi Prasad,

To increase root (/), only way around is to Re-ignite the system. You can't extend it by anyother way.

But, 500MB will be sufficient unless or untill you dont start cluttering /.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: How to increase root filesystem size.

For extending / root file system you have to make backup and recover with make_net_backup and recover operation.

Or else allocated that space to new lovl. Create file system and use that for operation.

Or extend some other file system like /root or other to occupy that space.

--
Muthu

Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: How to increase root filesystem size.

Prasad Joshi
Regular Advisor

Re: How to increase root filesystem size.

Hi All,

I tried this.

bash-2.02# vgdisplay -v vg00
--- Physical volumes ---
PV Name /dev/dsk/c2t0d0
PV Status available
Total PE 4340
Free PE 1135
Autoswitch On

bash-2.02# ioscan -fnC disk
disk 0 0/0/2/0.0.0.0 sdisk CLAIMED DEVICE TEAC DV-28E-C
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0
disk 36 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 36.4GMAU3036NC
/dev/dsk/c2t0d0 /dev/rdsk/c2t0d0
disk 40 0/1/1/0.1.0 sdisk CLAIMED DEVICE HP 36.4GMAU3036NC

I have created VG on
/dev/dsk/c2t0d0

I do have on more disk /dev/dsk/c2t0d0

Now, can I do this

1. Mirror c2t0d0 to c2t0d0

2. while mirroring increase root volume

3. make c2t0d0 as my new primary


Pl send replay, i need help.
Thanks a lot.

Thanks & regards.
Prasad.
Arunvijai_4
Honored Contributor

Re: How to increase root filesystem size.

Prasad,

Read Bhavin's reply in this thread,

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=785327

-Arun

[Moderator edit: The above link is no longer valid.]

"A ship in the harbor is safe, but that is not what ships are built for"
Baiju Kumar.B_1
Advisor

Re: How to increase root filesystem size.

Dear prasad,
hp is recommending only one option for this purpose ,take the ignite backup using make_tape_recovery command and make the boot tape ,reboot the machine and boot it from this recovery tape while restoring please go through advanced option you can modify any file system under volume group vg00 and restore the entire os ,every thing will fine
regards
BAIJU
nothing is impossible
James A. Donovan
Honored Contributor
Solution

Re: How to increase root filesystem size.

The standard and, I think, the only HP supported method, to extend root (/) is to create a recovery tape using Ignite, and rebuild vg00 using that. And that is the method I would recommend you use...

However.....when you look at the way a standard vg00 volume group is laid out by HP, extending the root filesystem is not particularly difficult from a technical standpoint.

HP-UX requires that /stand, your swap volume and root (/), all be contiguous, with /stand needing to be on the first logical volume on the disk.

/dev/vg00/lvol1 --> /stand
/dev/vg00/lvol2 --> swap
/dev/vg00/lvol3 --> /
/dev/vg00/lvol4 --> /tmp

A typical server configuration then has /tmp mounted on the 4th logical volume.

$pvdisplay -v /dev/dsk/c1t2d0
01146 current /dev/vg00/lvol3 00047
01147 current /dev/vg00/lvol3 00048
01148 current /dev/vg00/lvol3 00049
01149 current /dev/vg00/lvol4 00000
01150 current /dev/vg00/lvol4 00001
01151 current /dev/vg00/lvol4 00002
01152 current /dev/vg00/lvol4 00003

There are no requirements for /tmp to be on a contiguous volume (or even needing it to exist!). So, to extend the root logical volume, just create a new volume for /tmp (e.g. /dev/vg00/lvoltmp), and move any data from the old volume to the new one. You are then free to remove /dev/vg00/lvol4. Then when issuing the lvextend command for lvol3, since the free extents are allocated based on their order on disk, the newly freed extents get used up...

$ pvdisplay -v /dev/dsk/c1t2d0
01146 current /dev/vg00/lvol3 00047
01147 current /dev/vg00/lvol3 00048
01148 current /dev/vg00/lvol3 00049
01149 current /dev/vg00/lvol3 00050
01150 current /dev/vg00/lvol3 00051
01151 current /dev/vg00/lvol3 00052
01152 current /dev/vg00/lvol3 00053

So, the typical process would be as follows (your logical volume sizes may vary...)

1) Backup /tmp
2) Un-mirror all vg00 logical volumes
3) Reboot server to single-user mode
4) lvremove /dev/vg00/lvol4
5) lvextend -L 300m /dev/vg00/lvol3
6) lvcreate -n lvol4 vg00
7) lvextend -L 2048m /dev/vg00/lvol4
8) newfs -F vxfs -o largefiles /dev/vg00/rlvol4
9) init 1
10) fsadm -F vxfs -b $((300*1024)) /
11) init 3
12) re-mirror vg00 logical volumes

On step 10, you may need to use the extendfs command instead, if you do not have OnlineJFS.

I would recommend working through this on a box you can "destroy" and rebuild at will, in order to familiarize yourself with all the commands involved.
Remember, wherever you go, there you are...
Bill Hassell
Honored Contributor

Re: How to increase root filesystem size.

500Mb is far more than needed in the / volume. The reason it is so full is that somone has not stored files in the right directories. As mentioned, / is static (doesn't change size signikficantly) so 250 megs is more than adequate for the smallest to largest systems. Since trying to resize / is a big job (even using Ignite/UX) with mistakes causing total loss of the system, it is far better to fix the original problem (files in the wrong directory).

Before starting any fixes, analyze the directories:

du -kx / | sort -rn | head

The 3 largest directories will be / (of course), /sbin and /etc. The units of measure are Kbytes (the -k option). Here are a series of possible problems and fixes:

1. /dev is large. /dev should be 15k to 30k but if it is larger, there are misplaced files in the directory. Since /dev ONLY contains directories and device files, any ordinary files must be moved or removed. The most common problem is mispelling a device file for a backup program like tar:

tar -cvf /dev/rmt/om /
tar -cvf /dev/rmt/0m /

See the subtle spelling error (om vs. 0m)? The spelling error will create massively large file called /dev/rmt/om. To find all the bad files:

find /dev -type f

If anything is shown, it must be removed.

2. Any directory that is more than 10-20megs
(10000+) that is not in /sbin or /etc is suspect. This can be caused by bad install programs or logfiles that should never be in /. Move these directories to more appropriate directories (applications = /opt, logfiles = /var/adm)

3. If the first line in the du listing (/) is much larger than the next largest directory, then the / directory is full of junk. Find the biggest files like this:

ll | sort -rnk5 | head

The default location for root's home is /, a very bad default. All sysadmins will agree that always defaulting to / when root logs in is very risky. So root-droppings (tempfiles, test data, etc) will fill up the / directory. A well-managed / directory will have NO files! It will only contain directories, some of which are mountpoints.

One of the other problems in making / bigger is that it will never be large enough unless you manage the volume. Mistakes should be corrected rather than just making more disk space.


Bill Hassell, sysadmin