Operating System - HP-UX
1834216 Members
2762 Online
110066 Solutions
New Discussion

Re: Decreasing filesystem size with SAM

 
SOLVED
Go to solution
bob_88
Occasional Contributor

Decreasing filesystem size with SAM

How can I decrease a filesystem size in SAM: say /opt from 6G to 2 G: given that the space is free.
9 REPLIES 9
Michael Tully
Honored Contributor

Re: Decreasing filesystem size with SAM

Hi,

If you have the on-line JFS product installed
on your system you can do this from the command
line using the below example. Note that the
size is in bytes.

# fsadm -F vxfs -b 2097152 /opt

I've not seen any way that this can be done from SAM.

If you don't have the product you will need to
create an ignite backup and do it from
booting from your tape and reducign the size
that way.

HTH
~Michael~
Anyone for a Mutiny ?
S.K. Chan
Honored Contributor

Re: Decreasing filesystem size with SAM

Additional to Michael's post. If you have OnlineJFS, you can use SAM to increase your filesystem on-the-fly but not decreasing it. To decrease it you have to use command line. First check if you have OnlineJFS installed.
# swlist -l bundle|grep -i online

If you have it you would reduce it like so ..
# fsadm -F vxfs -b 2048000 /opt
==> 2000*1024=2048000
# lvreduce -L 2000 /dev/vg00/lvol4
==>assuming lvol4 is your /opt

I would recommend doing a full backup of /opt bfore reducing it.
Wodisch
Honored Contributor

Re: Decreasing filesystem size with SAM

Hi,

and you will need the JFS3.3, since the reduction usually does not work with the JFS3.0 :-(

Just my $0.02,
Wodisch
Ravi_8
Honored Contributor

Re: Decreasing filesystem size with SAM

Hi,

Decreasing the file system size, will result in loss of data, even if u have on-line JFS.

Better way is to have a backup, remove the file system, recreate it for the required size and recover from backup.
never give up
harry d brown jr
Honored Contributor

Re: Decreasing filesystem size with SAM

backup /opt, delete it, then recreate it at 2GB and restore your data.

IF you USE lvreduce, you will most likely LOSE DATA.

live free or die
harry
Live Free or Die
Bill McNAMARA_1
Honored Contributor

Re: Decreasing filesystem size with SAM

Main reason you need online JFS is that defragmentation of the filesystem is not possible without it (other than by copy/creating)

The lvol can be reduced as you like, but the data will not be reorganised when the lvol is... thus potential (probable) problems.

Later,
Bill
It works for me (tm)
Luc Bussieres_1
Trusted Contributor

Re: Decreasing filesystem size with SAM

Bob,

Another thing you absolutly want to do before trying to shrink your filesystem with online JFS, it's to defragment the disk so all free extents will be at the end of the disk and the used one at the beginning. to do this you execute the following fsadm:

fsadm -F vxfs -d -D -e -E /mount_point

But first take a backup you never know what could happen when shrinking a filesystem.

Luc
Sanjay_6
Honored Contributor

Re: Decreasing filesystem size with SAM

Hi Bob,

You cannot decrease the size of the filesystem safely. What you should do is take a backup of the filesystem, remove the lv and then recreate the lv with the desired size and then restore the data.

Hope this helps.

regds
David Burgess
Esteemed Contributor
Solution

Re: Decreasing filesystem size with SAM

As previously mentioned you will need to remove and recreate the lv as reducing could lose data. Backup /opt first.

You'd be better off doing this in single user mode so /opt isn't busy.

Check no processes reside on /opt
/usr/sbin/fuser -c /opt

bdf to get the lvol
umount /opt
lvremove /dev/vg00/lvolx (where x is the lvol number)
lvcreate -L 2000 -n lvolx /dev/vg00
newfs -F (vxfs or hfs) /dev/vg00/rlvolx
mount /opt
Restore your data

HTH

Dave.