PLEASE NOTE: This guide is for situations where a machine has run out of space due to call recordings. This should not be followed if this is for a new machine.
- Add the required amount of disk within vSphere. If the VM does not have a 2nd hard disk, make sure you add a 2nd one.
- Within the Linux terminal, assuming that the sdb disk hasn't been created, enter the following in this order:
- fdisk /dev/sdb
- n > p > select defaults
- t > 3 > 8e
-
w
- Continue with the following:
- pvcreate /dev/sdb1
- pvscan
- vgcreate VolGroup-CR /dev/sdb1
- vgdisplay
- lvcreate -L 20G -n lvol0 VolGroup--CR
- Lvdisplay
-
mkfs.ext4 /dev/mapper/VolGroup-CR-lvol0
- Now the important part. Because there are already call recordings being stored within /opt/pbxware/pw/var/spool/asterisk, we need to move this folder and any sub-folders to a temporary directory:
- mkdir /opt/pbxware/pw/var/spool/asterisk1
- mount /dev/VolGroup-CR-lvol0 /opt/pbxware/pw/var/spool/asterisk1
- df -h
- mv /opt/pbxware/pw/var/spool/asterisk/* /opt/pbxware/pw/var/spool/asterisk1
- umount /dev/VolGroup-CR-lvol0
-
df -h
- The disk is now mounted on the temporary folder and all files have been moved to this folder as well. The target directory (/opt/pbxware/pw/var/spool/asterisk) is now empty, meaning we can now unmount the disk from asterisk1, and re-mount it back onto asterisk.
- vim /etc/fstab
- paste this under “proc”:
- /dev/mapper/VolGroup--CR-lvol0 /opt/pbxware/pw/var/spool/asterisk ext4 defaults 2 1
-
It should look like this:
- wq
- mount -a
- df -h should now show the directory of /opt/pbxware/pw/var/spool/asterisk with a new parition assigned.
MAKE SURE THAT CRONJOBS ARE CREATED AS WELL IF REQUIRED.