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?

Thursday, November 12, 2009

The "Perfect" linux install setup for noobs

First of all let me say: "Perfect" is totally subjective - so take everything here with a grain of salt...

One of the objectives of switching to linux is to have a more usable, more secure, and more robust (read "dependable") system. Protecting your data and the usability of your system is paramount to this objective.

This article is a beginner's lesson about partitioning and formating your hard drive to facilitate the protection of your data and system. Please note these same issues exist with Windows installs, just these no simple way to do this with Windows.

Possible failures or issues include:
  • hardware failure of a drive
  • software upgrade or install "breaking" your system
  • user error causing system to be unusable or un-bootable
  • a runaway or failed process filling up your hard drive
Options to protect oneself from these failures:
  • multiple installs of operating system
  • multiple hard drives
  • space available for data backups and/or redundancy
One of the first things new linux users notice is how little space is occupied by linux and it's software. You can easily have a fully functional system in 2gb. Obviously, graphically intense programs or video editing and such will require much more space than that. Another wonderful feature of linux is it was intended from the beginning to effectively utilize whatever resourses were available to it. In modern computers, this evolves into easily adding or subtracting drives, partitions, and even network space to and from the system with relative ease. Available to you are LVM (Large Volume Management), RAID (Redundant Array of Inexpensive Disks), and various network tools. For this article I will only address "local" (installed on the host computer) drives and their partitions.

What linux needs and what you need:
Linux installs can use free drive space to "swap" memory to disk if you exceed your physical memory and/or as storage for hibernation or sleep mode. The generally accepted amount is no more than double the physical memory installed in your computer. I think in some higher end desktop systems, those with 4gb or more RAM, you can safely use less or even no swap at all. Swap usually exists on it's own partition and tends to be a bit faster if it's the first partition the drive.

Rather than the Windows scheme of drive letters; Linux uses a simple subdirectory system to organize it files. Files are group by purpose into these subdirectories. One benefit to this approach is the ease in which some of these subdirectories can be relocated to a new partition, drive, or even off-system to expand your usable space without requiring a total reinstall. This system also allows you to backup your personal data or your entire install with relative ease.

Linux also allows itself to be installed and run from any partition. This feature makes backups and re-installs much easier. You may also install linux along side other linux or even a Windows install without issue - however, the details of this type of setup are not discussed here. There are dozens of web pages on how to do that.

Subdirectories addressed in this section:
/ contains the operating system install
/home contains all your personal data and settings
/tmp contains temporary files
swap as discussed above

The optimal install has two drives for redundancy, backup and speed purposes but lets address a single drive setup first since that's what most of you have. In this example I assume you have one 80gb hard drive and 1gb of RAM (an older or inexpensive computer to be sure).

Hard drives and their partitions are "named" in linux parlance by their interface type, drive letter and then finally partition number and referred to as devices. Modern and common drive interfaces are SATA, SCSI and IDE. Most modern linux distributions simplify the naming scheme somewhat by lettering all these interfaces as "s" for SCSI. Older distributions may refer to the IDE interface as "h" for "hard drive."

You may have up to four primary partitions (just like Windows), one of these may be an extended partition which holds logical partitions, and up to 63 logical partitions in your extended partition.

So, your first sata drive is "a" (usually first drive on the interface but occasionally the drive you booted to if not the first) and your primary partitions are numbered 1 through 4. Logical partitions begin at 5 and go up in number from there. Note that logical drive numbering will begin at 5, reserving 1-4 for primary partitions, regardless of how many primary partitions you have.

Since hard drives are "devices" to linux, these will be referred to as "/dev/sda1" and so on.

Most linux install programs will default to a single partition install for simplicity for the beginner. Some will ask if you want a swap partition or maybe even offer other options. Almost all offer an "Advanced" option allowing you to create your own partition setup. This is what we want to do.

On to the setup:
One 80gb drive, device names, partition numbers, their use, and their size.
Primary partitions:
/dev/sda1 partition 1 swap 2gb
/dev/sda2 partition 2 extended 78gb
Logical partitions
/dev/sda5 partition 5 /tmp 10gb
/dev/sda6 partition 6 / 8gb
/dev/sda7 partition 7 /home 26gb
/dev/sda8 partition 8 backup of /dev/sda6 8gb
/dev/sda9 partition 9 backup of /dev/sda7 26gb

By partitioning your drive this way, you can have two installed operation systems - partitions 6 and 8, all full backup of your data and settings - partitions 7 and 9, and if you fill up the /tmp directory somehow you will still be able to boot your system without issues. Note: a single drive setup cannot protect you from a hard drive crash. If you were to later add a second drive to the above setup, you could "move" the backup partitions to the new drive and have full redundancy.

Two 80gb drives, device names, partition numbers, their use, and their size.
Primary partitions drive 1:
/dev/sda1 partition 1 swap 1gb
/dev/sda2 partition 2 extended 79gb
Logical partitions
/dev/sda5 partition 5 /tmp 20gb
/dev/sda6 partition 6 / 12gb
/dev/sda7 partition 7 backup of /dev/sdb2 47gb

Primary partitions drive 2:
/dev/sdb1 partition 1 swap 1gb
/dev/sdb2 partition 2 extended 79gb
Logical partitions
/dev/sdb5 partition 5 unused 20gb
/dev/sdb5 partition 6 backup of /dev/sda6 12gb
/dev/sdb5 partition 7 /home 47gb

Notice here we moved the /home and / directories to different drives. This may result in a slight improvement in system speed during file access. Also notice we left partiton 5 on drive 2 unused. With this much space, it's unlikely you'd need this space anyway so it's saved for future expansion. You can use it to store music or downloaded files or leave it to install a new linux distro to that you want to try out before you let it take over your system. Obviously we have more space for everything here. Having multiple swap partitions will allow your system to use both drives when needed and it's a bit faster than a single swap.

Should your installed software grow beyond the 12gb allowed, shrink or repartition your /home or /tmp and allow your system to use the space for /usr/share/local or /opt to free up space on /. This is easier than it sounds and most distros have tools (partition managers) that can assist you in doing so.

Friday, November 6, 2009

Introduction

I'm not busy enough so I'd thought I find one more thing to waste time on.