Archive

Archive for the ‘FreeBSD’ Category

How to perform a P2V conversion for FreeBSD to run on Hyper-V

November 29th, 2009 Justin James 6 comments

One of my big projects with my personal server setup, was to turn my current physical FreeBSD server into a Hyper-V VM. Why would I do this? Don’t ask, because I don’t want to start a religous war here… let’s just say that as much as I like FreeBSD for a lot of purposes, I do not like living with it as a sys admin without a paycheck attached.

So, here’s how I went from FreeBSD on a physical machine (garbage x64 hardware) to a Hyper-V VM (Windows 2008 R2 on garbage x64 hardware).

  1. Upgrade the FreeBSD machine to version 8.0-RELEASE. This is mandatory.
  2. Get Hyper-V installed and configured, including enabling Intel VT in the BIOS.
  3. Shut down both machines. Transfer the physical hard drive from the FreeBSD machine to the Windows 2008 R2 machine. Turn on the 2008 R2 machine, and verify in Disk Management that the transferred drive is visible.
  4. Create a new Hyper-V VM for the machine, but do not specify a hard disk. Go back into the settings, and remove the NIC that was put into the VM. Do “Add new hardware” and select “Legacy Network Adapter”, and connect the new NIC to the network of choice.
  5. Create a new virtual disk. Select “Fixed” type, and on the next page in the wizard, tell it to copy the contents of a physical disk. Choose the disk you transferred from the FreeBSD machine.
  6. Go eat dinner, walk the dog, read a magazine. You’ll be here a while during the disk copy. To be on the safe side, go download the “Live FS” FreeBSD ISO appropriate for your installed FreeBSD version.
  7. Once the new virtual disk has been created, go back into the VM settings, move the optical drive to postion 1 on the IDE chain, and then add the newly created disk to the VM on position 0 on the IDE chain.
  8. Start the VM. If you receive errors like “Invalid slice”, you need to do the following:
    1. Insert the Live FS ISO into the virtual DVD drive and reboot the VM.
    2. Go to “Configure” and then “Fdisk”. Set the main drive slice (the big one) to be bootable, and then press “W” to write the information to disk. Before it writes, it will ask about a boot loader; choose the standard one, unless you have a good reason not to and know what you are doing.
    3. Exit the Live FS system, eject the ISO, and reboot the VM.

    This should take care of the “bad” boot loader.

  9. If the physical disk in the original server was not device “ad0″ (for example, it was a SCSI drive or a RAID 1 member), then the system will spaz when you boot and drop to single user mode. Not to worry! In single user mode, do the following: (note: if you can’t even get into single user mode, boot off of the Live FS CD and use the “Fixit” shell)
    1. Re-mount the root partition as writeable with:mount -u /
      mount -a
      Likewise, mount /usr and /tmp with:
      mount /dev/ad0s1f /usr
      mount /dev/ad0s1e /tmp
    2. Now you can actually use your text editor of choice to edit /etc/fstab and set the references to the old drive to be references to the new drive as ad0. Do that and reboot.
  10. You are in the home stretch now! You should be booted into FreeBSD, albeit a crippled one, because the NIC isn’t configured. Go edit /etc/rc.conf and change the reference to your old NIC to be a reference to de0 (the NIC that Hyper-V provides). Reboot again, and you should be done!

This is what I did… it might not work 100% for you, for better or for worse.

J.Ja

Hyper-V in Server 2008 R2 has one super new feature

October 1st, 2009 Justin James 4 comments

I put together a Windows Server 2008 R2 box over the weekend (my old Vista machine is now the server). I spent part of today working on trying to do a P2V conversion of my FreeBSD server to bring it onto the box in Hyper-V. At first, I tried using Acronis Home 2009 to clone the disk, then re-clone into the VM, like I’ve done before. For whatever reason, it did not like the RAID in the FreeBSD box, and wouldn’t read the data from it. Along the way, I decided to prep the new Hyper-V VM, and lo and behold, I discovered it’s super new feature: when creating a new virtual hard drive, you can copy an existing physical drive (not “file system”, the entire drive!) as the contents of the virtual drive. This means that you can take the disk out of the old system, hook it up to the new system, clone it into the VM really quick, and be on your merry way. The only real drawbacks are that you cannot do a dynamically expanding disk like this, so the new VHD is the same size as the physical disk it was clone from (although it will be fast), and that it takes forever because it does a sector-by-sector copy of the disk. While this is still not a proper substitute for a true P2V agent-based conversion, this is pretty darned close, especially for OS’s that are not mainstream enough to justify someone writing the conversion agent.

J.Ja

Categories: FreeBSD, Hyper-V, Windows Server 2008 Tags:

Fake RAID + *Nix = Abject Disaster

May 20th, 2008 Justin James 6 comments

This weekend, I had the chance to try to install a wide variety of OS’s on my server here. Now that I got the last paying customer off, I decided to see if the problems were OS/driver specific, or hardware specific. Unfortunately, I only got to actually install 2 OS’s. What went wrong? Linux still has lousy driver support.

The motherboard in the server has the Intel ICH7 chipset which provides “fake RAID” functionality. Is it as good a true hardware RAID? No, but I prefer it to full software RAID. Mainly, because I’ve seen some real messes caused by software RAID (particularly on Linux), and I’ve never had problems with “fake RAID”. It’s my personal preference, so let’s not debate it, please.

I first tried to install FreeBSD 7.0 (it was running FreeBSD 6.3), but I saw the same problems. I broke the RAID 1, re-installed it with the controller in IDE mode, same problem. To test the driver theory, I recreated the RAID, and embarked on installing every major *Nix distribution on the planet.

Thanks to a ton of good press, I tried Ubuntu first. Ubuntu recognized the “fake RAID” as individual disks, but not the mirror set, so it was out of the question. The instructions I found on the Internet suggesting how to make it work were frightening at best. Next, I tried OpenSolaris 10 (the May 2008 version that’s been getting good reviews). It did not have a driver for the system in “fake RAID” mode, but it did have a driver for it in IDE mode. Alas, it was missing other drivers related to the chipset, so it was out too. Open SUSE 10.3 looked like a winner, but the installer suddenly started throwing feces at itself the moment it tried to write to the disk that it recognized, so it struck out. And Fedora 9 didn’t recognize the mirror set at all (but it did see the individual drive on the controller).

Folks, Linux supposedly has this “great” driver support. And OpenSolaris supposedly wants to make a play in the server room. But regardless of the technical merits or problems with “fake RAID”, the fact is, it has become extreme prevalent, particularly in the server room. All of the inexpensive servers support “fake RAID” and SATA disks, which saves big bucks compared to SAS or SCSI drives and true hardware RAID, sometimes as nearly much as the server itself. Let’s get real, adding $500 in storage costs to a $700 box makes little sense. And it is not like the ICH7 chipset is really off the wall. It is simply a slightly older chipset than the current offering, the ICH9. It’s extraordinarily common, especially in “white box” servers like SuperMicro and Tyan machines. Not supporting it is insane.

I am really not sure how these OS’s expect to make major inroads when support for such a common chipset, or at least support for it in a common configuration, is so abysmal. Before any of the Linux folks out there get up on their high horse and start showing me links to some jerry-rigged “well, if you had Googled past page 2 of the results for this query, you would have seen these 53 pages of instructions, you lazy jerk!” let me remind you of something: I am a real IT person. I don’t jerry-rig. Anything found on some arcane magic ritual that breaks the moment the system performs an automated, binary update and overwrites some special code I hand-compiled doesn’t fly with me. I know, I know, that’s the *Nix way. But I can’t run a server like that, and neither do sys admins who like to keeep their jobs.

I am reminded, once again, of the reason why I use FreeBSD in the first place now. For a system with so little hoopla around it, it actually works. Or maybe that’s because the people involved actually work hard to make a good product, instead of trying to compete for desktop eyeballs against Microsoft.

J.Ja

Categories: FreeBSD, Storage Tags: