Operating System - HP-UX
1825775 Members
2072 Online
109687 Solutions
New Discussion

Re: reduce a filesystem using fsadm

 
SOLVED
Go to solution
lawrenzo
Trusted Contributor

reduce a filesystem using fsadm

Hello,

I have been tasked to reduce a file system by 1gb and increase an alternate filesystem by that 1gb.

I can increase using online JFS however I am not sure how to reduce the FS and do I need to reduce the LV as well?
Thanks
hello
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: reduce a filesystem using fsadm

the command is lvreduce.

A word of advice: Don't cut down the by the total amount of free space shown on bdf.

Leave lots of spare space. It is possible to trash the logical volume. Back up the data first before proceeding.

lvreduce is required as part of this process.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
RAC_1
Honored Contributor
Solution

Re: reduce a filesystem using fsadm

Backup everything on this lvol.

fsadm -b"new_size"M /dev/vgxx/xxxx
lvreduce -L "new_size"M /dev/vgxx/xxxx

Anil
There is no substitute to HARDWORK
Helen French
Honored Contributor

Re: reduce a filesystem using fsadm

I would recommend you backup the file system before making any changes. This document is a good help while using fsadm (OnlineJFS) commands to resize file systems (TKB #LVMKBRC00005082):

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000066244335
Life is a promise, fulfill it!
Hazem Mahmoud_3
Respected Contributor

Re: reduce a filesystem using fsadm

lvreduce can cause data corruption, so here are the steps you want to take:

1. tar all contents of filesystem and store on another filesystem or tape
2. lvreduce
3. untar everything back into filesystem

I think you may want to delete all the contents of the filesystem before you untar everything back into it to ensure you have good data files.
Like everyone said however, backup is key here:)

-Hazem
lawrenzo
Trusted Contributor

Re: reduce a filesystem using fsadm

cool - that's done it for me.

TY all
hello