Is it possible to decrease the vg_home and increase vg_root? I am running RHEL. I need to know the steps.
[root@web /]# uname -a
Linux web 2.6.32-131.4.1.el6.x86_64 #1 SMP Fri Jun 10 10:54:26 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
[root@web /]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.2 (Santiago)
[root@web /]# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_web-lv_root
50G 7.8G 40G 17% /
tmpfs 7.8G 384K 7.8G 1% /dev/shm
/dev/sda2 485M 79M 381M 18% /boot
/dev/sda1 200M 256K 200M 1% /boot/efi
/dev/mapper/vg_web-lv_home
755G 6.2G 711G 1% /home
[root@web /]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sun Jul 10 14:37:44 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_web-lv_root / ext4 defaults 1 1
UUID=bc2a5e3c-d55a-4980-887a-695cb0e0dbe7 /boot ext4 defaults 1 2
UUID=C024-19D6 /boot/efi vfat umask=0077,shortname=winnt 0 0
/dev/mapper/vg_web-lv_home /home ext4 defaults 1 2
/dev/mapper/vg_web-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
You mean
lv_home
andlv_root
, presumably, given thatvg_home
doesn't exist... This is why I loathe the RHEL installer; it does such idiotic things with both naming and space allocation.What you'll need to do is:
/home
, and that nothing will try and access any files in/home
during the resizing operation. This is best achieved by dropping into single user mode (telinit 1
, unless RHEL's gone and switched to upstart or something in recent versions), but if you at least turn off the HTTP and SMTP services you're on a good start./home
(umount /home
)fsck /dev/vg_web/lv_home
)lv_home
to something sensible (resize2fs /dev/vg_web/lv_home 45G
)lvresize -L50G vg_web/lv_home
)fsck /dev/vg_web/lv_home
)mount /home
)resize2fs /dev/vg_web/lv_home
)And next time, don't trust what anaconda wants to do, and create the LVs yourself to the sizes that are appropriate for your system.