LVM is great, but it works best when you have a lot of free space, and you can create small logical volumes that can grow as needed.
Your suggested layout would probably be fine, but I would make a separate /boot partition as well. (You could also make your swap partition smaller. You never want to be more than a couple of GB into swap since performance suffers badly past that. Plus you can always add a swap file if you absolutely have to.)
So, based on @wurtel's answer and the research I've done, here's the script and the steps I came up with.
1) Unmount the "home" partition
umount /dev/mapper/APP05-home
2) Resize the "home" filesystem to a size of 2G
resize2fs -p /dev/mapper/APP05-home 2G
3) Reduce the size of the "home" logical volume to 2,1G (the volume needs to be a little bit bigger due to filesystem overhead)
lvresize --size 2,1G /dev/mapper/APP05-home
4) Resize the filesystem to match the logical volume's size
resize2fs -p /dev/mapper/APP05-home
5) Mount back the "home" partition
mount /dev/mapper/APP05-home /home
6) Increase the size of the "root" logical volume to 17.2G
lvresize --size 17.2G /dev/mapper/APP05-root
7) Increase the "root" filesystem to a size of 17.2G
resize2fs -p /dev/mapper/APP05-root 17.2G
UPDATE : I actually replaced points 6) and 7) with the followings in order to not have to specify the "root" size exactly, but to extend to all the free space
lvextend -l +100%FREE /dev/mapper/APP05-root
resize2fs -p /dev/mapper/APP05-root
This solution is inspired also from the questions: Repartitioning harddisk and http://pubmem.wordpress.com/2010/09/16/how-to-resize-lvm-logical-volumes-with-ext4-as-filesystem/
UPDATE: This solution worked and the result is the following
root@APP05:~# df -h
Sys. fich. Taille Util. Dispo Uti% Monté sur
rootfs 17G 1,4G 15G 9% /
udev 10M 0 10M 0% /dev
tmpfs 201M 168K 201M 1% /run
/dev/mapper/APP05-root 17G 1,4G 15G 9% /
tmpfs 5,0M 0 5,0M 0% /run/lock
tmpfs 402M 0 402M 0% /run/shm
/dev/sda1 228M 18M 199M 9% /boot
/dev/mapper/APP05-home 2,1G 149M 1,9G 8% /home
Thanks again for all the answers, especially to @wurtel!
Best Answer
Assuming your volume group is already full, and you cannot extend it further, you will need to:
lv_home
using the specific tools for your filesystem, e.g.resize2fs
if you use ext3/4.lv_home
accordingly withlvreduce
.lv_root
withlvresize
.lv_root
so that it uses all the additional space in the LV.As always, back up your data first, resizing filesystems is always a risky business.
If you happen to use XFS in
lv_home
you'll need to use a different approach, because XFS does not support shrinking. In this case:lv_home
lv_home
withlvreduce
(FS is destroyed at this point!)lv_home
with smaller sizelv_root
as per steps 3 & 4 above.