Partition and format storage drive on 4g nanobsd
I've got a 16gb SSD that i'm using with the 4g nanobsd image, and I want to add a 320gb HDD to store bandwidthd data on so it will save the SSD and also be persistent across reboots. I have very little experience on *BSD, but a fair amount of *nix experience.
So my question is this: can I partition and format the 320gb hdd from within pfSense using the shell? I've got a FreeBSD vm on my desktop machine that I set up, so I can pull the drive and format it on my desktop rig if I have to, but it would be much more convienient to do it direct.
There are a few people doing this, using a separate HD to store logs and for a Squid cache. Search for 'squid cache hd' or something similar. I was thinking about doing it myself and got as far as formtating the disk and having it come up correctly at boot time by editing the fstab.
However I believe most people, including me, concluded that if you're going to put in a HD you might as well boot from it. It takes all the hassle out of it. If you boot from NanpBSD then it will forget the HD exists every time you do an update as it overwrites the fstab. Not fun! ::) Also you loose a lot of the advantages of running from flash; noise, power, heat etc.
Here are some instructions: http://doc.pfsense.org/index.php/Local_Disk_Storage_on_Embedded_(soekris)
Thanks! That was exactly what I needed: a description of the specific tools needed to format and mount under nanoBSD.
These two pfSense boxes are for a datacenter setup, so I'm not too concerned about the noise, power, or heat issues. And once they are running they probably won't be updated until 2.0 goes final unless there is a security patch.
The thing I was most concerned with was reliability, I had a couple spare 320gb drives that I'm comfortable useing as data drives, but I didn't want to rely on them to keep the system booted since they were "used". And the 16gb Kingston SSDs were the same price as the cheapest new SATA 2.5" drive on NewEgg.
What happens if the hard drives fail and your pfSense box is trying to write logs to them?
Does it continue to run? :-\
Hmm that is a good point.. I would guess that if the hard drive couldn't mount then the /mnt/data directory on the SSD would fill up. But I have no idea what would happen if the hard drive died while mounted (which is the more likely scenario I would guess). If pfSense was running from a HDD and the drive died it would probably go down entirely, allowing the backup CARP node to take over. In this case it might just limp along with no logging until the SSD filled up.
Ugh. I suppose it it better to stop and reconfigure everything now rather than at 2 in the morning one night when the HDD on the primary dies and I have to drive out to the datacetner to reconfigure both of them.
What about using an NFS mount for the logs? Although I suppose that has the same risks, if the NFS mount goes down where do the logs go?
I'm not saying it's a bad idea just that you need to know what would happen.
It's not an uncommon situation so I'm sure there are many solutions to this already.
You just need to have some setting that will switch bandwidthd logs to /dev/null in case of a disk error.