LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Easy way to re-size Centos 6 LVM partition layout (http://www.linuxquestions.org/questions/linux-general-1/easy-way-to-re-size-centos-6-lvm-partition-layout-4175456764/)

spankbot 04-03-2013 07:03 PM

Easy way to re-size Centos 6 LVM partition layout
 
I have inherited Centos 6.3 box that has a default LVM layout like so..

/ = 35GB
/home = 800GB
/swap = 5GB

I need to shrink "/home" and grow "/" (more space is needed in /var/www)

I have backups and was just going to take the machine down, repartition, and restore data, but I was wondering if anyone was aware of a nice boot cd, or some other tool, that understands LVM and would make the process a little easier?

Can I simply use system-config-lvm?

chrism01 04-03-2013 11:44 PM

You can use the GUI, but the cli process is basically
Code:

# reducing eg /data to 128MB
df /data
umount /data
e2fsck -f /dev/vg0/data
resize2fs /dev/vg0/data 128M
lvreduce -L 128M /dev/vg0/data
mount /dev/vg0/data /data
df /data

# extend target lv
lvextend -L +128M /dev/vg0/data
resize2fs -p /dev/vg0/data

http://www.linuxtopia.org/online_boo...ion/index.html
http://linux.die.net/man/8/lvm

PS ALWAYS get a good backup (x 2) before messing with LVMs or partitions.


All times are GMT -5. The time now is 09:08 AM.