Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.