View Single Post
  #1  
Old 24th June 2013, 22:22
craig baker craig baker is offline
Senior Member
 
Join Date: Mar 2008
Posts: 147
Thanks: 0
Thanked 6 Times in 6 Posts
Default ISPCONFIG 3 & Centos 6.4 - ALMOST right but...

I screwed up - I had installed centos 6.4 with a big home directory (and a small var one) and I forgot to wipe and resize it so I have everything WORKING now - but my /var is almost full

how can I have ISPCONFIG 3 to use /home instead of /var? safely without having to redo hours and hours and hours of work???
or maybe symlink it so that everything works without messing up the work?

*** BETTER PLAN - is there a safe and easy to resize the /home partition smaller (its 1.8TB) and the / partition bigger?
these are setup as being managed by lvm and are ext 4 from the centos 6.4 install I just did.
currently:
[root@ns9 /]# df -v
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_ns9-lv_root
51606140 44038720 4945980 90% /
tmpfs 16471600 236 16471364 1% /dev/shm
/dev/sda1 495844 62110 408134 14% /boot
/dev/sr0 1418348 1418348 0 100% /media/CentOS_6.4_Final
/dev/mapper/vg_ns9-lv_home
1852386680 191026800 1567264112 11% /home

help would be appreciated - can I shrink vg_ns9-lv_home and increase the root partition?

I DONT want to lose everything and symlinks are a kludge at best - I know I should have made home small and / large, but can I salvage the situation?




thanks

ps love howtoforge I have been a subscriber before


UPDATED - problem solved.

use resize2fs and lvexpand as per the following:

# Unmount the filesystem and check its' LV
umount /home
e2fsck -f /dev/mapper/vg_ns9-lv_home

# Shrink ext4 and then the LV to the desired size
resize2fs -p /dev/mapper/vg_ns9-lv_home 500G (reduce to 500gb)
lvreduce -L 500G /dev/mapper/vg_ns9-lv_home

# Before continuing, run e2fsck. If it bails because the partition
# is too small, don't panic! The LV can still be extended with
# lvextend until e2fsck succeeds, e.g.:
# lvextend -L +1G /dev/mapper/vg0-foo
e2fsck -f /dev/mapper/vg_ns9-lv_home <- checked ok

# Resize the filesystem to match the LVs size, check and mount it
resize2fs -p /dev/mapper/vg_ns9-lv_home
e2fsck -f /dev/mappervg_ns9-lv_home
mount /home

That was the tricky part. The rest is pretty straight forward:

unmount the filesystem,
extend the logical volume and
expand the filesystem afterwards.

umount /
<--- dont need to unmount root 6.4 can do it on the fly

# Extend the LV to use all free space
lvextend -l +100%FREE /dev/mapper/vg_ns9-lv_root
e2fsck -f /dev/mapper/vg0-bar <- cant do mounted

# Resize the partition to fill the LV
resize2fs -p /dev/mapper/vg_ns9-lv_root
e2fsck -f /dev/mapper/vg0-bar <- cant do mounted

sync;reboot! all is joyous and /var now has TONS of room (1.3TB)

Last edited by craig baker; 25th June 2013 at 04:20.
Reply With Quote
Sponsored Links