Operating System - HP-UX
1834236 Members
2343 Online
110066 Solutions
New Discussion

How to resize /tmp , /opt ?

 
Deepu Chakravarty
Regular Advisor

How to resize /tmp , /opt ?

I have server rp3440 with HP-UX 11.11

I need to resize the /tmp and /opt with new (reduced) size. Current bdf of /tmp and /opt as follows :

/dev/vg00/lvol6 20480000 3072 20317024 0% /tmp
/dev/vg00/lvol5 20480000 2088320 18248016 10% /opt

I need the new size of /tmp as 500M and /opt as 10G.

How I can do this ? Pls suggest.
3 REPLIES 3
Ravi_8
Honored Contributor

Re: How to resize /tmp , /opt ?


Hi

Since you need to reduce the size, better way is ignite. else backup /opt and /tmp.

and use lvreduce to resize

#lvreduce -l 10240 /dev/vg00/lvol5
#lvreduce -l 500 /dev/vg00/lvol6

restore from backup
never give up
Sunil Sharma_1
Honored Contributor

Re: How to resize /tmp , /opt ?

Deepu,

if you have online JFS installed you can follow steps mention below.

1. Backup data (Optional but highly recommended)
2. fsadm -F vxfs -d -D -e -e /opt
3. fsadm -F vxfs -b /opt
4. lvreduce -L /dev/vg00/

Size mentioned in lvreduce command should be same or higher then size mentioned in fsadm otherwise data will corrupt.

same steps for /tmp file system.


If you don't have online JFS then take ignite backup with -i switch. this will allow you to change filesystem size during restoration from tape.

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
Slawomir Gora
Honored Contributor

Re: How to resize /tmp , /opt ?

Hi,

if you have installed OnlineJFS you can do:
1. check if OnlineJFS is installed
swlist -l product | grep -i onlinejfs
2. fsadm -F vxfs -de /tmp
3. fsadm -F vxfs -b $((1024*500)) /tmp
4. lvreduce -L 500 /dev/vg00/lvol6

the same way for /opt

if you don't have OnlineJFS license you have to
1. backup you data for /tmp and /opt
2. use lvreduce command to reduce lvols
lvreduce -L 10000 /dev/vg00/lvol5
lvreduce -L 500 /dev/vg00/lvol6
3. create new filesystem
newfs -F vxfs /dev/vg00/rlvol5
newfs -F vxfs /dev/vg00/rlvol6
4. restore your data from backup