Pages

Showing posts with label Operating Systems. Show all posts
Showing posts with label Operating Systems. Show all posts

Friday, April 22, 2011

Operating System Frustrations

Warning: The following post is my expression of some frustrations with a certain OS, with some contrasting examples from a different OS; I'm mostly writing it to vent, and figure it might be interesting to some readers. If you are apt to take OS stuff personally and/or feel like defending/criticizing one of the OS's involved, please skip this post.

I recently resurrected my old desktop machine, with a combination of Windows 7 and Ubuntu 10.10 (dual-boot). The big change from my old desktop was replacing the Win XP that's been my choice for gaming ever since it came out. I hadn't had a Linux distro in use in a while (since my laptop is OS X, it fulfills my need for a programming machine), but figured I should try one of the new ones after messing around with some Linux Live CD's for L's little netbook and seeing how nice they were. [Live CD: it's a CD which can be booted as a full fledged operating system, many of these can also be used to install said OS to a hard drive if you like how it works. They're fun to try out, with no risk (unlike purchasing a new Mac OS or Windows version).]

Let me say right now, my experience with the new install of both OS's were great. Up to a point, where one plummeted like a rock, while the other kept improving. I doubt that this will be a surprise that the rock was Win 7, while Ubuntu just got better.

The point in question was when one of my hard drives started dying; coincidentally the one which had the MBR (Master Boot Record, it's how the computer knows how to start up an OS) and was first in the HD chain [important for Windows, Linux could care less afaik]. This drive was a legacy from my old setup, and had been replaced with a new hard drive; it had no OS partitions and nothing except old data (which had been copied to the new drive + backups). Until it was acting flaky it was more trouble to just remove it, in retrospect I think it would probably have led to the exact same mess as having it die did.

Well, the drive died about a week ago and neither OS would boot from the remaining hard drive, as there was no MBR even though both OS's were installed there. I thought to myself:  "Drat, now I have to grab the Linux Live CD / Windows Repair disk to repair my dual boot stuff, that'll take maybe an hour one evening to sort it all out." I finally got around to spending that hour. All good repair jobs start with a web search to find someone who's solved the problem already. I try a search for MBR fixes for the Windows side, but get nothing on an official site, just lots of forums and tech help sites, so I try a search on the Ubuntu side and immediately get an official Wiki page (conveniently titled Recovering Ubuntu After Installing Windows), it appears to have a pretty simple set of instructions for fixing a lost MBR, which boiled down to these four steps:

1. Boot the Ubuntu Live CD.
2. Check what version of GRUB you were previously using [Grub is a boot loader; it's what the MBR can be sent to, to allow the user a choice as to which operating system or tool they want booted], and find the hard drive partition that had your linux install. [This boils down to clicking on the hard drive in your list of partitions in the "Places" menu, and checking to see which one of two files is in a certain directory there]
3. Run one command on the command line, using the information found in step 2 to tell it which hard drive and what partition it needed to update.
4. Reboot.

(Details for those curious at the link, above; it took me about a minute to do steps 2-4, most of the time was me misreading grub.cfg as being the Grub Legacy config file and being very confused as I was 99% certain I had Grub2 installed. Yes, it uses the command line; I think I saw a nice graphical app that does it too, but I didn't want to bother since it was simple.)

Bonus info on the Ubuntu webpage: how to get your Windows install to show up on boot in the Grub menu. Win! I may only have to do a single repair and have both OS's up and running.

Great, I stick in the Ubuntu Live CD and boot that, get distracted web surfing for a bit [on that computer!], load up the Ubuntu wiki page I had been reading and copy/paste most of the steps. It completes and says it worked, so I reboot. Yep, sure did, there's my nice boot menu again, and I boot up Ubuntu to check that it works and it did; all my normal settings and programs are there, data looks fine, etc.

Ok, that was easy; now to test the windows side. Reboot, try the Windows 7 entry that the update added to the boot menu. Hey, it's the correct Windows partition to boot. How do I know that? Because it complained about a missing BOOTMGR and refused to boot. (also, there are only 3 partitions on the drive; Win 7 OS, Linux OS, and a huge storage partition) Anyways, I think it's got some sort of love attachment with the old hard drive and really misses it. I try to tell the OS that the hard drive is still around, it's even still in the case, just it ain't plugged in because if it was it'd make horrible scraping noises and nothing would work.

Anyways, at least I have an error message, and a search turns up more forum pages, but they look more relevant than the last set  (none of the 1st page of results were Microsoft though); paring through all that data I find that the best way to fix this issue is to load up the Win 7 install disk and use the repair function. Great, that will be simple. I boot the disc, click 'startup repair' as instructed, it chugs for a bit, I check the log and hey, it says it fixed a MBR issue. Perfect, that's what I needed fixed.

It does the reboot thing and hey, the boot menu entry for windows has been removed. That's odd, it should have auto-detected it just fine like it did previously. Maybe Linux borked it. Very bad, no cookie. Try the same update I did before to get it to add the Windows partition. No luck. Examine the full drive info, the partitions are all there just fine it just looks like... the Windows 'repair' completely borked the Windows partition's bootable flags so it's not even registering to anyone as being valid a valid choice to boot. Ok, another Ubuntu wiki link later and I try adding a custom boot entry to Grub that will go to the Windows partition (and flag it bootable as needed).  That takes a few minutes, but I have it back in the boot menu and what do you know, BOOTMGR is still missing.

At this point I'm wondering why I'm even bothering; all my data is ok as I can mount windows partitions in linux trivially (but not vice versa) and get the very limited, mostly non-Steam game save data off those partitions. Oh right, games is why I had the Win 7 stuff in the first place. Ok, might as well try the Windows repair again.

Why do I think the repair might work this time? Well, the websites did say that sometimes it just doesn't work the first time and you should reboot and run it again. I'm not kidding, that's what it recommends; many user comments saying hey, it failed but after the next repair boot it worked!)

Ok, Windows CD loads again. At this point I should mention that I kept getting bored while the repair CD booted. To diverge for a second, I eventually decided to measure the repair CD boot times [that was after boot #8 of that CD]. No wonder I got bored; it was taking five minutes to go from detecting hard drives (which is all BIOS, e.g. before the OS starts to load) to when I actually got to anything looking like a menu that needed input.

Ok, repair (it fixed a MBR record, I note dubiously), reboot... hmm, that's funny, it should boot off the hard drive first, but now it's going straight to CD. Oh joy, it trashed the entire MBR so the drive isn't even bootable now. This is roughly equivalent to my starting state after the drive died.

Wash, rinse, repeat with the Windows Repair. Try again, using the helpful 'command line' bootrec /fixboot and other stuff mentioned on the forums. Drive's still not bootable, my only available diagnostic on the Windows Repair CD (bootrec) has four options. Three of them fail with the same cryptic error, and the last, a pure diagnostic rather than actual repair tool, says I have a Windows install on C:. No ****, Sherlock, that's what I want you to make bootable!

Ok, my patience is shot for the Windows Repair. [I'm now up to try #8 or so]. Reboot time.

2m, 15s later, I am back in a Ubuntu linux desktop, with working network, web browser, etc. Ready to fix the MBR issue, again. No, that's not my hard drive install, it's the Live CD I'm going to use to repair my install; Yes, it's already fully functional at this point and I can program, read web pages, etc. I don't really need to repair the MBR, I just prefer running it off the hard drive as some things are smoother.

I reassure myself that I don't have to click on the repair startup button anymore, or look at a mangled graphical interface with a joke of a command line. In fact, I go read web comics just because I can, and I probably need the relaxation.

Back to the MBR fixing again. Load up the nice Ubuntu webpage I used last time, follow the steps, this time taking much less time (30s?).  Nice, it says it had no issues and we're good. Reboot time.

Hard drives spin up, boot starts and there's my boot menu back again (pretty much instant after the hard drive pause). 21.5s later and I'm at my Ubuntu linux login screen. One password and 10s later, I'm at my desktop and good to go.

Some final thoughts and other notes:

I like it when a repair that says it worked actually works. Also, I don't expect snappiness from a CD boot, but I also don't want to wait 2x as long to get something I can't even use except to attempt at a repair that's likely going to need another long boot anyways.

For reference, the times mentioned above were 5m for the Windows Repair disk to reach the first menu, 2m 15s for the Ubuntu Live CD to reach the first menu (about 15s more to reach a fully functional desktop, if you wanted one), 20.5s for the Ubuntu HD install to reach the User Login screen, and another 10 for it to actually be on the desktop, ready to use.

Yes, I know Win 7 boots pretty fast too; I was liking that back when it worked. I'd time the hard drive boot for it, *IF IT WORKED*. I'm sure it'd be competitive.

If you time the same events, it's likely to vary from my times so don't complain to me; I don't want to hear it. The desktop in question is on the order of 5+ years old (it's using an Athlon 64 3800, single core), and runs Linux great. Win 7 for most tasks ran great as well; some games were CPU-bound (the graphics card is pretty new, so it made up for many deficiencies in some games). Also, I know there are super fast booting Linux Live CD's. I was using my Ubuntu 10.10 Live CD (that can also be used as a full fledged install CD) as it's what I had on hand. The Windows 7 CD was the equivalent Windows Install/Repair CD. [I've also used a Knoppix Live CD in the past, and it's very snappy as it was designed to be a used as a LiveCD only, never needing a hard drive install.]

Comment policy for this post:    Comments welcome, but I'll repeat what I said at the start: defensive or critical comments about either OS aren't welcome. Commiserating is ok; as are similar stories about OS troubles (in any direction) as long as they're personal experience.

Flamewar inciting is not welcome; both OS's have their place, and Win 7 certainly ran nicely when it worked; for anything resembling my own work [e.g. research and programming] my preference has always been Linux or Mac OS X, and my preference for gaming is rapidly moving towards OS X, just there are many games that are non-existant on that platform.

Comments re: possible fixes are also welcome, but at this point it's not been worth the startup cost for me to try the repair CD after spending nearly the original 1 hr estimate in waiting for it to boot all those times. If you know a way to fix it via Linux that'd be ideal, otherwise I likely will just wipe the partition and do a fresh reinstall the next time I have several more hours to spend.

Errors in spelling, typos and grammer are all mine; see my previous policy on correcting those. I already did one full edit of this post to make it flow better, so anything left in there I really don't feel like fixing.

That said, if some of my story is too technical for whoever reads this, feel free to ask questions; I'd be happy to help people learn more about these topics, and tried to make it at least somewhat approachable! :)

Hopefully the above post was entertaining to someone; should you have problems with boot records or OS dual boot installs or the like, feel free to ask me for help; at this point I should have something to show for banging my head against the problem all evening. Similarly, if you want to try a Linux Live CD, I have tried two recently and they are very usable and can give recommendations or help out if needed.