• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 523
  • Last Modified:

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.,...
0
aanya247
Asked:
aanya247
  • 3
2 Solutions
 
MazdajaiCommented:
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
 
MazdajaiCommented:
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now