?
Solved

lvreduce in RHEL

Posted on 2014-03-28
5
Medium Priority
?
499 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 21

Accepted Solution

by:
Mazdajai earned 2000 total points
ID: 39961741
Not possible, you need to umount the file system to reduce a volume.
0
 
LVL 2

Expert Comment

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

Author Comment

by:aanya247
ID: 39962039
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 2000 total points
ID: 39962054
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
ID: 39962669
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

A new era in Cloud training has arrived.

A day that will go down in Cloud history.. But are you ready for it? Will you accept this Cloud challenge?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

777 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