How do I increse drive space in freepbx


(Arsalan) #1

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.


(Tom Ray) #2

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.


(Arsalan) #3

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


#4

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.


(Arsalan) #5

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


#6

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


(Arsalan) #7

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??


#8

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


(Arsalan) #9

any links or tutorial can be really appreciated.


#10

Try typing “how to format and mount a drive in linUx” in google, i’m sure it will find you lots of stuff


(Arsalan) #11

ok, will do an update here if any help needed … thanks


(Arsalan) #12

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??


(Tom Ray) #13

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.


(Arsalan) #14

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 …


#15

That method should be just fine . Next, google “backup and delete old recordings asterisk” also mybe “linux backup importsnt files”


(Arsalan) #16

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 ?


(Dave Burgess) #17

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.


#18

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


(Arsalan) #19

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 ??


(Arsalan) #20

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