Unetbootin[] now supports FreeNAS! Take a look at these awesome little snippets of code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| //distrolst.cpp
if (nameDistro == "FreeNAS") {
if (isarch64) {
cpuarch = "amd64";
} else {
cpuarch = "i386";
}
instIndvfl("memdisk", QString("%1ubnkern").arg(targetPath));
if (islivecd) {
downloadfile(QString("http://downloads.sourceforge.net/sourceforge/lubi/FreeNAS-%1-LiveCD-%2.img.gz").arg(cpuarch, relname), QString("%1ubninit").arg(targetPath));
} else {
downloadfile(QString("http://sourceforge.net/projects/freenas/files/stable/0.7/FreeNAS-%1-embedded-%2.img/download").arg(cpuarch, relname), QString("%1ubninit").arg(targetPath));
}
} |
1 2 3 4 5 6
| //distrover.cpp
distroselect->addItem("FreeNAS", (QStringList() << "0.7.4919" <<
unetbootin::tr("<b>Homepage:</b> <a href=\"http://freenas.org/\">http://www.freenas.org</a><br/>"
"<b>Description:</b> FreeNAS is an embedded open source NAS (Network-Attached Storage) distribution based on FreeBSD.<br/>"
"<b>Install Notes:</b> The LiveCD version creates a RAM drive for FreeNAS, and uses a FAT formatted floppy disk or USB key for saving the configuration file. The embedded version allows installation to hard disk.") <<
"0.7.4919" << "0.7.4919_x64" << "0.7.1.5024_Live" << "0.7.1.4997_Live_x64")); |
Segue:
I'm actually considering forking the unetbootin project to add support for a master distro list which can be updated remotely eliminating the requirement for users to download a new copy of the program if they wish to get the latest version of the list of pre-configured distros.
This has a little bit to do with the fact that I'll be required to take a few C++ courses at the University of Wyoming since Java is the standard language taught at the University of Arizona while I was there and I've never used C++ before. Can't be that hard right?
Summer is usually a bad thing for my hardware and projects. Once I've gone through all the trouble of getting them setup and working the way I like I get bored and wonder what else I could do to//with[] them.
My next project for my server[] was to install pfSense[]. I wasted most of my time on this project trying to do it the ways that were either not recommended or not documented.
Things like using unetbootin[] to run the LiveCD[] image since I have this strange hatred for optical media, it seems too wasteful to me, not to mention I rarely have the specific kind of media I need for the right project. That failed miserably of course since FreeBSD based LiveCD's never seem to like the extraction and customization process unetbootin does to linux based iso's.
After trying and failing to run the LiveCD from a thumb drive I did what I usually do to install OS's that require optical media for installation: I use my IDE-USB adapter[] to chain it to the USB KVM[] I use so I don't have to take my optical drive out to do installs. Lo and behold pfSense just happens to not support USB optical drives, it boots to the point where it would normally mount the iso9660[] formatted volume it expects to be at /dev/acd0 which isn't because FreeBSD 7.0 doesn't seem to have support for USB optical drives.
Anyway next in line was to use the embedded image. If you didn't already know the main storage for my server is a SYBA SD-CF-2IDE-U adapter[] or simpler: a Compact Flash to IDE adapter. I figured this would be simple enough as I used to do the same thing for running FreeNAS on my server. I'd just pop the CF card into the multi-reader on my desktop and use dd[] to dump the embedded image that pfSense provides to it. My first instinct after getting the image downloaded was to decompress it since it was packaged as a GNU Zip file. Booting from this produced only a pipe character with a blinking cursor immediately beneath it. Reading through instructions further I discovered that the embedded version doesn't have keyboard or video support, only serial which I don't have on any of my systems anymore never mind that for once I have the proper cable for that. Also apparently I'm supposed to dump the compressed image to the card which produces no pipe character at all let alone a bootable card.
Clearly I was off to a good start[]. I finally gave up on the whole idea of doing it any other way than what was tried and true. This lead to me dismantling my desktop to use the only working optical drive I've got left and plug it into my server to install from the LiveCD. Also took me a good long time to find the manual for the IDE-CF adapter to figure out which jumper[] needed to be changed so it would act as a slave. Once that was all said and done and the system booted to the LiveCD I ran the install to harddisk option. After formatting the disk, partitioning it and setting up appropriate slices it started the install. I wasn't done yet with my troubles since it decided it was going to hang at 43%. Upon further investigation I noticed the light on the optical drive I was using wasn't on or indicating any accessing at all. Found out that power had somehow disappeared from the drive, either through mechanical error[] or something else entirely. Rebooted and restarted the install once more, ended up disconnecting power and reconnecting it whilst installing. That seemed to do the trick as the install finished without further hitch excluding the fact that it wouldn't install GRUB citing an error return code of 1 so ditched that idea and just used their default setting.
You'd think I would have been done with installing and general mucking about at the low-level end of this whole thing and you'd be wrong. After putting the optical drive back in my desktop and rebooting the server I notice it did the same thing it did when I tried to boot it from the optical drive plugged in through USB, it couldn't find//mount the volume it thought the system was on. This is due to the CF adapter being a slave during the install and a master during boot after removing the optical drive. Instead of mucking around with the KVM switch and switching monitor display ports anymore[] I popped the CF card out of my server and into the CF port on the multi-reader in my desktop. Instead of using the USB filtering that VirtualBox has since it rarely ever works//tends to break anything I touch with it, I fired up a command prompt and created a vmdk that points to the physical disk. Mind you the command prompt must be run as administrator if you're doing this in Windows 7 like I am. It will fail with a VERR_ACCESS_DENIED exception if you don't.
1
| VBoxManage.exe internalcommands createrawvmdk -filename CF.vmdk -rawdisk \\.\PhysicalDrive3 |
After creating CF.vmdk I made a new virtual machine for it to go into along with mounting the pfSense LiveCD. Starting a command prompt with option 8 I mounted /dev/ad0s1a to /mnt and edited /mnt/etc/fstab to change ad1s1a and ad0s1b to ad0s1a and ad0s1b respectively.
1 2
| mount ufs:/dev/ad0s1a /mnt
vI /mnt/etc/fstab |
Reboot and it is finished! After all that is simple web-interface based configuration that didn't take very much time at all. Actually as I write this I am posting it through my new pfSense router.