Below is my experience with this issue. Should I use a system patch instead of editing the _rw/_ro functions in /etc/inc/config.lib.inc by hand? Is there a config toggle or better way? Should I leave /cf mounted sync, as that's where the conf/rrd/leases live? With the system on a UPS and the NanoBSD "backup partition" to fall back on, I'll take the usable performance.
I have an embedded system (it's rebranded, not sure of exact model#) with a 2GB consumer CF card that ran 2.1.3 fine. Pulled the system out of storage recently and decided to do a clean 2.2.2 install; I booted an Ubuntu livecd and downloaded then wrote the x86 2GB embedded VGA pfSense 2.2.2 image to CF at ~7MB/sec.
After getting it running, I tried to install some packages but it was taking ages. With iostat/dd/fetch, traced it down to the slow CF card, writing at 17-20KB/sec. Followed some booting tips to disable DMA, write caching and ACPI with no write-speed improvement. Had a poke at BIOS settings but nothing really jumped out. Fired up a FreeBSD 10.1R livecd and got good performance there, so it was back to poking pfSense… continued onto the second page of forum search results for "cf card" this time, which brings us here.
[2.2.2-RELEASE][admin@pash]/boot: mount
/dev/ufs/pfsense0 on / (ufs, local, noatime, synchronous)
/dev/ufs/cf on /cf (ufs, local, noatime, synchronous)
[2.2.2-RELEASE][admin@pash]/root/tmp: dd if=/dev/zero of=1MB bs=1M count=1
1048576 bytes transferred in 49.369825 secs (21239 bytes/sec)
[2.2.2-RELEASE][admin@pash]/root: mount -o noatime,async /dev/ufs/pfsense0 /
/dev/ufs/pfsense0 on / (ufs, asynchronous, local, noatime)
/dev/ufs/cf on /cf (ufs, local, noatime, synchronous)
[2.2.2-RELEASE][admin@pash]/root/tmp: dd if=/dev/zero of=10MB bs=1m count=10
10485760 bytes transferred in 1.950883 secs (5374879 bytes/sec)
Edit: below is the system patch that I've applied…
--- config.lib.inc 2015-04-13 19:16:38.000000000 -0600
+++ config.lib.inc.async 2015-05-31 04:26:02.000000000 -0600
@@ -328,12 +328,12 @@
/* if the platform is soekris or wrap or pfSense, lets mount the
* compact flash cards root.
*/
- $status = mwexec("/sbin/mount -u -w -o sync,noatime /");
+ $status = mwexec("/sbin/mount -u -w -o async,noatime /");
/* we could not mount this correctly. kick off fsck */
if($status <> 0) {
log_error(gettext("File system is dirty. Launching FSCK for /"));
mwexec("/sbin/fsck -y /");
- $status = mwexec("/sbin/mount -u -w -o sync,noatime /");
+ $status = mwexec("/sbin/mount -u -w -o async,noatime /");
}
mark_subsystem_dirty('mount');
@@ -367,7 +367,7 @@
/* sync data, then force a remount of /cf */
pfSense_sync();
mwexec("/sbin/mount -u -r -f -o sync,noatime {$g['cf_path']}");
- mwexec("/sbin/mount -u -r -f -o sync,noatime /");
+ mwexec("/sbin/mount -u -r -f -o async,noatime /");
}
/****f* config/convert_config