Help - Search - Members - Calendar
Full Version: Shrink linux partition
Linuxhelp > Support > Technical Support
Emir
Hello to all,
I have problem with shrinking Linux partition.
My hdd is 400Gb and it is only 51% full, so I want to shrink it under 300GB. I have tried to use Gprted but there is not option to shrink it, because it see it as full. I have tried to use resize2fs, but I was unable to unmount partition.

This is what I got with df:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
442747752 213475988 206804396 51% /
tmpfs 16438680 0 16438680 0% /dev/shm
/dev/sda1 487652 106862 355190 24% /boot
michaelk
Your using LVM which is different from a regular partition so regular tools will not work. You might want to google to find out how it works. First question is what do you want to do with the free space?

It helps to know the distribution/version but we need to know the filesystem type of your root logical volume. Look at the output of the lsblk or mount command but it probably is either xfs or ext4. If it is xfs then there isn't a good or easy way to reduce the size.

Many installers create by default a boot partition and a LVM partition that contains the / filesystem and swap. The LVM partition is just a container for the volume group/logical volumes. Assuming your root LV is ext4 you need to boot a live CD/USB.

Basic steps:
1. resize root LV
2. resize volume group
3. resize LVM partition.
DeeWelch
QUOTE (michaelk @ Mar 27 2017, 11:20 AM) *
Your using LVM which is different from a regular partition so regular tools will not work. You might want to google to find out how it works. First question is what do you want to do with the free space?

It helps to know the distribution/version but we need to know the filesystem type of your root logical volume. Look at the output of the lsblk or mount command but it probably is either xfs or ext4. If it is xfs then there isn't a good or easy way to reduce the size.

Many installers create by default a boot partition and a LVM partition that contains the / filesystem and swap. The LVM partition is just a container for the volume group/logical volumes. Assuming your root LV is ext4 you need to boot a live CD/USB.

Basic steps:
1. resize root LV
2. resize volume group
3. resize LVM partition.


So that's how is it. Thanks buddy!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.