Sunday, July 21, 2013

Grub install failure: small embedding area and Flexnet [a virus by any other name...]

I decided to upgrade my work laptop dual-boot (with XP) machine from 12.04 to Saucy just to have a look. What else is there to do when compiling two hours worth of stuff (on another machine, obviously)?

The installer failed at the grub install. Hmm. To be expected I suppose since it still is beta. But, like an idiot I realized this is a dual boot machine, thus grub is required AND I had just wiped my grub files out with the reformat of the old install partition. Icing for the cake: I'm at work without all the resources I have a home i.e. older version of Kubuntu and such. Sigh...

...well at least I still had more than an hour and a half to resolve this. So here's the content of the errors (might be slightly off - memory being what it is and all):

/usr/sbin/grub2-setup: warn: Sector 32 is already in use by FlexNet; avoiding it.
This software may cause boot or other problems in future.
Please ask its authors not to store data in the boot track.

/sbin/grub2-setup: warn: Your embedding area is unusually small. core.img won't fit in it..
/sbin/grub2-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged.. 
/sbin/grub2-setup: error: will not proceed with blocklists.

So it appears I had two issues: Whatever the heck Flexnet is sitting in my boot area and my "embedding" area is too small! That last one kinda hurt my feelings - but that's a different blog.
It seemed that the Flexnet thingy is just a warning, but I didn't like the sound of it. A google or two later and it turns out Flexnet is an "Automated and Optimized License Management for Adobe Products." It seems Adobe has decided your boot sector is just the place to store DRM for their products. Kinda like a professional version of a virus or rootkit - nice. Since I didn't have any Adobe products on my XP install required by my work, it was going to go. IMO, Adobe is up there with Oracle, Symantic, Norton, and a few others as propagators of problem laden bloated software that I just cannot STAND!


It's OK - I'm calm now.

The more serious issue was the apparent lack of space for grub. Seemed very odd as grub (I believe v1.99) had already been working on this machine. Since Flexnet was occupying sector 32 (in part where grub wants to put it's core image) it seems that removing that little bugger would be the beginning and end of this issue - and would have been. 
But as I researched, I read that another contributor to the problem was a common issue among XP formatted hard drives. The first partitions were commonly started at sector 63 - the very first available sector after boot space, leaving just exactly enough room for grub. 

One could surmise that using that absolute minimum space for anything installed isn't a good idea. What if the grub developers add a bit to the core image? I've also read that using LVM and/or RAID will increase your core.img file size as well. 

Common practice of late is to begin your first partition at a MB boundary: sector 2048, so I decided to make that happen. Luckily, the live version of Kubuntu "Saucy" has the needed tools to do this. Also lucky for me, the first partition of this Dell laptop is the Dell recovery and was a mostly empty fat32 partition. KDEpartitionmanager, a "shrink and move right" later and I had the partitioning where I wanted it.

Now on to the
Adobe Exorcism!  

Again: not too difficult. Using dd I backed up my partition table, wiped the entire MBR area, put the partition table back, ran grub-install: done. No errors or warnings and still and hour left. Enough time for lunch!

For those interested, here's the dd commands that do the above:

Backup MBR and partition table: 
sudo dd if=/dev/sda of=/tmp/mbr.img bs=512 count=1

Wipeout the previous MBR and following 62 sectors:
sudo dd if=/dev/zero of=/dev/sda bs=512 count=63

Restore just partition table: 
sudo dd if=/tmp/mbr.img of=/dev/sda bs=1 count=64 skip=446
**NOTE ABOUT USING DD** dd can and will (if improperly used) destroy your data. Use with care!

Grub errors: "File Not Found" repeated three times

The subject says it all: 
Grub error:
File Not Found...
File Not Found...
File Not Found...

press any key to continue.
If you've read any of my other threads, you might know that I have a slightly complicated setup - multi-boot with grub stanzas pointed at each install's own grub.cfg. This means I sort-of leaf through multiple grub.cfg's once in awhile but usually I let the defaults do their thing and I end up here - my 13.04 Kubuntu install. 

The above error would obviously stall the boot process and otherwise annoy me so it was high time to fix it. Web searches revealed similar errors having to do with missing localization files (Arch forum) but 2009 vintage reports. Nothing newer or on point.

So I dug in.

The error would happen on the second grub.cfg page - namely the one belonging to Kubuntu 13.04 - so that's where I started. I scrolled through grub.cfg and almost immediately noticed this paragraph:
Code:
function load_video {  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}
I knew these commands were supposed to load modules and if a module was missing, might these not produce the above error? Also what stuck out to me is I don't have a efi computer - old BIOS here - so why would I need to load efi_foo? So I scanned the contents of grub's folder and sure enough, no efi_gop.mod or efi_uga.mod. All the others were there except ieee1275_fb.mod. So three missing files and three missing file errors: made sense.

For a test, I commented out the three lines in my grub.cfg (I know - not a permanent fix - keep reading...) and re-booted. No errors

So how to make this permanent (...see)? I found these insmod commands came from /etc/grub.d/00_header so I commented them out (added # to each line at the beginning), ran update-grub: Success!

Now this isn't a very elegant fix, but it works. My 00_header file isn't going on any other computers so I don't need elegant - just functional.

I reported this here just in case someone else has encountered this and needs a fix. Have a nice day and thanks for reading 

Operating Systems: Why Linux?

Anyone who talks about computers with me knows I use, love, and advocate linux (notice not capitalized!) over any version of Windows (TM). I'm speaking as a regular desktop user, not a systems administrator or commercial user. That is to say; we use our computers to look at photos, surf the net, listen to music, watch videos, email, write letters, maybe even chat or talk - but not to make a living. Let the debate begin...

Why not Apple?
OS/X is indeed at great operating system. It's so much like linux that I can tinker with it with ease (and break it with ease!). OS/X is a great OS that runs only on very expensive hardware. Apple laptops are very pretty and well made, but are they better than HP's or Dell's? Maybe - but not two or three times better, which is how they're priced. Three times better would mean three times faster, three times more applications, three times more productivity, and three times (fill in your personal favorite). Apple computers are simply not worth the extra money, period.

What's wrong with Windows?
DISCLAMIER: I have not yet had any Windows 7 experience - I hear nice things, but I'll believe it when I see it.
I have been using Windows since version 3.3. A version that most of you didn't even know ever existed I bet. But the real version we are all most familiar with is XP. 98 was pretty good, but XP was much better than it's predecessors. Vista simply failed and I don't think anyone can refute that. Vista failed so bad that Microsoft brought back XP by updating it with service pack three - a move they hadn't intended on doing.

So let's compare XP to linux (any flavor)...

1. Cost
This is easy and undebatable. Almost any version and type of linux is free from cost. Totally free. If you want to you can buy commercially packaged version from a few vendors and get "offical" packages (programs and updates) and support. But even those versions of linux are also available as a free download, albeit without the include support or the pretty box. Also, none of the home versions cost anywhere near as much as XP. Usually less than 25% as much. I have paid for some versions of linux in the past and even donated to some of the free ones that I felt deserved it and I used regularly. If you have a slow internet connection or don't like to download and burn your own CD's, you can get any of the free linux distributions on CDROM for $2 to $5 from several sources via mail.

By the way - Did you know that your computer costs more than it should because Microsoft forces vendors to install and sell their OS or they won't support their hardware? No wonder the European union has sued MS over and over again. Too bad our politicians are afraid of taking on such a huge corporation. Remember MaBell? Isn't it time to break up Microsoft? A few vendors - notably Dell and now HP - have started selling machines without Windows and installed linux instead, but not with a lot of support or fanfare. I'm willing to bet Microsoft has dictated terms and pricing to those vendors as well (just an opinion!).

And not only is linux free - so are almost ALL of the applications. That's right! I edit photos, copy DVD's and CD's, email and chat, print letters, watch movies, and much much more ALL FOR FREE. Again, there are commercial versions of some applications and I have paid for one or two (VueScan is one example). But all or almost all have free version available or at least a free alternative. Windows Vista Home Basic wouldn't even play DVD's without additional un-free software.

2. Freedom
Linux is free. Not only free as in cost, but free as in license. I can download, copy, install, modify, give away, and use linux whenever, whenever, and with whomever I like without a corporation breathing down my neck or making me pay for upgrades or threatening me with lawsuits. No secret code to enter and no "Windows Genuine Advantage". What are great name for what is essentially a digital watchdog to make sure you're behaving legally (in Microsoft's view). Too bad we can't have a program that notifies us when Microsoft behaves illegally or immorally. There are things we use in linux that are not free from licensing - video codecs and such - but there are usually free options for those of you that wish to remain licensing free.

Windows Vista is loaded with DRM (Digital Rights Management) that causes all kinds of issues from hardware malfunctions to excessive memory and CPU use. An example for this copy protection technology for HD-DVD and Blu-ray disks. High-quality audio and video output is reserved for protected peripheral devices. This means artificial degradation of the output quality. Linux has the ability to play these and other formats without artificial rules and requirements. Imagine, getting to play a DVD you bought the way you want. Seems like that should be a given, not a special treat.

3. SecurityLinux - any version - is so more secure than Windows there aren't really any anti-virus programs in use. There are a couple of anti-virus programs for linux that remove viruses from Windows installs and emails, but they simply aren't needed by the casual desktop user. Are there occasion security issues? Of course, but these are publicly documented and therefore fixed as soon as humanly possible. In the Microsoft world - these holes are kept secret which means only a select few (like hackers and virus writers) know about them and can therefore exploit them. Even if a hacker managed to gain access to my network they couldn't do much without my personal passwords. I will say one final thing about this issue: In six years as linux as my primary desktop operating system I have not had even one virus, spyware, adware or any other form of malicious software. I can't add anything else, nor do I need to.

4. Hardware Requirements
Each new version of Windows requires more and more memory and better, faster CPU's. It actually seems as though Microsoft and the PC makers are in collusion with each other to keep you trapped in an endless cycle of
upgrading. Almost any current version of linux will run on any old 386 computer with 256mb ram and 2gb's of hard drive space. Try that with XP! If you want Vista or Windows 7 to work you'd better have at least a Pentium4 and 1gb ram plus at least 64mb of video ram and 8gb of hard drive space. Obviously linux works better with more resources just like Windows, but nothing will speed up that old desktop or laptop like a properly installed and configured linux install. The next time you're thinking about upgrading your PC, try installing linux on it first. You might be pleasantly surprised.

5. Usability
Finally an area we can debate over! Usability may be too subjective to boil it down to one single right or wrong opinion. What do you use your computers for? How are those uses impacted by our choice of operating systems? What is the most important area or type of usability? I can guarantee a teenage video game junky, a middle-aged businessman, a stay-at-home parent, and a tech-y computer geek will answer all those questions differently.

Just as in the reverse noted above - where linux suffers, Windows shines. Some types of hardware are not well or fully supported in linux. This is usually because hardware developers are secretive about their designs and have the right to be, so they don't release their drivers to the public. I think in this day and age they would be better off if they did, but I don't own one of those companies so who cares what I think about it. Any hardcore video gamer will tell you he needs Windows. He also needs a lot of RAM, a huge hard drive, a big monitor, a powerful CPU and video card and a very large power supply to run it all.

So what is the final answer?
In my opinion: Unless you have the need for a very specific program that there is no viable alternative, linux is really the only choice. It's free to use, free from artificial restrictions, free from viruses and malware (mostly), runs very well on older, cheaper hardware and can do just about everything Windows can and better, faster, and safer.


What are you waiting for?