LVM and VxVM

Decrease and increase file system.

 
SOLVED
Go to solution
Francisco J. Soler
Honored Contributor

Decrease and increase file system.

Hi,
I need to decresase /home and increase /var.
I have HP-UX 10.20 with JFS, i have been searching for this question in the forums and i have found this:

Decrease:
fsadm -F vxfs -b new_size /home

if i need to defrag first:
fsadm -F vxfs -d -e -s /home

Increase size:
fsadm -F vxfs -b new_size /var

The questions i have are:
1) Can i do this inside CDE with root permisions or i need to run in single user mode?
2) When man fsadm i do not find the -b option, do i have the incorrect version of fsadm?
3) Can i loose the data in the partitions?

Thanks
Frank.
Linux?. Yes, of course.
10 REPLIES 10
Ollie R
Respected Contributor

Re: Decrease and increase file system.

Hi Frank,

1) You can run in multi-user mode - in fact you have to apply the fsadm to the mount point, so the LV must be mounted

2) Check "man fsadm_vxfs"

3) You can lose data if the fsadm does not check the blocks - in later versions (Version 3 or above according to my manpage) it will relocate blocks automatically during a decrease - check what your manpage states

Hope this helps,

Ollie.
To err is human but to not award points is unforgivable
Massimo Bianchi
Honored Contributor

Re: Decrease and increase file system.

Hi,


1) you can do it in CDE, but the chance that some files in your home dir will be in use are greater. If you can go down to single user would be best

2) you have the correct version of fsadm, you should look at the man page of
fsadm_vxfs
but it rarely exists in the manpages...

Look at this thread and don't laught too much :)

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x1fd45a3e6e0bd6118ff40090279cd0f9,00.html



3) HP says no, you will not loose anything, but i will take a backup, especially of the /home. Enlarging is quite never a real problem, but descreasing... well, tried it a couple of times but never worked, always failed for inode in use or similar..


HTH,
Massimo
Massimo Bianchi
Honored Contributor

Re: Decrease and increase file system.

Man page attached :)

Sanjiv Sharma_1
Honored Contributor
Solution

Re: Decrease and increase file system.

Hi Frank,

Online reducing the filesystem has always failed for me with fsadm_vxfs.

Boot the system in the multiuser mode.

# shutdown 0
Mount /home and /var

Pls. take the backup of /home and /var.

Do an lvremove on both the lvols in the single user mode and recreate them as per requirement.

Create new filesystem and restore from backup.

Thanks,
Everything is possible
Francisco J. Soler
Honored Contributor

Re: Decrease and increase file system.

HI,
thanks for your replies, i will assign points soon.

One thing more:

What is the new_size parameter for the -b option kbytes, blocks...?

Frank.
Linux?. Yes, of course.
Sanjiv Sharma_1
Honored Contributor

Re: Decrease and increase file system.

Hi Frank,

Say the /var fs is 1000MB you want it to be 500MB.

# fsadm -F vxfs -b 500M /var

new size is the size you want the filesystem to be now.

Thanks,
Everything is possible
Sunil Sharma_1
Honored Contributor

Re: Decrease and increase file system.

-b by default in blocks and each block is of 512 byte.

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

Re: Decrease and increase file system.

Hi,
i knew the -b option was in bytes...
tested yesterday :)

fsadm -F vxfs -b size_in_mb*1024 /mount_point

will do the work..


If in doubt, a fast serch in the forum will clarify you.

HTH,
Massimo
Pete Randall
Outstanding Contributor

Re: Decrease and increase file system.

Frank,

A word of caution. In VxFS version 2 file systems (which I'm reasonably sure you have in 10.20), reducing the size of the file system will fail if there are FS structures in the areas to be reduced. You should reorg the FS first using "fsadm -F vxfs -d -D -e -E /mount_point".


Pete


Pete