Shrink ext4 filesystem and reduce the size of a Logical Volume in Linux
Hello guys,
I would like to ask you kindly if you don't know some quick and safe method how to shrink ext4 filesystem and reduce the size of a Logical Volume in Linux, please?
Thank you very much.
You need to be able to unmount the filesystem. If that is not possible, then you are a bit stuck, but it is still possible however it will mean downtime.
What OS are you using? Assuming it is RHEL or similar, the command would be based on lvreduce
You can use a selection of flags, the most important one is -r which deals with the filesystem residing on the logical volume. This will unmount it, coalesce the files to the early par of the filesystem and then reduce the size. It then reduces the size of the logical volume and remounts the filesystem.
Depending on how large, how full and how fragmented the filesystem is, it can take a while to run.
Other options that are very common would be -l or -L, lower and upper case L which set the size. The manual page will give you the details on how to use each.
So, your eventual command might become:-
Does this help?
Robin
Last edited by rbatte1; 02-14-2017 at 05:03 AM..
Reason: Added a welcome for the new member
Hello,
I would like to reduce the size of filesystem online. We can do online for increase without any problem. So any risk can be occurred with the decrease? This is not an issue, just a discussion for decrease/shrink space with chfs command.
My AIX system is version 6.1 and the filesystem... (2 Replies)
Hi all,
Do i need to increase the logical volume each time i increase the filesystem?
or is enough to increase the filesystem and the logical volume get increase automatically?
extendlv hd4 1
chfs -a size=2G /tmp
or just
chfs -a size=2G /tmp
Code tags! (4 Replies)
I am running HP-UX 11.31 ia64. The /usr filesystem shows 7 GB as the size, but the logical volume that is mounted there shows 13 GB. Is there a way to get the entire 13 GB to show up and why did this happen in the first place? (11 Replies)
My volume group of size 200 gb.
out of which only 100 gb is used by 2 logical volumes /dev/vg00/lvol0 and /dev/vg00/lvol0 respectively (both are 50 gb each).
Whenever i use vgreduce command to reduce the size of volume group i get below error.
# vgreduce vg00 -a
Physical volume... (16 Replies)
Hi!
Can anyone help me on how I can do a basic check on the Unix filesystems / physical volumes and logical volumes?
What items should I check, like where do I look at in smit? Or are there commands that I should execute?
I need to do this as I was informed by IBM that there seems to be... (1 Reply)
Hi,
I have the following problem.
I just have a new machine with mirroring. The logical volume for /opt is dimensionned to 75 GB which is to much. I want a volume of 10 GB. How can I reduce the size ?
I tried to reduce the size of the slice from 75 GB to 10 GB, but the size of the logical volume... (6 Replies)