cpanel cannot upgrade due to insufficient disk space

From WebHostingNeeds.com
Jump to: navigation, search

On a cpanel server, i get following error

fatal: Cannot upgrade due to insufficient disk space.
Detected 1.67GB. You will need at least 3GB to install/update to a new version of cPanel.

On most servers, i just clean log, on this server, log folders already symlinked to /home, so there is not much we can do.

This is fixed by moving cpanel folder to /home/cpanel


mkdir /home/cpanel/
rsync -vrplogDtH /usr/local/cpanel/ /home/cpanel/
service cpanel stop
rsync -vrplogDtH /usr/local/cpanel/ /home/cpanel/
mv /usr/local/cpanel /usr/local/cpanel.hon
mkdir /usr/local/cpanel
mount --bind /home/cpanel/ /usr/local/cpanel/
service cpanel start


To mount /home/cpanel as /usr/local/cpanel on boot, you need to edit /etc/fstab file.

vi /etc/fstab

Add

/home/cpanel    /usr/local/cpanel   none     defaults,bind    0 0


Example

[email protected] [~]# mount 
/dev/sda2 on / type ext4 (rw,usrjquota=quota.user,jqfmt=vfsv0)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext2 (rw)
/dev/sda8 on /home type ext4 (rw,usrjquota=quota.user,jqfmt=vfsv0)
/dev/sda7 on /tmp type ext4 (rw,noexec,nosuid)
/dev/sda3 on /usr type ext4 (rw,usrjquota=quota.user,jqfmt=vfsv0)
/dev/sda5 on /var type ext4 (rw,usrjquota=quota.user,jqfmt=vfsv0)
/dev/sdb1 on /backup type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/tmp on /var/tmp type none (rw,noexec,nosuid,bind)
/home/cpanel on /usr/local/cpanel type none (rw,bind)
[email protected] [~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Tue Jan  1 13:29:42 2013
#
# 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
#
UUID=499f6e91-40c8-420b-9632-4a28bf5006d5	/	ext4	usrjquota=quota.user,jqfmt=vfsv0	1	1
UUID=66f482fd-5366-4236-b60c-0087bf091ad6 /boot                   ext2    defaults        1 2
UUID=113d3a94-c604-4e0a-9a7e-344f36ed0ea8	/home	ext4	usrjquota=quota.user,jqfmt=vfsv0	1	2
UUID=33702cd6-4e2d-4679-ab05-dfc7c816c27c /tmp                    ext4    defaults        1 2
UUID=74da2f6a-ac48-4c30-a742-531db4e90cef	/usr	ext4	usrjquota=quota.user,jqfmt=vfsv0	1	2
UUID=6944546f-ef45-4706-b06f-9651e0d44e51	/var	ext4	usrjquota=quota.user,jqfmt=vfsv0	1	2
UUID=c657b1fa-a740-47c3-b0e0-38d03431c1fc swap                    swap    pri=0,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
/tmp             /var/tmp                    ext3    defaults,bind,noauto        0 0
/dev/sdb1               /backup                 ext3    defaults        1 2
/home/cpanel        /usr/local/cpanel       none    defaults,bind   0 0
[email protected] [~]# 

cpanel