Operating System - HP-UX
1834619 Members
2953 Online
110069 Solutions
New Discussion

fsadm - can I reduce logical volume live without losing data?

 
Regina Taylor
Contributor

fsadm - can I reduce logical volume live without losing data?

with fsadm - can I reduce logical volume live without losing data?
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor

Re: fsadm - can I reduce logical volume live without losing data?

It depends; it you are running OnlineJFS 3.3 on 11.0, or any version of OnlineJFS on 11.11 and up then an fsadm -F vxfs -b smaller_size should work. Older versions of JFS were very unreliable in this respect and often corrupted data. I've done this several times on a Sandbox with the improved filesystem and never had a problem BUT I still wouldn't trust it in a Production environemnt. I would backup first, do the fsadm, and then reduce the size of the LVOL itself. If you have the backup, you won't need it; on the other hand, ... .

Regardless of the version, expanding filesystems has always been safe and I do those without a thought.

You would have been far wiser to have left unallocated space in the VG and grow the filesystems as needed rather than having to steal from the rich to give to the poor.
If it ain't broke, I can fix that.
Rick Garland
Honored Contributor

Re: fsadm - can I reduce logical volume live without losing data?

I am leery of reducing the LV size. Too many bad memories from the past.

I make another LV.

vinod_25
Valued Contributor

Re: fsadm - can I reduce logical volume live without losing data?

hi

i always prefer to backup data before reducing the LV even for a online JFS...

To reduce an OnLineJFS file system:

1. Before reducing the JFS file system, back it up, using any
backup utility you prefer. The only backup utility that will
not work with JFS is dump(1M) which only supports HFS. You can
use vxdump(1M) in its place. Refer to the vxdump(1M) man page
for more information.

For OnLineJFS file systems, you can also use a snapshot file
system for creating backups. This allows you to backup a file
system while it is still online and in use. For more information
on this, refer to the section "Using a Snapshot File System
for Online Backup Purposes", in Chapter 4 of the manual
"HP-UX System Administration Tasks"
(HP Part No. B2355-90079 or B2355-90672).


2. Use fsadm(1M) with the -b option to resize the file system.
It is recommended that you perform directory and extent
re-organization (de-fragmentation) first.

For example:

A. To perform directory and extent re-organization, and view
de-fragmentation reports:

fsadm -d -D -e -E /(jfs_mount_point)

B. To resize the JFS file system:

fsadm -b /(jfs_mount_point)

The fsadm utility will resize the file system whose mount point
is (jfs_mount_point). If (newsize) is smaller than
the current size of the file system, an attempt will be made to
shrink the file system to (newsize) sectors.

Reducing the size of a file system can fail if there are file
system resources currently in use within the sectors to be
removed from the file system. In this case, a reorganization
may help free those busy resources and allow a subsequent
reduction in the file system size.

3. Use lvreduce to reduce the size of the logical volume:

lvreduce -L (newsize) /dev/vg##/lvol##

regards

Vinod k