UEFI rimes with misery

(Yes, it does rime, if you pronounce the acronym the french way :D)

TL; DR: Don't try to create a bootable USB for Windows by fiddling around with diskpart. Get a USB disk drive instead, or use proper tools. If your Windows boot breaks, have a DVD on hand, go to repair mode and run the automated repair up to three times. If it says "not compatible", try running the DVD as UEFI from your BIOS. Have up-to-date backups and a Linux live USB on hand at all times. And dual-boot is apparently easier than the Internet seems to think.

Let's start with a quick timeline of the events of late last week:

  • Received the last parts for my desktop computer after a post hiccup.
  • Put the Beast together. It's surprisingly easy nowadays! Just don't forget to plug in the CPU fan. Just sayin'.
  • Find out that Windows 8.1 was 300SEK cheaper as an OEM disk from Webhallen.
  • Decide that surely it won't be that hard to create a bootable USB from that.

WRONG. It turns out that the OEM disk does not allow you to "Install to media" from the Windows 8 setup, like a retail version does. Unfortunately the tutorial I found suggested doing some blood magic with diskpart. I created an ISO, followed the commands, thinking I was doing things right. But some process was holding a handle on a file from the ISO (?), so I just went into ProcessExplorer, closed the handle and kept going. Yes, this should have set off a few alarm bells. I was still getting "File in use" errors, so I restarted...

Windows won't boot

Well, this is interesting.

Yes, you got this right, I managed to fry my laptop's boot by trying to make the USB to install my desktop. "Restart and select proper Boot device". That didn't sound very good. Was this "BCD" thing important, then...?

Cutting to the chase, of course it was. BCD stands for "Boot Configuration Data", and it's a vital file if you want your Windows to start at all. I sighed, dug up the Linux Mint USB stick I had already made, fired up my Macbook Air for some googling, and settled in for a very annoying Sunday afternoon. Apologies to my twitter followers for all the cursing, by the way :)

First step was getting it to boot again on Mint, to make sure everything was alright apart from the boot itself. I had made the USB previously for the desktop. This was completely painless: download the ISO from the website (I went for Cinnamon), use a tool to create a bootable USB (I used Universal USB Installer), and there you go. You might have to iterate on the formatting somewhat (NTFS or FAT32). Then start up the computer, enter the BIOS, and set the USB as the first boot device. I had to switch between the UEFI and the non-UEFI version to get it to start, wondering what that new acronym meant.

I got it to start up under Mint, checked my drives: relief, everything was still there. Note: at that point I kept trying to fix things without backing up first. This is a terrible idea and you should not do the same, I was lucky to not lose anything. Make a backup before you fiddle with your partition table! Also, everything that follows is made much more interesting by the fact I did not have a Windows 7 DVD handy.

Looking into GParted was quite educational: I saw that my laptop in fact has five partitions. "System", hidden (no letter assigned) and quite small. Another partition that GParted couldn't identify. Then "OS", my C: drive. "Data", my D: drive. And "Recovery", hidden as well. It was the first time I saw the naming schemes for those: sda for the hard drive, sda1 to sda5 for the paritions, sdb for the USB drive I had plugged in.

First thing I had vague memories of was the MBR (Master Boot Record). I couldn't explain to you exactly what it is, and frankly I didn't want to dig too deep. But basically the first possible reason for your Windows not to boot is that the installation is not listed in the MBR anymore. The easy way to fix this is by plopping in your Windows recovery disk, but as mentioned I didn't have one, so I tried doing things the hard way. Googling found this tutorial, which I followed religiously, with a ridiculous number of reboots in the process. It didn't help though. Since my Windows was still listed in the available boot devices, just failing to start, I started to suspect it was more serious than a broken MBR.

I then found out about BootRepair (thanks to Jeroen Baert for the tip). It's a Ubuntu tool but since Mint is a Ubuntu derivative, it's also available there. You have to add a new APT repository to get it, just follow the instructions on the page. Then you click the big friendly button, let it work its magic...

... Still no luck. Next step was Super GRUB Disk. I created a bootable USB from that, picked the right boot device, and was able to start it up. This USB I created from my Mac, using Mac Linux USB Loader. I think I had to format the USB to FAT32 beforehand from Disk Utilities. Once SGD starts it will list the available boots on your machine more extensively than your BIOS. There I saw the three Windows boots available: System, OS, Recovery. I tried to start each of them and got the same error message each time: it was failing to find the BCD file. The message went something like this:

File: /Boot/BCD
Status: 0xc000000f
Info: an error occurred while attempting to read the boot configuration data.

Throughout the previous googling, I had encountered "BCD" and "UEFI" more and more often. I looked into it a bit more and figured out that my laptop was a complicated case because of UEFI. I do not know the details (and don't want to know them), but it's some kind of more modern BIOS replacement which, for Windows, is coupled with some secure boot mechanism. It's the reason for the four-partition setup... and it makes fixing anything more complicated. I did not investigate the exact details, but apparently with BIOS you just have a blob at the very start of the disk that then points directly to the boot files. With UEFI you have this intermediary System partition making everything messier.

At this point it was becoming obvious that I needed a Windows recovery up and running if I was to get anywhere. I hunted down a Windows 7 ISO (which is completely legal to download), and created yet another bootable USB. I managed to boot from the USB after randomly toggling between UEFI and non-UEFI... somehow UEFI wasn't always the right one! "Repair my system", and it complained that the Windows I was trying to repair wasn't compatible. Darn.

This, however, does not prevent you from opening a command prompt. Hit Shift-F10 to get one. From there, I followed this tutorial. Solution one was a no-go due to the compatibility failure. Solution two did not work. Solution three, "Nuclear Holocaust", started throwing "The requested system device cannot be found" errors at me halfway through. Googling some more, it seems that the procedure will not behave properly unless you're running from a DVD. I cursed some more (sorry again, Twitter), turned the whole thing off for the night and used my Mac instead.

Luckily, I work for a tech company and not everybody's on vacation, so I was pretty optimistic about my odds of finding a Win7 DVD from a colleague. Daniel Collin came through with flying colors, along with a USB DVD reader that was going to allow me to setup my desktop. After finally completing a backup (don't wait like I did! Do it from the start!), I plopped in the disk on Tuesday and attempted to repair my system.

"Incompatible" again. Damn. I restarted, went back to the BIOS, and made sure to start the DVD as UEFI. And this time I was finally able to access the recovery mode! I ran the automated repair, let it run, restarted, booted up recovery again, ran the repair a second time, restarted... It's actually recommended to run it three times, but the third time couldn't find any issues anymore. So I rebooted, tweaked the devices order in the BIOS...

I was never so happy to see the Windows start screen.

Conclusion: This is a bit of an underwhelming finish, because it was automated repair magic that fixed it and not anything I was doing myself. My guess is that it was able to do what I tried to do with bcdedit but could not because of the error.

Bonus: Win8 + Mint dual boot on the desktop!

Since I wasn't done having fun with partitions, MBRs and other things which make me praise the sky I'm a software engineer and not a sysadmin, I wanted to fix up a dual boot on my brand new desktop. I used the USB disk drive to install Windows 8, which went swimmingly if you ignore the creepy default settings. I then picked up my faithful Mint live USB again, plopped it in, installed, rebooted... Nothing but Windows. Seems that by default it does not install in a way that makes you boot to GRUB. I found this wonderfully objective tutorial which explained a thing or two, and decided I was just going to be lazy and run BootRepair. I booted the live USB again, installed the package and ran it. The only problem I had while running the commands it suggested was a missing dependency (linux-headers-something): I just took the apt-get line that was failing, changed the package name to the missing dependency, ran that, then the original command, and it proceeded just fine. The final window said there were errors, but still advised rebooting, and so I did. I was greeted by GRUB asking me to pick an OS to boot, and everything seems to work fine. So, yay for BootRepair, and thanks to UEFI for forcing me to use magic tools instead of understanding what's happening.

Do note I did not have to disable SecureBoot at any point. Your mileage may vary, but it seems it's not necessary anymore and many tutorials on the web are out of date.

Second bonus: As a reward for making it through the whole post, here's a chocolate cake recipe I promised to write up.

Ingredients: 200g of dark baking chocolate, 100g of butter (preferably with salt in it), 50g of flour, 100g of sugar, three whole eggs (well, without the shell). Do not use milk chocolate or it will be too liquid.

Heat up oven at 220°C. Melt the chocolate and the butter together in a bain-marie, mixing slowly so that it gets a nice silky texture. While it's melting, prepare the flour, sugar and eggs in a mixing bowl, without mixing just yet. Add the chocolate and butter and mix quickly (or your eggs will turn to omelette from the heat...) until the whole thing is homogenous. Pour in a metal or Pyrex-like mold (one of them oval glass things for chicken is perfect): it should "feel" homogenous, neither too liquid not too solid, and make nice ribbons while you pour it. Then put in the oven for 10 minutes. It's perfect when you can stab it with a knife and have said knife come back with just a little chocolate on it. Leftovers can be stuck in the fridge for a very buttery texture that's awfully heavy but delicious too, though of course it's better warm.

Updating Wordpress: localization woes

Today, I decided to update WordPress. On related news, you might find a lot of curses in my tweets today. I'm writing up my findings in case it helps other unfortunate souls.

WordPress localization seems to work by hardcoding english strings in the source code, listing them in a .pot file with the source file names and line numbers, which is then overriden by a .mo and .po file. The .mo file seems to be some kind of binarish format, the .po is similar to the .pot but with translations.

So what's the problem with this? I'm using the Twenty Eleven theme, because it's simple, it was built-in and I like it. Sounds reasonnable enough. However, its localization files used to be in the WordPress core. This was (rightfully) deemed unsatisfactory at some point, and they were moved out into a languages directory inside the theme itself... for the more recent themes. Which means that the older Twenty Eleven, the files are removed from the core but not added back. Result: the french version of my website still says "Posted on", verbatim.

One solution is to go find language files, but my google digging did not yield anything for this theme. There are files in the older french wordpress core, but they're not compatible. Since the line numbers are baked in that's not really a surprise! I tried to update the line numbers in the .po file but it still didn't work.

In the end, I decided to live with the somewhat crappy mix. I do not have the energy to keep digging to bypass clunky design, and upgrading my whole theme just for that is a bit overboard.

Another issue when updating is that my translation plugin, qTranslate, was not compatible anymore. It seems to be abandoned, but luckily mqTranslate, a fork with team features, has picked up the banner. It includes a database conversion function and the transition went pretty smoothly overall! I just had to enable French again and tell it to use the overriden date formats.

No, metal does not always sound the same

I can completely agree if you say "I don't like metal". That's a bit sad - it's really broad - but fine. However, don't say it all sounds the same, because that's very wrong :) All the following are Youtube links.

This is metal. This too. And this as well. And this. And this as well, even if it's harder to place.

I'm not going to detail what's what, this isn't the point here. However, even a cursory glance should convince you those don't quite sound alike! And who knows, you might even like some of it. Enjoy!

Edit: My friend Meteotrix wrote the same kind of list. He's got different tastes, so that's another sampling. Soilwork is awesome though, you might have heard me say that before.

Music, maestro!

So I was at the Demodays this week-end, and talking to some friends about some music they absolutely have to listen to. If I'm going to write a lenghty list of links, might as well make it public so here we go! Kudos to Meteotrix for making me discover most of this stuff.


Yes, I'm a metalhead, so there's going to be a bunch of stuff in this category. I'll skip the extremely famous ones such as In Flames, of course... And obvious big warning for weird metal music videos. You know they're always bad or weird. Or both.

First goes my favorite band: Soilwork. Melodic death metal, means mixing pretty hardcore stuff with complex melodies. Most of the time you get growling for most of the songs and melodic choruses. Their style has evolved quite a bit between albums. The last one, The Living Infinite, is overall extremely good. You might have trouble at first: but give it a week and you'll most likely have it stuck in your head and come back to it. It's all on Spotify and on Grooveshark, and the four best songs are available for free on their website (look at the four "Play" buttons in the header). Do check out the rest though, because there's not much to throw away in their work!

Still in the melodeath range, you should check out MyGRAIN. I highly recommend the album which has the same name as the band more than the others. Highlight: Of Immortal Aeons. Disarmonia Mundi's done some interesting stuff. Highlight: Celestial Furnace, which is a coop with Soilwork's singer. If you have nothing against cheesy lyrics and VERY bad music videos, The Unguided is also worth checking out. They were formed from Sonic Syndicate (which is apparently back from the dead since that happened, go figure). Highlights from The Unguided would be Betrayer of the Code (play gothic bingo while watching that one, btw) and Phoenix Down. Phoenix Down also has an awesome remix by Zardonic.

Another style I like quite a bit is industrial metal (but nope, Rammstein is not my thing). Oomph's Monster album is one of my favorites, along with a lot of stuff from Pain. Highlights: The Great Pretender from Pain, and Sandmann and Labyrinth from Oomph. Don't you dare listen to the English version of Oomph's songs, that's just sad.

Metalish alternative electronic something?

Wikipedia has to place Celldweller in 8 different genres to get anywhere. That's saying something on his style. The vocals can take some getting used to, but Wish Upon A Blackstar is an absolutely smashing album. Celldweller does a lot of music intended for licencing, released in the Soundtrack for the Voices in my Head albums. You'll probably recognize some of them from games, trailers and movies. His debut album, Celldweller, has some great tracks as well. Lots of it on Spotify, Grooveshark and Youtube. My personal favorites would be (no order) Switchback, The Last Firstborn, Own Little World, So Long Sentiment, Eon, Blackstar, Unshakeable. And he likes remixing stuff, including his own, and letting friends remix stuff, so there are entire albums of remixes of a single song.

One of said friends is Blue Stahli, who did the same as other people in this list and named his first album "Blue Stahli". My favorite one would be Takedown. Technically it's listed as indus metal in some places, but er...

Might expand this post with more eventually but that's already quite a lot of stuff. Nice game soundtracks next, maybe?

On (my) sexism

Well, it's been a while. So let's try to get writing again, with a topic that always inspires me somewhat...

Possible trigger warning for some rude sexism and sexual violence related words. No graphic descriptions or anything though.

There's been a bunch of interesting articles a while ago (e.g. this one, or this one), from women realizing they used to be sexist, too. Watching Feminist Frequency's older videos, reading some stuff on the Everyday sexism website, got me thinking quite a bit about the topic. This article on Tomb Raider being empowering helped as well. But it's this write-up about distinguishing appearances from personality which was the real wake-up call. And I realized that, well, I used to be sexist, too. Let me explain.

My closest friends were always girls, but never "girly girls". Part of me thought that trying to be pretty, putting on make-up, shaving your legs and such was giving in to social conventions, and synonym with being stupid and weak. So I was never going to do that, right, since I was so much smarter and better and blah blah blah? I slowly became more tolerant, but only saw recently how messed-up that was.

During my higher studies (three years of Computer Science), I was one of the only girls in the class, and a pretty good student. Part of me loved that, being so special and everything, and I was pretty cold to other female students by default. Something in me thought that they didn't belong there since they weren't as good. Or something. And I was especially nasty to them when they showed up in skirts or that kind of thing, like for those simulated job interviews we had. They were being weak, right?

Me being "one of the guys"? Yeah, there was some of that.

And if only that was the worst. Thanks to the image of men that society builds for us (Internet is especially guilty), I finally unearthed something really dangerous in my thought process. I have no memory of ever being harassed for being a girl. A few annoyings remarks here and there but nothing traumatizing. I never got hit on by anyone, except some "Eh mademoiselle t'es troooooop belle" in the metro once in a blue moon by random dumbasses five years younger who probably say that to every girl. You'll tell me, that's nice, good for you. Well, something in me was saying "Never been harassed? Must mean you're completely unattractive considering how all men are."

I probably turned very, very pale when I finally pinpointed that. It's so wrong, on so many levels. First, as mentionned, I never made any effort to actually look even remotely nice before recently. Even in that broken frame of thought it didn't make much sense. But the most important? I've internalized the idea that it should somehow be normal, be flattering to have people not respect you. Also, it's kind of insulting to guys when you think about it. So, let's state a few things here both for myself and for anyone reading my blurbs.

No, saying "I'd gladly fuck / rape you" is NOT a compliment. It's at best irrelevant unless you're in a rather specific context, and plain creepy and threatening otherwise.

No, trying to be pretty is not "asking for it" or anything. Don't do slut-shaming or victim-blaming, that's plain nasty. I've changed my style quite a bit lately, and I realize that looking better just feels good. Attracting people is irrelevant. Also, kudos to the people at the office who complimented me as looking "awesome" and not any other adjective!

(On that note though: in theory one should be able to do whatever one wants without being threatened. The victim is never the guilty one. We don't live in a perfect world unfortunately, so watching out somewhat can't hurt. But if anything happens? It's not your fault, no matter what. Period. As excellently stated on domestic violence here, violence is a choice of the perpetrator, and a very bad one.)

No, a girl actually caring about her appearance is not necessarily shallow or dumb. Looks have nothing to do with that.

No, the correct way to make a female character strong is NOT to rob her of every bit of sex-appeal and to make her breasts smaller. It's so much more complicated than that, and yet so simple. Just write a good character, and stop taking male as the default option.

Now, does anyone have a time machine handy? I've got a 12-year-old me to go lecture. Or a 20-year-old me as well.