LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 03-27-2012, 06:37 AM   #1
rajaniyer123
Member
 
Registered: Feb 2004
Location: BARODA, GUJARAT
Posts: 259

Rep: Reputation: 30
Replacing 200 GB LUN with 100 GB LUN in LVM


Hi,

In one of my RHEL server I have one root volume group in which websphere application is running. [100GB in size]

In case of file system extension I have extended with 200 GB instead of 100 GB, by creating 100 GB logical volume on 200 GB.

Now in the same ref. because of the performance issue I have to remove 200 GB and replace the same by 100 GB.

Could any one provide detailed steps.

Also I have below concerns regarding the same.

• After above activity what will be chances of File System inconsistency ?
• What about functionality of Application and their associated Dynamic Link libraries after replacing the 200 GB Disk with 100 GB Disk.
• Is there any way from which I can ensure existing underlying extent allocation whether they are sequential not random, and in case of replacing the 200 GB disk with 100 GB no data will be left out.


Please suggest.

Thanks
Rajan
 
Old 03-27-2012, 07:12 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
That's a little confusing. You talk about "LUNs" but seem to be implying "disks". Let'g go over some basics:

disk = Physical hard drive
LUN = Logical Unit - This is a subdivision of a RAID set.
LVM = Logical Volume Manager
VG = Volume Group - This is LVM top level that contains at least one PV and can have one or more LVs.
PV = Physical Volume - This is a disk (or a partition or a meta disk) that you have added to a VG
LV = Logical volume - This is a subdvision of VG that you layout your filesystem on (or make swap or raw device on)
filesystem = The layout you did on the LV and mounted to a mount point directory.

The question you asked appears to be:
You have a 200GB LV that you want to reduce to a 100GB LV.
For this you'd generally want to:
-Verify the data contained in the filesystem is less than 100 GB with df command.
-Stop any applications using the filesystem.
-Umount the filesystem.
-Run e2fsck on the LV path of the filesystem.
-Run resize2fs on the LV path of the filesystem specifying new size you want for the filesystem.
-Run lvreduce on the LV path of the filesystem specifying new size you want for the LV.
-Remount the filesystem
-Restart the apps.


The question your other description makes me think you are asking is:
You have a VG with a 200 GB disk (PV) in it that you want to swap for a 100 GB disk (PV).
If possible the best way to do this would be to add the 100 GB disk while the 200 GB disk is still there and use pvcreate to add the 100 GB disk as a PV to the VG. You can then use pvmove to move the extents for the LV from the 200 GB PV to the 100 GB PV. After that you can use vgreduce to remove the 200 GB disk from the VG if you want.

For all the commands listed there are man (manual) pages so you can get more details by typing "man" followed by the command name e.g.
man e2fsck
man vgreduce
man umount
 
Old 03-27-2012, 07:28 AM   #3
rajaniyer123
Member
 
Registered: Feb 2004
Location: BARODA, GUJARAT
Posts: 259

Original Poster
Rep: Reputation: 30
Hi

Thanks for the update

In my case I have to perform below steps as per your comments.

You have a VG with a 200 GB disk (PV) in it that you want to swap for a 100 GB disk (PV).
If possible the best way to do this would be to add the 100 GB disk while the 200 GB disk is still there and use pvcreate to add the 100 GB disk as a PV to the VG. You can then use pvmove to move the extents for the LV from the 200 GB PV to the 100 GB PV. After that you can use vgreduce to remove the 200 GB disk from the VG if you want.


Please let me know are there any chances of issues after using the vgreduce command in terms of data loss/file system in consistency etc..

Also is there any known issues after replacing the 200 GB disk with 100 GB.

Please suggest
 
Old 03-27-2012, 07:46 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
There is always a chance of data loss due to physical hard drive failures, cosmic rays or the whims of fate. You should be backing up your system on a regular basis. Prior to doing disk maintenance of any sort doing a backup is a good idea.

Any time you are "reducing" there is a higher chance of data loss than if you are "extending". However, doing this kind of activity is one of the main reasons LVM was created. It is simple to add a disk to an existing VG. It is relatively simple to do a pvmove to move extents off one PV to another. Once the extents have been moved you should be able to safely remove the original disk. Prior to doing that you can run "pvdisplay -v" on the original disk to verify there are no extents in use on it any longer.

However, no one is going to guarantee you won't have data loss because YOU are the one doing this not us. It is however reasonable to assume you won't because these are standard operations.
 
Old 03-27-2012, 12:32 PM   #5
rajaniyer123
Member
 
Registered: Feb 2004
Location: BARODA, GUJARAT
Posts: 259

Original Poster
Rep: Reputation: 30
Thanks for the help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LUN has been grown. How to see available space in LVM? z33tec Linux - General 1 11-19-2011 01:01 AM
[SOLVED] Effect (slow down?) using LVM on LUN karateckie Linux - Server 4 05-14-2010 08:02 AM
Use LVM for SAN LUN's or not? zQUEz Linux - Server 4 11-24-2009 08:57 AM
Forcing LVM to see a bigger LUN bboy-mass Red Hat 1 10-20-2007 07:29 PM
LUN Device Mapping: 2 devices map to same lun DantePasquale Linux - Distributions 0 09-24-2007 02:59 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 03:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration