1847920 Members
4489 Online
104021 Solutions
New Discussion

Re: reduce volume

 
SOLVED
Go to solution
Nobody's Hero
Valued Contributor

reduce volume

I need to reduce the following oracle mount point:

/dev/vg09/lvol1 59523072 21802080 37426344 37% /u08

what command would I use, vgreduce ot lvreduce?
UNIX IS GOOD
7 REPLIES 7
Vitek Pepas
Valued Contributor

Re: reduce volume

Unmount the filesystem and use lvreduce.
John Poff
Honored Contributor
Solution

Re: reduce volume

Hi,

You'll be looking for 'lvreduce'. The 'vgreduce' command is for removing physical volumes from your volume group.

I've never successfully done an lvreduce and had the filesystem survive it. I read here on the forum once that it can work but the poster suggested using 'fsadm' to defrag the filesystem first. I would most certainly get a good backup copy of the data before trying it.

The only way I've been able to do it before is to backup the data, remove the logical volume, recreate the logical volume at the smaller size, recreate the filesystem, and restore the data.

JP
Pete Randall
Outstanding Contributor

Re: reduce volume

Robert,

As JP mentioned, I've not had much success with lvreduce. If you have the space, I would make another logical volume of the desired size and copy the contents of /u08 into it, then blow /u08 away.


Pete


Pete
Sundar_7
Honored Contributor

Re: reduce volume

Hi,

As said, only in very rare cases lvreduce succeed.

Two things

1) Defragment the filesyetm

fsadm -dDeE /mountpoint

2) Backup it up to the tapes or to an alternate location.

3) use fsadm to reduce the size and lvreduce.

if lvreduce is not successful then recreate the LV, newfs and restore from backup.

Thanks,

Sundar.

Learn What to do ,How to do and more importantly When to do ?
Bryan D. Quinn
Respected Contributor

Re: reduce volume

Hey Robert,

Unmount and use lvreduce. If the lvreduce frees up enough extents to free up an entire physical volume in the volume group, then you can do a vgreduce. The vgreduce will remove the designated physical volume from the volume group.

I would definately heed John's words though. I have performed a couple of lvreduce commands, but never in a production environment. I would most definately have a good backup. That safety net is a must.

-Bryan
Helen French
Honored Contributor

Re: reduce volume

The command should be 'lvreduce'. But remember these things when you do it:

1) Backup your data on this file system
2) If you have OnlineJFS, you can do it 'on the fly'
3) I would recommend doing 'backup first, lvremove second, lvcreate third and restore last' option. This will be more safe.
Life is a promise, fulfill it!
GK_5
Regular Advisor

Re: reduce volume

The safest way to do is
1. Create new volume of desired size - Copy data to new volume - Remove original volume
Or
2. Backup the data - Remove original volume - Create new volume with desired size - Restore data.

-GK-
IT is great!