lvreduce in RHEL

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.,...
aanya247Asked:
Who is Participating?
 
MazdajaiConnect With a Mentor Commented:
Not possible, you need to umount the file system to reduce a volume.
0
 
smksaCommented:
Yes, it's not possible first need to unmount then it will be done.
0
 
aanya247Author Commented:
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
 
MazdajaiConnect With a Mentor Commented:
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
 
MazdajaiCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.