Thursday, January 15, 2009

HDD crash, VT tips and stuff

Disclaimer: As usual, there's no new content here, you can find all this with some Google searches. But: this is a blog, dammit! It needn't be academic quality. Now get off my damn lawn! ... Or something like that. Also, spell-checker's not yet installed due to HDD crash, so expect the worst.

A few days ago my dual-booted Windows XP fried everything on my HDD. And I _mean_ everything: not just it's own partition, but the whole partition table. After a feeble attempt to recover what I could, I now have a brand new Arch system.

I need IE for testing website layouts and Flash editing, especially for a big project I'm working on.. that will soon get it's rightful place on the projects page.. Anyway, I didn't want to give Win32 direct access to the hard-drive again, so I took a look at virtualization. KVM seems to be the most recommended solution, and it does work quite nicely. Also, see Xen for an alternative. However, you'll need either a kernel modified for running inside a virtualization environment (tough luck if the guest OS is proprietary), or a processor with virtualization support. Here's the guide I used to find out whether my processor supports VT, courtesy of the How-To Geek.

After installing and loading the appropriate modules, the easiest way to start a virtual machine is through the QEMU gui QtEmu. Only drawback I can think of is the Qt dependency, which isn't so bad after all. The UI is well thaught-out: click through the buttons and you're good to go.

The third thing (after IE and Flash editing) I use Win32 for is gaming. KVM gives the guest OS a software SVGA card - a definite no-go for modern games. Still, it should be OK for older stuff. Just for fun, I tried to install the NVidia driver for my card - and guess what, it couldn't find a supported card. So much about that - no high-end games in virtual machines for now, sorry. That and the fact that my parents occasionally use the computer, and my father would defend Win32 to death (probly just for the sake of argument, but still), I'll have to return to dual-booting Linux and Windows XP.

Next problem: gotta resize the 280GB /home partition to get some space for a real Windows install. Parted said something about unsupported features. Google told me that the problem is with the partition being ext3 - parted can't resize that. Temporarily disabling the feature(s) Y in ext2 + Y = ext3 is said to solve the problem. However, parted in the following script still complains about some feature:

umount /dev/sda2
tune2fs -O ^dir_index /dev/sda2
tune2fs -O ^has_journal /dev/sda2
parted
tune2fs -O dir_index /dev/sda2
tune2fs -O has_journal /dev/sda2
e2fsck -D /dev/sda2

I haven's solved this one yet, so the above-mentioned Big Project is delayed a bit more. BTW, the project being a web app, nothing cruical was lost. Most of my dot-files were saved at dotfiles or a pendrive.
Note to self (and you too. yes, you): make backups. Preferably in a version-control system. An on-site backup is not a back-up. Also, gotta learn git.

Random: new chapters in ADOI! \.o./

Update the day after: actually, the above script works perfectly, only with gparted instead of parted. I have no idea why this is, but I'll settle for "just 'cause" for now.