Archive for Linux

VMware Magic - Live conversion of a physical Linux machine to a virtual machine!

// August 12th, 2009 // No Comments » // Linux, Tools, Troublesolving, Ubuntu, VMWare

I can’t tell you how many times VMware has amazed me throughout the years. It (and others like Microsoft Virtual PC) has come a long way in the recent years due to the increasing popularity and demand of virtualization solutions. I use virtual machines every day. At home I have VMware Fusion on my Macs for the occasional excursion into Windows and at work we use it both on our servers and I personally use it on my desktop to try out new things like Win7. OK, enough of praise for virtual machines. You are probably already sold on them yourself!

I am in the process of reconfiguring my “server stack” at home. My primary server is a Linux (Ubuntu) machine that I’m going to do terrible things to. I’m going to install Windows Home Server (WHS) on it!? This is mostly for the very cool feature “Drive Extender” that let’s you combine a bunch of hard drives into a single partition and still have a acceptable level of redundancy. To my knowledge there is no other solution quite like it. RAID can be good in some instances, but I want to try WHS and Drive Extender. But since the Linux machine is my primary server running a lot of important stuff I need it to be available 24/7. I will also need it even if I decide to keep the WHS as my primary server since I don’t want to convert all my Linux stuff to Windows.

So I set out to see if there was anyway I could convert the physical Linux machine into a virtual machine, with no downtime on the Linux machine. Enter the very cool product “VMware Converter”! This is free software from VMware, and with it I should be able to convert my live running machine into a virtual ditto with no downtime! That almost sounded to good to be true, and for some parts it was! :-)

I started by installing VMware Converter on my Linux machine. This posed no problems at all. I fired it up and selected my Linux machine as the source and tweaked a few settings. But when I got to the “choose destination” part of the conversion I hit a brick wall. It turns out you need a VMware ESX server as the destination to be able to do a live conversion of a running Linux machine. You can’t do the conversion into VMware Server or just into a VMware image. I honestly don’t know the reasons for this. Perhaps VMware just want it to be a “enterprise” feature (and make you pony up some cash). Anyway, I was about to give up at this point. Then I discovered that there is a free version of ESX called ESXi. Since I had never tried to set up an ESX server, and it was free, I decided to give it a shot and try to install it. By the way, VMware ESX is a product that runs nativly on your hardware without any operating system. You can then run virtual machines on the ESX server.

To install ESX you need a separate server. I have lots of old computers lying around, so I choose one of them and tried to install ESXi. First problem was that ESXi only supports 64bit systems. So I had to download an older version that supported 32bit. It then quickly turns out that ESX needs at least 1 gig of RAM, and my old horse only had 0.5. So I picked another computer that had 3 gig of RAM. This was a DELL machine, and ESX started to whine about a BIOS setting called “CPUIDLimit”. Apparently it wanted me to change this setting, but the DELL BIOS hides it. 10 minutes of google and some headache solved that problem. Basically you need to halt the boot sequence of ESX and enter the parameter nocheckCPUIDLimit. After that, everything installed just fine. I now had my first ESX server up and running!

From here on it was a simple process! I just fired up VMware Converter, selected the running Linux machine as the source and the ESX server as the destination and everything went perfectly.

If you have yet to try the stuff described in this post I can really recommend diving into it! Best of luck and keep Google (or perhaps Bing?) close by and all should be well. :-)

EXT3 and reserved space for Super User

// March 31st, 2009 // No Comments » // Linux, Troublesolving, Ubuntu

Now that is what I call a stellar title for a blog post! If you instantly get that, you have probably been fiddling with Linux for a while.

Well then, let the me explain myself. This is mostly a note to self so I know what to do the next time I run into this. I just installed a new 1TB disk for my Linux (Ubuntu) server. I partitioned it, and executed a simple:

mke2fs /dev/sdd1

I then went ahead and mounted the new file system, and checked the available space. I was a bit disappointed to see that my 1TB drive only had 871GB available space! OK, this is quite a lot of space but I was not at all satisfied with that. After chatting away awhile with my buddy mr Google I realized that the EXT3 format reserves 5% of the partition for the super user. Supposedly this is to be used in case of emergency, but this drive was used to be used as a simple file storage backup drive. To remove/change the amount of the reserved space, you just issue the following commands. Please be advised that you should NEVER do this on a system partition!

First, unmount the partition if it is mounted

sudo umount /dev/hdb1

Then issued this command to decrease the reserved space to 0:

sudo tune2fs -r 0 /dev/hdb1

And then just mount the partition again

sudo mount /dev/hdb1

And that’s all there is to it. Afterwards I had 917GB of available space. That’s more like it.