1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Check out the 6 new Certified Incredible PBX Builds for Asterisk 11 and 13 featuring CentOS 6, Ubuntu 14, Raspberry Pi 2, and Asterisk-NOW.
    Dismiss Notice

PIAF Running on Compact Flash

Discussion in 'Wish List' started by yesmat, Feb 22, 2009.

  1. yesmat

    yesmat New Member

    Hi Guys,

    is it possible to build a Compact Flash image that has a cutdown version of CentOS and full version of PBXinaflash that we could use on a net5501 boards from http://www.soekris.com ?

    Few companies now, in our neck of the woods, started offering Asterisk based "Appliances" runnig on these boards. They are fanless almost completely silent and they are running Astlinux www.astlinux.org. Thy load the Astlinux image on a ReadOnly CF and then load another device in RW mode, that can be HDD, another CF, USB flash etc....

    I prefer using PIAF on these boards than Astlinux.

    anybody thought of that?

  2. wardmundy

    wardmundy Nerd Uno

    Tom King is the real expert on this, but he's headed out of town. So I don't know if he'll see this before he leaves this week or not.

    My discussion of this with Tom suggests there are several issues. First, CF devices don't have the performance of a hard disk or solid-state drive (SSD). They probably couldn't support all the processing necessary to handle VoIP calls. Second, both Linux and Asterisk generate loads of rewrite cycles. These would quickly wear out a CF device unless there were a supplemental drive to handle the disk IO-intensive activity. The third problem, of course, is segmenting off all of the IO-intensive stuff to another device. It could be done, but it would be a good bit of work requiring good Linux skills.

    Another approach would be to take a look at SSDs, many of which are now functionally equivalent to SATA drives.
  3. jeffmac

    jeffmac Guru

    I "presume" that you are being specific to the (relatively inexpensive) flash memory devices (thumbdrive, etc) rather than Compact Flash as a physical format? I personally am running my current PIAF system on a Compact Flash "microdrive". Its actually a tiny hard disk, so it doesn't suffer the same re-write limitations of flash memory. Its the size of a Type II compact flash card. Mine is a 4GB Hitachi. I'm running PIAF 1.3 on a VIA C7 board. The "/" partition of the hard drive runs around 63% util. I've seen no perfomance issues - but mind you I'm just running my home with 2 active extensions! (I had to turn IDE DMA access OFF, but that was a limitation of my CF to IDE adapter card.)
  4. matka

    matka New Member

    Astlinux is a great distro

    I run Astlinux for my home server for a couple of years and it is a great distro. A large amount of work went into fitting Linux and asterisk into 48 MB (if I remember correctly) device. Astlinux is based on Busy Box and to trim CentOS to this size you would probably end up with BusyBox lookalike again. I had excellent voice quality (native ulaw prompts). You had to code your own dialplan, there was no support for FreePbx.

    If you would like to use Sokeris, you also have to keep in mind the processor capabilities. I run Astlinux on a 200MHz tiny box (ebox 2300) and could support upto 5 concurrent lines. There was no mysql, a very tiny http server (not Apache) and all prompts were already in ulaw.

    On the other hand, for the developement I used a CF (4GB) PIAF installation on another tiny box ( ebox 4310, 500MHz) and it worked great, mysql, http, fax recognition etc. From the cpu usage this little box would support 10 concurrent ulaw, probably much more.

    As far as CF wear and tear is concerned, there are some steps that you can take to reduce it. Use noatime to reduce writes, also I did not have swap allocated. There are wiki's out there to provide more help on the topic.

    The degradation of CF semed to be a serious problem with earlier versions of CF and cheap producers. SANDISK has a good reputation in this regard.

    My Astlinux installation on CF with 2 partitions (1 read only and 2nd read/write) run without any errors for 2 years. I have a friend who runs PIAF on CF in his laptop for at least 6 months without CF issues. Both of us had an image copy of live system (very easy to do, you just clone CF into a gz file) and a spare CF in case of trouble.

  5. Cliffster

    Cliffster New Member

    Yes it can be done. The company that I work for put this together. Actually the company that we purchase our thin clients from put it together. We had a potential sale that fell apart with the economy. I support the one installation, our metal shop.
  6. i got a few one touch systems that run on CF and would love to use 1 or a few of them with PIAF. they also have like 3 NIC cards as well as a Modem and a LCD display on the front.

    they are decent systems and could be put to use instead of just sitting in "the man cave"!!!!
  7. vespaman

    vespaman Guru

    could you enlighten us as to the "one touch Systems that run on CF"
  8. I will grab one out of the garage tomorrow. but it is just a system that was used as a site controller in the Social security offices here in the states and was recently replaced. they let us keep them for whatever reason as they are slightly older machines. nothing to old though and I was just thinking that this would be a great system to get going on.
  9. wardmundy

    wardmundy Nerd Uno

    PIAF is never going to work on CompactFlash drives because of the read/write limitations. But what we've all been waiting for at the right price point is almost here...

  10. phinphan

    phinphan Member

  11. Cliffster

    Cliffster New Member

    I don't know what the right price is, but my company, Ringdale, has this product:


    It has 1 GB RAM Memory, and 4 GB Compact Flash.

    It supports up to 4 PSTN phone lines. I only have two connected now. And I only have four (Grandstream) IP phones.

    Here is the manual. I would be happy to hear comments on it:
    I will send the doc version to anyone who critiques it for me.
  12. wardmundy

    wardmundy Nerd Uno

    Couldn't find the price. :wink5:
  13. darmock

    darmock PIAF Developer

    hmm well I abandoned the Cf as a viable medium. Here is the testing I did

    1. Wrote a script that di a read write verify to a high end 4GB card and let it run for a few months on an amd geode embedded system.

    2. At the end of the test cycle the CF had about a 20% failure of the memory cells. I believe the r/w cycles were equivalent to a years worth of testing. I also ran a small heatsink/fan combo on the CF card to help minimize and extra heat.

    3. Decided to do a long term test using real world. I installed a 8gb high end cf card in a dual core atom running 1024 ram and a tdm400 card. I used a sata to CF adapter for the interface.

    4. I deployed this to a small business that I have part ownership of and let er rip over 1 year. The result was I had 2 catastrophic failures of the CF requiring replacement. This system averaged about 75 calls a day to 3 extensions. I was running a modified version of PIAF that supressed logging to the CF and redirected it to a smb share. This helped to minimized write cycles to the CF.

    5. At the end of the long term test I replaced the cf with an 80gb 2.5" laptop drive and put the system back in service. BTW I did not tell the staff that this had happened. Over the next few weeks the staff asked me what I had done to the PBX as calls and setup were faster and voicemail access was much improved..... Hmmmm

    6. I put out a new pbx running a 30gb sshd sata based. Same atom platform and similar call volume and extensions just different company. The results The system has been running for 10 months and no failures or problems.

    Based on my personal experiences (your mileage may vary) I won't deploy CF's for production systems at all. I will however deploy SSHD based systems and have installed a few more for some of my clients.

    I realize that is an extremely small sample size but it was enough to convince me.

  14. Cliffster

    Cliffster New Member

    I don't know how much they were going to sell this for, but Ringdale put this together as part of a bid for several hundred units and access control systems to a company in Dubai, before the bust. After having our thin client manufacturer put the pieces together, and marketing screwing with it for a few months, I was tasked with getting it going and writing the manual. Then after months of phone lines that never worked, I installed it for the three guys in the Metal Shop. They don't complain but that does not say a lot. The connection to the Metal Shop is over a Wireless LAN by the way. I will check on the price, but remember I am the support guy, not the sales guy.
  15. Cliffster

    Cliffster New Member

    As an update to this thread. Two of the systems that I am using suffered a hardware failure. Probably due to overheating. It was running hot and eventually we put an external fan on it. This helped, but eventually it died. The company did however replace the two units that had this problem. I still don't know how much we sell our version of this, but this is where it came from: http://www.teco-ia.com.tw/ugC_ShowroomItem_Detail.asp?hidShowID=47

    The CPU cooling fins had been cut back to make room for the Digium card.

    We install FreePBX on the Linux version.

    But the compact flash seems to be okay and just popping it into the replacement box worked. Little do I know.
  16. jmullinix

    jmullinix Guru

    I don't know if it helps any, but most of Sangoma's cards are half-height.
  17. kevinfvc

    kevinfvc Member


    A quick look at newegg shows a wide variety of SSD in terms of size, format, and speeds. Does anyone have general recommendations of specs for PBX in a Flash?

    I realize format (or connector) will be dependent on MB (I'm assuming SATA will be the most likely used) and it seems like even the smallest cards will be fine for most PBX installs. I'm not sure if the read and write speeds are important. Even the slowest seems much faster than compact flash.

    I appreciate any comments.

    - Kevin
  18. dstroot

    dstroot Guru

    Solid State Drive SSD Write Minimization

    I built mine to run off Compact Flash:
    (These are my ideas - they are not exact steps to follow!)
    1. Stop writing to the disk for every read: Edit your fstab to mount the partitions with "noatime" (add noatime to /etc/fstab). You can also change the journal flush interval time by using the mount option "commit=xx", for example, to change it from the default 5 seconds to 60 seconds. In CentOS the initrd mounts your root filesystem, not the kernel. So, the steps to enable ext3's writeback on CentOS mode are:
    a. Add "noatime,data=writeback,commit=90" to /etc/fstab;
    b. Run mkinitrd; and
    c. update grub.conf to point to the new initrd image if you changed the name.
    nano -w /etc/fstab
    fstab should look like this:
    LABEL=/ / ext3 defaults,noatime,data=writeback,commit=90 1 1
    LABEL=/boot /boot ext3 defaults,noatime,data=writeback,commit=90 1 2
    tmpfs /dev/shm tmpfs defaults 0 0
    tmpfs /var/log 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
    LABEL=SWAP-sda3 swap swap defaults 0 0

    Then run mkinitrd. If you do keep the same name you can skip the grub step below because we recreate the same .img file:
    # mv /boot/initrd-2.6.18-53.1.4.el5.img /boot/initrd-2.6.18-53.1.4.el5.img.old
    # mkinitrd initrd-2.6.18-53.1.4.el5.img 2.6.18-53.1.4.el5

    If you changed the initrd file name then change grub.conf
    nano -w /etc/grub.conf
    Change the initrd img file to match like this:
    # grub.conf generated by anaconda
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE: You have a /boot partition. This means that
    # all kernel and initrd paths are relative to /boot/, eg.
    # root (hd0,0)
    # kernel /vmlinuz-version ro root=/dev/sda2
    # initrd /initrd-version.img
    title trixbox (2.6.18-53.1.4.el5)
    root (hd0,0)
    kernel /vmlinuz-2.6.18-53.1.4.el5 ro root=LABEL=/
    initrd /initrd-“what you named it”.img

    2. Run dmesg to see if it worked. You should see:

    EXT3 FS on sda2, internal journal
    kjournald starting. Commit interval 90 seconds
    EXT3 FS on sda1, internal journal
    EXT3-fs: mounted filesystem with writeback data mode.

    3. Don't use a swap partition. I have 2gb of RAM which should be enough # swapoff –a

    4. Don’t use a journaling file system on the SSD partitions. Ext2 would be recommended in this situation. I blew this off because I felt I could optimize Ext3 well enough.

    5. Try a USB drive. Create 2 partitions on it. Format one as swap and one as ext2 add the appropriate lines to fstab. Such as:
    /dev/sda1 swap defaults 0 0
    /dev/sda2 /var/log ext2 defaults 0 0
    If it wears out just get another!

    6. Don’t log to the SSD. Mounting /var/log/ as a tmpfs will reduce the amount of writes used by logging, however it is highly advised that you modify the shutdown scripts to copy the logs to a safe before turning off, so you don't lose them permanently (they are useful!). There is no generic way to do this as different systems use different init daemons... but it would be best to start looking at /etc/inittab and see what script is called for shutdown. That gives you an idea of where to put the extra commands.

    mkdir /backup_logs
    7. Create the startup/shutdown script for backing up the logs (create a new file using
    nano /etc/init.d/logbak
    # chkconfig: 2345 9 92
    # description: Backup the log files and restore them



    case "$1" in
    echo "Called with $1"
    echo "Copying log files to /backup_logs"
    cp -Rpfu /var/log/* /backup_logs/
    [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
    echo "Called with $1"
    echo "Copying log files to /var/log"
    cp -Rpfu /backup_logs/* /var/log/
    [ $RETVAL -eq 0 ] && touch $LOCKFILE
    echo 'Usage: /etc/init.d/logbak {start||stop}'
    exit 1

    exit $RETVAL

    Change the permissions and run it:
    chmod 775 /etc/init.d/logbak
    /etc/init.d/logbak stop
    Now install it with:
    cd /etc/init.d
    chkconfig -–add logbak
  19. luckman212

    luckman212 Guru

    Old thread, I know.
    But curious, with all the advancements in SSDs since the last post (new controllers, higher capacities, better reliability, lower prices) I wonder if anyone has done any installs of PiaF using a more recent (e.g. SandForce) controller? It certainly would be an expensive experiment to purchase a handful of SSDs and test each. But if you've used one and care to share your experience with it I'd be all ears. I am looking to replace the 2.5" HD in my current PiaF with an SSD, the goal being a no-moving-parts system which just gives me a warm fuzzy feeling.
  20. markgruber

    markgruber New Member

    I have been using CompactFlash devices (using various Sata and IDE adapters) on both Linux and Windows systems for a while now with mixed results (e.g file servers using CF as boot drive, small embedded Windows units in vehicles).

    But recently I tried an 8GB 300x unit for the drive in a PIAF dual core atom system (similar to Tom's setup as described above). Wanted to see if I could create a completely fanless unit at a low price point - hence the CF and not an SSD. This system has 7 extensions and that office make about 80 calls per day.

    I initially put the full blown PIAF on a 4GB unit but that was tight (like 90% used) so I moved it to an 8GB module. I am using a CF to SATA adapter. Both the adapter and module support UDMA.

    The install went fine and I had the unit up and going in the office for about a month (hence I cannot comment on the long term viability). I did not do any of the customizations that are described above to minimize writing to the CF.

    All ran great except for one issue that forced me to replace it with an inexpensive 40 GB SATA hard dive. Longer recorded messages would skip or drop segments. This was very apparent in our initial IVR message where they had set it up to welcome the caller and provide the hours, extension numbers, etc. After about 20 seconds into that message (not always in the same spot) the playback would go silent for a second or two then continue on, skipping that portion of the message. If you repeated the message the next time it would skip in a different location. And this happened on an otherwise idle system - not one that was busy processing any calls.

    I would love to hear if anyone has had success with the CF cards as I think the hard drives (and fans) are the Achilles heel of these small Asterisk systems. Most small systems (like the Nortels) do not have moving parts - although I did replace a hard drive on a Panasonic system once that was used just for voicemail.

    The hard drives will fail at some point and I am sure it will be at the most inopportune time for the users. Has anyone had any luck in setting up PIAF systems using the RAID options? Given the low price on these small hard drives (i paid about $28 for the last Sata 40 GB hard drive) I guess RAID would be cost effective but still will need service eventually. Does the CentOS RAID subsystem provide adequate notification and recovery options?

    Update: just saw this 8GB SSD on Newegg.


    Only $40, and although there seem to be issues with this particular device using AHCI/NCQ, for small systems this is not needed (IDE mode) and might work - see comment from reviewer who is using them for PBX. This might take care of my issue with playback as the transfer speeds are better than the CF card but still not sure of the longevity issue that Tom experienced.

Share This Page