Linux on Dell Laptops – Don’t Press the MediaDirect Button

I’ve been pulling late nights at work on and off for around 4 or 5 days. Last night was one such night. Upgrades and updates dragged into the night with me waiting on standby to go in and do my thing. My thing started around 2 hours later than planned and I got to bed pretty late. Straight from the computer screen I found it hard to get to sleep and it took maybe another hour to get to sleep. 3 hours later, with the work continuing, somebody triggered our monitoring system and I blearily stumbled out of bed to attend to the triggered alarm and see what the fuss was about. Unsteady on my feet I reached in the dark for the the power button on my stupidly large and heavy Dell XPS M1710 laptop, overbalanced slightly and instead pushed what felt like a smaller button, but the machine powered on all the same.

What I got instead of the Grub bootloader and Ubuntu’s pretty usplash boot screen was something light blue in colour and Windows like, telling me it was scanning for media files, then a Grub boot error appeared behind it, which looks pretty weird in a Windows environment.

Thankfully, somebody else beat me to the monitoring alert but what they didn’t do while dealing with the alert was recover my laptop’s partition layout and all of my files. That would have been hard for them to be honest as my laptop’s filesystem isn’t monitored by work’s monitoring system as you might expect, so perhaps they could be forgiven.

Now, someone had told me that they made the same mistake doing almost exactly the same thing, blundering around, all half-asleep in the dark. I won’t say who that is, it wouldn’t be fair, though the person in question happened to be at a developer summit for a very popular Linux distribution at the time and the following morning, had one of the company employees, who worked on the development of the kind of low-level tools used when dealing with this kind of thing to take a look. MediaDirect had destroyed his partition table, thankfully however, the dev was able to do all sorts of crazy shit and put his partition table back how it was before. I don’t have a dev who can do crazy partition table shit and neither do you.

Put simply, the Dell MediaDirect button, when used to power on your machine will delete any non-Windows (FAT or NTFS) partitions and replace them with a Windows partition which is like an instant-on media player, similar to the instant-on Linux system you can get on some Dells. That’s even though I completely blew away the entire pre-installed Windows OS, including the pre-installed MediaDirect partition, repartitioned and installed my own operating system. MediaDirect is installed in a protected part of the disk, called the Host-Protected Area (HPA), which can’t easily be wiped by you or I, but in any case, it’s too late, my partitions are fragged. When booted into Ubuntu, the MediaDirect button starts your media player of choice, that’s Rhythmbox for me, Banshee always falls over on importing my music collection. Sadly I assume the instant-on Linux feature won’t delete Windows partitions…

Thankfully, I rsynced my home directory to my new HP server about a week and a half ago and I haven’t really created/edited/downloaded any new files in that time, I’ve just done a lot of console work. My Firefox bookmarks are synced with Foxmarks, all of my personal mail is done over IMAP on my own remote mail server and all of my files, minus a few small edits, are on the home server.

This story has 2 morals:

  1. Make backups more often than you already do. If you do none, then just doing it once will be better than nothing. My having backups, despite being a sysadmin, is more to do with the good fortune of having just purchased a home server and rsyncing my files to it so I could sync my laptops against it, rather than against each other and then have various versions of the sames files; and so I could play my music files without having to carry the heavy laptop around the house, than it does about good planning and regular backups. Do a backup today or do it tomorrow if you can’t do it today.
  2. Don’t press the MediaDirect button when you want to power on your Dell laptop which has Linux installed. I believe the problem doesn’t exist when Linux is pre-installed, Dell thought of this at that point, but it doesn’t help you if you purchased a Windows laptop and installed Linux either in a dual-boot, or as the only OS.

I don’t yet know of a way to disable the MediaDirect button’s action, but I do have some good news. I managed to recover my partition layout while I was writing this post. I was searching Google for ‘Ubuntu Dell MediaDirect’, which seems to be so common that Google Suggest suggests it and I came across this Ubuntu Forums thread and used the second set of instructions in this post to recover my partition table. Essentially, you boot from an Ubuntu live CD, modify your apt-sources.list and install testdisk, tap Proceed a few times until it shows you your original partition layout and then you save it. Thank fuck for the guy that wrote teskdisk, the guy who wrote the forum post and the guy who told him how to do it. Major kudos to those guys, I now hand that knowledge over to you in case you should ever need it. I just have to find a way of turning off that insane MediaDirect power on function.

Thankfully, in my middle-of-the-night blind stupour, I had the presence of mind to power the machine off as soon as I realised that it was doing something bad that I didn’t understand, even though I was still too half-asleep to understand why I thought it might be bad. That bit of instinctive reaction stopped MediaDirect writing files over the top of my existing files, even though it ate the partition table. Had I left it much longer, I might not have so many files left.

More details about HPA here. Testdisk home page here for all your partition recovery needs. How much would you have to pay for the equivalent Windows tool? Free Software saves lives, for me at least.

3 thoughts on “Linux on Dell Laptops – Don’t Press the MediaDirect Button

  1. I have done that with my old inspiron, and with my new vostro. The first time it was ‘wonder what that button does?.Oh bollocks.’ Subsequent events have been in the dark, or by other poeople. I wonder if it does this on the Ubuntu Dells? I should be getting a new hard drive soon, so I can get rid of the thing.

    Testdisk/photorec have saved many files for me.

  2. I made that experience quite some time ago, when I bought my XPS m1330. There´s a way to fix it, if you are willing to back up all your data. If you zero your complete drive with dd if=/dev/null of=/dev/{whatever your hdd is} and then reinstall, the media direct button will just display the screen and then boot your machine normally. WARNNING: This command will erase every sector on your harddrive, back up all your stuff first. 😉

    I know this is a major hassle since you have to reinstall and the dd will take a while (depending on your HDD size), but I hope it helps.

Comments are closed.