Vista boot beware!



  •  Well I'll start this off with a blanket statement:

    Anyone who dual-boots vista and linux with a boot manager like GRUB, and then tries to use the recovery disc that came with their vista machine, WILL brick their bootloader.

    That may or may not be a very accurate generalization but it's what happened to me.  I'll explain...

    I have an Asus G1S-A1, and it was time to reformat.  It's my first and only Vista machine.  Asus, in their infinite wisdom, followed that annoying trend these days and did not provide a Vista DVD with the laptop, instead opting for one of those shiny discs that supposedly restores your hard drive to the factory state.

    Painful, for anyone who's ever used an Asus laptop, as they are guilty of bundling more completely useless and irritating shit with their machines than almost anyone in the consumer machine market. 

    But all you can do is take what you're given, so I backed up all my data and ran the recovery disc.  I opted to restore to the entire hard drive, which I foolishly assumed would be the best choice for a clean install...  What I obviously should have done was restore to the primary partition and left the linux install alone, as it would have avoided hours of tinkering, but I wanted to replace that with a new clean distro and hadn't even decided what that would be, so wiping the whole hard drive and shrinking the partition later seemed the best choice.

    It wasn't.

    See, VISTA has a nice new boot loader.

    That doesn't sit in the MBR at all.

    Vista's bootloader is strapped by any good ol' microsoft MBR code and once the boot sector of the partition it's on is invoked, it loads up its Boot Configuration Data or whatever it's called and goes on its merry way.

    That's all fine and good, but it has a nasty side effect:

    It apparently, at least in my case, doesn't even write to the MBR during an install.  Or check at all to make sure it's standard code in there.  It just assumes that the sector 0 code will strap it and it goes on its merry way.

    This was a pretty big shock to someone who reformatted XP a good 15 times during its product lifespan, is used to slipstreaming service packs into operating system CDs and starting from clean installs, has always had some form of linux dual-booted and every single time XP wrote to the MBR and thus cleared out any boot manager I had running...
    But the crapy asus recovery disc restored all the Vista pre-load files without writing the bootstrap code, bailed for reset, and I get:
    <font face="courier new,courier">

    </font>

    <font face="courier new,courier">GRUB stage 1.5</font>

    <font face="courier new,courier">GRUB loading, please wait...</font>

    <font face="courier new,courier">Error 17.</font>

     

    Welll, of course, you're trying to read a menu.lst off of a partition that isn't there anymore.  but why are you even still here?

    Okay, no problem, I'm sure I can fix this with the Vista recovery console - OH WAIT I DON'T HAVE A VISTA DVD.  Sure enough, I can't get into any kind of vista system repair from the recovery disc... The closest I can get to is the standard boot menu option which offers me "Safe Mode Command Prompt Only", except it doesn't actually DO safe mode command prompt only, it does "safe mode but don't give you a prompt and start the asus recovery menu instead".

    Okay, annoying but still no problem, I'll just wait until I get home and then use an XP recovery console to take care of this, it's the same bootstrap after all - OH WAIT XP has zero support for my SATA controller, even on an SP2 slipstream disc.  So it can't read my hard drive whatsoever.

    So after some googling, I find some people who wanted to go back to XP on their Asus G1's, and from a link on one of those forum posts got a hold of the applicable SATA drivers, and learned how to use nLite to make a new XP disc with them integrated into the windows setup loader.

    Well that was a pain in the ass but at least now I'll be okay, I'll just log into the recovery console and - OH WAIT I don't have the password for the Administrator account.  Because there isn't one.  Because it was only partway through the Vista setup so one was never set, and even if Vista setup had concluded, in Vista the built-in Administrator account is disabled by default and you'd have to use a command prompt with administrative privileges to enable it (a good move in general, but obviously totally defeats the purpose in this case).  Of course, there's no way for XP's recovery console from years before to know that, so it's useless at this point.

    What did I end up doing?

    Believe it or not, the path of least resistance at this point was to just actually *install* XP to the point where it resets (the second time, to make sure there wasn't any setup-based code in the MBR) and then use the asus recovery disc.

    That's right, it was easiest at that point to install an entire operating system just for 512 damn bytes of fairly generic code that, if I hadn't been shafted at every turn, I could have written in a dozen different ways. 

    ROTTEN.  Rotten rotten rotten.  Waste of hours of my life!

    I don't know whether to blame Asus or Microsoft for the fact that no one bothered to write to the MBR during a full system wipe and restore, but at the least I can blame Asus for going the really irritating route and giving me a recovery disc instead of a full-blown Asus-branded OEM Vista DVD that would have actually been *useful*.

    The moral of the story?

    BACK UP YOUR VISTA MBR BEFORE INSTALLING ANY LINUX DISTRO YOU PLAN ON DUAL-BOOTING.  It might save you a lot of time later. 



  • I bought a G1 last spring.

     

    The first thing I did was reformat the drive and install XP.
     



  • just for the record, installing a regular copy of Vista does write to the MBR.



  • Really?  That's good to know...

    Blaming Asus it is then.  



  • You can install grub onto a floppy disk or USB stick, and use that to boot anything on the drive, then fix the MBR from the booted system. Alternatively, the install media for pretty much any linux-based platform is adequate to the task.



  • Most Linux distributions have a package called "MBR". It's a GPL implementation of the standard PC boot sector.

    AFAIK, it should be available on Knoppix.

    Boot from the CD and type:

    install-mbr /dev/hda


     



  • Sometime ago I had issues with LILO on a dual boot PC.  It was a long time ago... windows was Win 98 SE, can't remember what the linux flavour was.  For some reason, I ran scandisk in windows which "fixed" LILO.  Sadly it didn't write a new MBR.  The result was a PC that got as far as print LI on the screen, then stopped.  Again, a re-install of the OS, which was a nasty Pacard Bell recovery disc did not re-write the MBR and I was still left with a shafted PC.  Thankfully someone at work heard me complaining and pointed me in the direction of FDISK /MBR which I could run becuase I had a dos floppy to boot from.  I hate non-standard recovery discs, credit to Dell that although they charge an extra £6 for media, and you have to ask for it, they do ship a proper OEM windows CD.

    A friend of mine tends to get alot of other peoples PC's to fix.  Normally by doing a re-install.  There was this one PC that had blue screened after windows update installed SP2.  It wouldn't boot into safe mode, and we had no recovery media for it.  It was a hidden partition that you launched from a boot menu.  The recovery software though didn't present the option for a complete re-install,  It had options to repair, and when they failed it suggested you phone tech support on a premium rate number!  After some googling we found that the option for a complete re-install was made available by shift clicking on the dot of an i that was part a company logo, then going to the next page. Argh, WTF?!  If anyone cares the SP2 issue was known and was a registry hack before installing it, why do OEM's do this to us??



  • Grub has a console that AFAIK is capable of booting windows even without menu list... I once on a 98SE(long time ago in the era of dialup and teenaged me) damaged my linux partition beyond repair and without internet managed to boot windows again to search how to fix the boot sector:P I think you had to set root, tell it to chainload +1 and boot.



  • @death said:

    Grub has a console that AFAIK is capable of booting windows even without menu list... I once on a 98SE(long time ago in the era of dialup and teenaged me) damaged my linux partition beyond repair and without internet managed to boot windows again to search how to fix the boot sector:P I think you had to set root, tell it to chainload +1 and boot.

    It doesn't require a menu.lst, but it does require grub section 2. As you can see, the above fails at section 1.5. Which makes sense, of course. If you've installed GNU/Linux on a machine that already has Windows on it, most of grub goes into /boot/grub on your ext partition- which was overwritten :P

    Thankfully, you've still got a grub section 1.5. You could overwrite this with a 1.5 designed for NTFS, and then place the rest of grub on your Windows partition. You know, if you hadn't fixed it already. Adrian15's SGD is also a lifesaver in these sorts of situations.

    As you can tell, I've had some experience with this :) My first Debian installation was corrupted the first time I booted into Windows [maybe it swapped to this disk without checking that there was no NTFS partition there anymore?] and left me a week to learn how to use sh to get my system up again.
     



  • Yeah, one might argue that the real WTF here is the route I took to fix my boot sector, trying to use various windows discs instead of just re-installing GRUB or otherwise using a linux disc to do so.  Touche.  The truth is though, I tend to burn-and-toss with linux, as there are new distros almost as often as I reformat and I just start from a clean ISO every linux install.  Plus, truthfully, I don't think I used the linux partition more than three times since I got this machine...  I'm a .NET developer at this point, and while mono interests me, I haven't played around with it yet.  The only reason I threw it on here initially in this last reformat was to check out what the low-latency pre-emptible kernel in the dedicated ubuntustudio distro could do... which I didn't get much out of because jack didn't want to play particularly nicely with my onyx.  for some reason.  Lots of people are having luck with onyx on freebob (or whatever they've reanamed that to now, FFADO or something...) but no dice for Grant, at least not in the studio where I couldn't get net access to research what the problem was.  So I just never really booted to it.

    Anyway, yeah, didn't have a linux disc lying around and didn't really want to put linux back on right away, or GRUB at all, just wanted to replace my hard drive's boot sector with a standard MS MBR bootstrap.  (Also, my usb stick is lately on the fritz and there's no floppy on this machine, so I would have had to burn yet another disc and it was becoming tiresome.) In hindsight I probably should have just re-installed GRUB and gotten access to the longhorn console that way to repair the boot sector using vista itself, but I wasn't sure that GRUB would even find the vista install in this case given that it wasn't "installed" yet, it was just pre-load files...  Sadly, the lengths I ended up going to seemed the easiest at the time and may actually have been.



  • For those who want to dual-boot an existing Vista installation with a Linux distrubution, the secret is to install GRUB onto your linux boot partition and not into the MBR. Then, boot into Vista and using EasyBCD add an entry for your Linux distribution. You can then multi-boot using the Vista bootloader. I've currently got my home machine triple booting into Vista (my day-to-day OS), XP (for games) and Ubuntu (for specific dev work)

     

     



  • Yeah, that's an option if you think of it (though I don't believe it's an option in the automated Ubuntu installer, you'd have to set it up yourself).  The automated installer does handle the proper GRUB entry for Vista just fine, if you want to write GRUB to the MBR, but you just have to know and remember that you have to restore your MBR FIRST when you're planning on doing a wipe.



  • @misguided said:

    Yeah, that's an option if you think of it (though I don't believe it's an option in the automated Ubuntu installer, you'd have to set it up yourself).  The automated installer does handle the proper GRUB entry for Vista just fine, if you want to write GRUB to the MBR, but you just have to know and remember that you have to restore your MBR FIRST when you're planning on doing a wipe.

    It is perhaps not very insightful to say "You have to replace your bootloader before you erase half of it, or the system won't boot".

    You get exactly the same behaviour if you use the windows bootloader as your first stage, and then erase the windows image. 



  • @asuffield said:

    @misguided said:

    Yeah, that's an option if you think of it (though I don't believe it's an option in the automated Ubuntu installer, you'd have to set it up yourself).  The automated installer does handle the proper GRUB entry for Vista just fine, if you want to write GRUB to the MBR, but you just have to know and remember that you have to restore your MBR FIRST when you're planning on doing a wipe.

    It is perhaps not very insightful to say "You have to replace your bootloader before you erase half of it, or the system won't boot".

    You get exactly the same behaviour if you use the windows bootloader as your first stage, and then erase the windows image. 

     

    Uhm, I'm not sure what you're trying to say here.

    "If you have the stock Microsoft bootstrap code in your MBR, and you delete the partitions from your hard disc, the system won't boot"?  Dude that really isn't what we're talking about here.  The discussion is not of erasing a disc image and expecting the computer to still boot, that's idiotic.  The problem was that Windows users expect it to write the full bootloader when they install Windows, as has always occurred for the last ten or fifteen years.  This recovery dvd did not, possibly partly because Vista's new BCD bootloader takes place mostly in what we'd refer to as the second stage.

    Ordinarily, reformatting the disk or deleting all the partitions or any of that kinda stuff doesn't re-write sector 0.  Reinstalling Windows XP however always writes the windows bootloader regardless of whether or not it's already in the MBR.  Which was the behavior most people expect, and someone said earlier in the thread that this apparently does occur on Vista as well... but not what this recovery dvd and probably a lot of vista recovery dvds do.  Which would have been fine, IF the same disc gave you access to any kind of tool with which you could re-write that bootstrap, but it didn't.  So essentially the "recovery disc" was responsible for "recovering" the laptop into an unusable state and offering no way of fixing it.  The average user who knows just enough to download and install Ubuntu?  They'd have to take the laptop back to the STORE.

    If you IMAGE the entire disk then it should cover the MBR, but that's again not the discussion.

    I'm sorry you don't find my comment insightful, but, uh, same to you.


Log in to reply