1848964 Members
7007 Online
104040 Solutions
New Discussion

Filesystem reduce

 
Sanjiv Sharma_1
Honored Contributor

Filesystem reduce

Hi,

I have a N-Class with HP-UX 11.00.

I have extended the /tmp filesystem to 5 GB by mistake. I want it to be 500 MB.

Steps followed:
Booted in Single User Mode.
# lvextend -L 5000 /dev/vg00/lvol4
# extendfs -F vxfs /dev/vg00/rlvol4

My intension was to make /tmp 500 MB.

What needs to be done? Give me the steps/commands.

Thanks,
Raje.


Everything is possible
4 REPLIES 4
Stefan Farrelly
Honored Contributor

Re: Filesystem reduce


If you have OnlineJFS you can reduce it on the fly (no reboot) but from youre above commands it appears you do NOT have OnlineJFS, which means the only way to reduce /tmp is;

1. boot in LVM maintenance mode. Remove the /tmp lvol (/dev/vg00/lvol4). Create a new one to the size you want, reboot.

2. Its probably easier at this point to create a new lvol to the size you want /tmp to be (eg. lvcreate -L 500 vg00) - lets say its lvol 10, then vi /etc/fstab, change the entry for /tmp (/dev/vg00/lvol4) to the new lvol (eg. /dev/vg00/lvol10). Then reboot, /tmp will now be /dev/vg00/lvol10, then you can remove the old /dev/vg00/lvol4 to free up the 5GB.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Sanjiv Sharma_1
Honored Contributor

Re: Filesystem reduce

Hi Stefen,

I have booted in Maintenance Mode and done the following.

# lvremove /dev/vg00/lvol4
# lvcreate -L 500 /dev/vg00/lvol4

Now what needs to be done.

After booting in the multiuser mode, I can see /tmp to be 500 MB in sam and 5 GB in bdf.

Where I have gone wrong and how to resolve this? Pls. give the command stepwise.

Everything is possible

Re: Filesystem reduce

It doesn't look like you created a file system on the new lvol - I'm afraid its back to single user mode, and then:

newfs -F vxfs /dev/vg00/rlvol4

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Arockia Jegan
Trusted Contributor

Re: Filesystem reduce

Hi Raje,

If you don't have online JFS installed on your system,
then you need to recreate the volume.

Find out the logical volume used by /tmp file system from /etc/fstab file. If /tmp is mounted unmount that file system
#umount /tmp

Create the new file system in that volume

#newfs -F vxfs -s 512000 /dev/vg00/lvol4

mount that volume
#mount /tmp

If you have online JFS installed on your system,
use the following command to reduce the file system size

#fsadm -F vxfs -b 500M /tmp

You should reduce the logical volume size now. Because reducing a file system doesn't automatically reduce the size of the logical volume that the file system is in.

To reduce the logical volume

#lvreduce -L 500 /dev/vg00/lvol4