Solved

lvreduce in RHEL

Posted on 2014-03-28
5
465 Views
Last Modified: 2014-03-28
Recently  I have extended /tmp filesystem from 2GB to 10GB, While the system is up and running can I still run "lvreduce" to reduce it from 10GB to 2GB, When I run the command while the filessystem is mounted it is saying "THIS MAY DESTROY YOUR DATA". Is it mandatory that I need to unmounts the filesystem.

This is a production server and I will not be able to get an outage until next week, So is there a way to reduce the size without any outages.,...
0
Comment
Question by:aanya247
  • 3
5 Comments
 
LVL 21

Accepted Solution

by:
Mazdajai earned 500 total points
Comment Utility
Not possible, you need to umount the file system to reduce a volume.
0
 
LVL 2

Expert Comment

by:smksa
Comment Utility
Yes, it's not possible first need to unmount then it will be done.
0
 

Author Comment

by:aanya247
Comment Utility
So what is the best way to reduce, If I have an outage, DOes booting into rescue mode or single user mode help me can someone guide me with the steps.
0
 
LVL 21

Assisted Solution

by:Mazdajai
Mazdajai earned 500 total points
Comment Utility
you only need to be in rescue mode when dealing with root mount points. A proper way to would be -
1. back up the data
2. unmount the mount point
3. lvreduce with the reduce file system option or run resize2fs then lvreduve
4. remount
0
 
LVL 21

Expert Comment

by:Mazdajai
Comment Utility
I recommend using the resizefs option with lvreduce (or lvextend)

lvreduce -vr <lvm path>

Open in new window


Good luck and make sure you have back up!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now