How do I increse drive space in freepbx

Hi guys, I am using FreePBX 13.0.197 it has 1 1000gb drive which is almost full ( currently at 97%) I like to know is there a way to increase drive.

[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 916G 839G 31G 97% /
tmpfs 7.8G 0 7.8G 0% /dev/shm
/dev/sda1 283M 32M 237M 12% /boot
/dev/sda2 is at 97% and i want to know is this possible to add another drive for recording storage?
server is running on hp hp proliant g7.

Yes, you either A) Clean up the current drive so there is more space on it. B) Add a second drive to the machine or C) Replace the entire drive with a new driver that has more space and move the data over.

You canā€™t magically make a 1TB hard drive have more space than it was built to store.

so if I add another drive how do I make the system recognize and store recordings there?

Add a hard drive , format it, and mount it somewhere that astrridk can read/erite to, in advanced settings, you can point your recorded location to match.

I dont know much about linux so I dont know how do i mount it .

This might get messy, i suggest you do some googling about linux basics first

before posting here i did some google and found g parted can help but its not working out for me ā€¦ freepbx got any tutorial on this??

gparted will help you partition and format the drive , you normally mount drives in /etc/fstsb, (i told you this might grt messy :slight_smile: l

any links or tutorial can be really appreciated.

Try typing ā€œhow to format and mount a drive in linUxā€ in google, iā€™m sure it will find you lots of stuff

ok, will do an update here if any help needed ā€¦ thanks

ok so I just found 1 tutorial at https://medium.com/@sh.tsang/partitioning-formatting-and-mounting-a-hard-drive-in-linux-ubuntu-18-04-324b7634d1e0 I just want to know is it ok to try this ??? can it be revert if something went wrong ?? or will it even work for FreePBX??

Hereā€™s an idea. Why donā€™t you try and clean up the hard drive first? Remove old logs, unneeded files, old voicemails, etc. etc. etc. Have you looked to see what is actually taking up this space? You could be doing all this work just because you had a bunch of junk never cleared off your drive.

its on auto recording so i believe all space is going for recordings ā€¦ and for us recording are super Important so i cant delete thoseā€¦ but i would like to know how do i access server to delete files and older recording please ā€¦

That method should be just fine . Next, google ā€œbackup and delete old recordings asteriskā€ also mybe ā€œlinux backup importsnt filesā€

OK so i successfully mounted drive as /mnt/sdb but now how do i make server to send recording there ??? (i tested on testing server of freepbx not actual but i succeeded)
also will i be able to access recordings from old location ?

Youā€™ll need to add it to the fstab and then start moving the old files. To ensure all of the recordings get moved, you should reboot the server after the fstab change is made.

Now, I only know how to do this ā€œold schoolā€, so the steps required in your version of Linux may vary slightly, but log into the console and start here:

  1. Open the file /etc/fstab using an editor like vim (vi /etc/fstab should work).
  2. Add a new line for the new drive. It will probably look something like this:

/dev/sdb /var/spool/asterisk ext3 defaults 0 0

  1. Save the file.
  2. Use the command ā€˜fwconsole stopā€™ to stop Asterisk.
  3. Use the ā€˜mvā€™ command to rename /var/spool/asterisk to /var/spool/asterisk.old
  4. Use the ā€˜mkdirā€™ command to create a new /var/spool/asterisk
  5. Use the command ā€˜mount -aā€™ to mount the new drive as /var/spool/asterisk
  6. Use ā€˜cd /var/spool/asterisk.oldā€™ to go to the old asterisk log directory.
  7. Use ā€˜find . | cpio -pdmuv /var/spool/asteriskā€™ to copy all of the old files to the new directory.
  8. Use the command ā€˜fwconsole startā€™ to restart Asterisk.
  9. Once Asterisk starts back up again and youā€™re convinced everything is where it belongs, delete the old directory using 'rm -fr /var/spool/asterisk.oldā€™

That should get you where you want to get.

2 Likes

when the drive is formatted and mounted at /mnt/sdb

as root,

chown asterisk:asterisk -R /mnt/sdb
rsync -av --progress /var/spool/asterisk/monitor /mnt/sdb

change the location of recordings in advanced as previously stated to/mnt/sdb/monitor

add

/dev/sdb /mnt/sdb ext3 defaults 0 0

to /etc/fstab

reboot
.
.

mount

should show /dev/sdb mounted at /mnt/sdb (if the disk was identified correctly as /dev/sdb)
Everything should be tested and working to your satisfaction. Until the next step is completed, everything is reversible. When truly satisfied you can

rm -rf /var/spool/asterisk/monitor

to regain space on your original harddrive

thanks so will i be able to access older recordings and also i cant move recordings to new drive as both are 1 tb drives so if i transfer all recordings to new drive it would be on same condition as previous driveā€¦ what i am trying (if possible ) ti keep recordings in older folder and add new drive for new recordings but also be able to access old and new recordings from cdr reports . is this possible ??

but it will transfer all data to new drive which is same size as old and recording will fill up this one tooā€¦