- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Reducing logical volume
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2007 01:32 AM
03-24-2007 01:32 AM
# bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 1024000 140304 876848 14% /
/dev/vg00/lvol1 503736 84824 368536 19% /stand
/dev/vg00/lvol8 5120000 4064160 1048192 79% /var
/dev/vg00/lvol7 3072000 1652144 1408776 54% /usr
/dev/vg03/lvol4 20480000 2764784 17438476 14% /u04
/dev/vg00/lvol4 1024000 803848 218960 79% /tmp
/dev/vg01/lvol1 10240000 5291522 4793870 52% /oracle
/dev/vg00/lvol6 3072000 1307504 1750736 43% /opt
/dev/vg00/lvol5 2048000 134136 1898944 7% /home
/dev/vg01/lvol2 16384000 8823710 7325378 55% /arch
/dev/vg03/lvol5 153600000 29490560 123139952 19% /u05
/dev/vg03/lvol1 81920000 59100040 22641696 72% /u01
/dev/vg03/lvol2 81920000 62656576 19112992 77% /u02
/dev/vg03/lvol3 81920000 53490664 28207240 65% /u03
and I want set logical volume lvol5 to 70GB i.e reduce from 150GB to 70GB. I am trying via lreduce -L 7000 /dev/vg03/lvol5 but giving warning message that data might be lost or corrupted. I am really worried about that because oracle archive file destination was being set on these volume and suspicious to go further.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2007 02:17 AM
03-24-2007 02:17 AM
Re: Reducing logical volume
The warning message was wise to evaulate. You need to _first_ reduce the size of the filesystem contained within the logical volume (with 'fsadm') and then 'lvreduce' the logical volume. If you have already reduced the filesystem size then you may ignore the warning.
If this isn't a VxVS (JFS) filesystem (unlikely) or if you don't have OnlineJFS (I hope not) then you must backup any data that you want saved; 'lvreduce' the filesystem; 'newfs' a filesystem within the logical volume; and reload your data.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2007 02:27 AM
03-24-2007 02:27 AM
Re: Reducing logical volume
Otherwise, you have to save the data on another disk or tape, un-mount the filesystem, use lvreduce, then newfs to recreate an empty filesystem, re-mount the filesystem and restore the data.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2007 06:59 AM
03-24-2007 06:59 AM
Re: Reducing logical volume
It may be too late, but if your data is still there back it up prior to proceeding.
You may be interested to know that some of your data may be sitting on the end of the logical volume and will be chopped off. Please read Bill's post very carefully.
I even do this when OnlineJFS is avaiable.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2007 10:24 PM
03-24-2007 10:24 PM
Re: Reducing logical volume
reducing a filesystem is task with quite delicacy. It has four steps.
1. Considering thoroughly
2. Defragmenting filesystem we want to reduce
3. Reducing filesystem via fsadm
4. Reducing underlying logical volume via lvreduce.
We do have OnlineJFS on the system, do we?
As you say you want to reduce /u05 (/dev/vg03/lvol5), which is quite fine as you have this filesystem filled up only up to 19%.
Defragmentation will happen by using:
# fsadm -d -e -D -E /u05
-d and -D handle directory fragmentation and report it's state both before and after the process
- e and -E do the same as above but with extents
After you have it defragmented, you can use fsadm to reduce the filesystem. Like:
# fsadm -F vxfs -b 70000M /u05
By this, we have filesystem reduced and now we are waiting only for logical volume reduce. Please - do not use -L in lvreduce (or lvextend), it rounds up things. Be nice to LVM and use -l which uses number of extents. Check of extent size via lvdisplay, divide 70000M by this extent size and you'll get number of extents to which we are reducing the logical volume to. For example you have 16M per extent, and you want to have 70000M on this logical volume, this gets us 4375 extents.
# lvreduce -l 4375 /dev/vg03/lvol5
And you're done. It is wise also to verify extent distribution via lvdisplay -v, just to have things checked.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2007 04:44 PM
03-25-2007 04:44 PM
Re: Reducing logical volume
Thanks for your suggestion and steps followed. I already did in our test enviornment by reducing volume /arch directly using lvreduce and got into problem.Following is the snapshot of what I did.
# bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 1024000 884040 138896 86% /
/dev/vg00/lvol1 503736 165520 287840 37% /stand
/dev/vg00/lvol8 5120000 2178160 2919432 43% /var
/dev/vg00/lvol7 3072000 1654624 1406368 54% /usr
/dev/vg03/lvol5 184320000 172080864 12143552 93% /u05
/dev/vg03/lvol4 20480000 18071308 2371124 88% /u04
/dev/vg03/lvol3 71680000 57544168 14025400 80% /u03
/dev/vg03/lvol2 71680000 64412392 7210896 90% /u02
/dev/vg03/lvol1 71680000 59756096 11831064 83% /u01
/dev/vg00/lvol4 1024000 29448 987432 3% /tmp
/dev/vg01/lvol1 10240000 5005164 5071254 50% /oracle
/dev/vg00/lvol6 3072000 1308472 1749776 43% /opt
/dev/vg00/lvol5 2048000 195416 1838176 10% /home
/dev/vg01/lvol2 16384000 310452 15571284 2% /arch
# lvreduce -L 12000 /dev/vg01/lvol2
The Logical Volume has a mounted filesystem on it.
Logical volume "/dev/vg01/lvol2" is not reduced.
# umount /arch
# lvrduce -L 12000 /dev/vg01/lvol2
sh: lvrduce: not found.
# lvreduce -L 12000 /dev/vg01/lvol2
Warning: The Logical Volume has a file system larger than the reduced size.
Reducing the Logical Volume will cause filesystem corruption.
When a logical volume is reduced useful data might get lost;
do you really want the command to proceed (y/n) : y
Logical volume "/dev/vg01/lvol2" has been successfully reduced.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.con
f
So, how could I retain logical vol lvol2 and data.
In production enviornment I will take care all steps followed.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2007 11:15 PM
03-25-2007 11:15 PM
Re: Reducing logical volume
swlist -l product|grep OnlineJFS
If you see nothing, then you do not have this product and fsadm -b will not work. In that case, reducing the lvol will likely destroy your data.
If you have reduced lvol2 already, you can try to mount it and see if it has been destroyed. DO NOT RUN fsck if it says the volume needs repair!!! Instead, resize the lvol back to it's original size:
/dev/vg01/lvol2 16384000 8823710 7325378 55% /arch
something like this:
lvextend -L 16000 /dev/vg01/lvol2
and now mount the volume. Hopefully, it should be OK now. You can safely assume that lvreduce will always destroy filesystems (and data in raw database volumes).
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2007 12:07 AM
03-26-2007 12:07 AM
Re: Reducing logical volume
Regards,
Mehul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2007 12:12 AM
03-26-2007 12:12 AM
Solution> No OnlineJFS is installed. So how could I proceed further in production enviornment to reduce the logical volume?
I answered that too, originally:
If you don't have OnlineJFS (I hope not) then you must backup any data that you want saved; 'lvreduce' the filesystem; 'newfs' a filesystem within the logical volume; and reload your data.
That said, *every* production server should have OnlineJFS licensed. NOt only does this allow you to perform filesystem resizing while the filesystem is in use, but it offers a series of mount options that can dramatically improve filesystem performance under select conditions.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2007 05:41 PM
03-27-2007 05:41 PM