Linux Made Me Feel Stupid Again Today…

by Paul Sherman on July 11, 2006 · Comments

in Everything Else

Regular readers of UsabilityBlog (now *that’s* an amusing concept…) know of my recent struggles with Linux. Not content to leave bad enough alone, I decided to try fixing a nagging little annoyance on my (now) dual-boot Ubuntu/Windows desktop.

I shouldn’t have bothered.

As you propeller-heads know, when you install Linux on the same hard drive as a Windows installation, Linux thoughtfully resizes the Windows partition, and creates two of its own on the hard drive – one for the swap file, and one for the mount point and file system. It also installs a boot loader. From gnu.org/software/grub:

A boot loader is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the operating system .

If there is another OS present on the system, the boot loader offers it as an option at boot time. When my computer starts, the boot loader presents me with a list of operating systems: Ubuntu, Ubuntu safe mode, and Windows XP. Ubuntu is the default. Which means that if I want to start Windows, I can’t just press the “On” button and walk away to get a cup of coffee. I have to sit there while the machine POSTs and the boot loader starts. Then I have to press the down arrow twice, and press enter to start Windows. If I’m inattentive or not present, it boots to Linux. In all, it claims about 30 seconds of my life; 30 seconds during which I’d rather be doing something else.

Since I’m in Windows more than I’m in Linux; I wanted to change the default so that Windows loaded if the boot loader received no user input. Simple enough, right?

Wrong.

Some Linux distributions provide a means to do this via a GUI-based program; but Ubuntu (as far as I can tell) doesn’t. I searched the unimaginatively copied-from-Windows “start” menu, and couldn’t find it in any of the (multiple) system settings GUI apps. So I googled something like “Ubuntu” and “change boot loader default”, and found what appeared to be some helpful FAQ pages.

The FAQ indicated that the Ubuntu user wishing to change the boot loader default smiply had to edit a text file containing the operating system menu options. So I opened up a file manager window in Linux, found the file, and selected “Open with [text editor]” from the menu bar.

The text editor launched and displayed the file. I quickly found the line I was supposed to edit. I made the edit. And pressed “Save”. Guess what happened? A dialog displayed, telling me that the file was read-only, and I don’t have the appropriate permissions to edit the file.

Now, I remember from a long-ago Unix class that it’s possible to give your Unix account “superuser” privileges if needed. And I also kinda remember that it was the “su” command.

So, I opened up a command line window and typed “su.” The system prompt said “Password:” So I typed in my password and pressed enter. The system thought for about a half-second, then displayed a command prompt, this time with the word “root” prepended to the prompt. So I’m thinking I’m golden. I have superuser privileges and can edit that file, right?

Wrong again.

I opened the file in the text editor, made the change, and tried to save it. Same smarmy message.

So thank you, Linux, for trashing my geek cred and making me feel stupid, all before my second cup of coffee.

  • Snarkster
    To get to superuser when logged in as your normla user. just open terminal and type su - this makes you really superuser. with out the - you arent using the superuser path. Its important.

    Once you are sitting at the root@~ prompt (or what ever pwd tells you) then start vi /etc/grub/grub.conf
    hit the insert button
    edit changes
    press esc
    type :wq
    hit enter
    and your done, file is edited and your good to go.

    look me up on freenode irc snarkster is my name..

    see ya round
  • When you logged in as root in the command window, you made it so that command window was running a session using the root login. However, the rest of your system was logged in using your normal user name, which does not have "root" privileges. So, if you open a text editor using the menuing system, then that instance of the editor is running using your normal login, not root. Hence, the editor will not be able to store a file the GRUB "menu.lst" file (I think this is what you're trying to edit, right?).


    What you need to do is invoke the editor from within the command window where you are logged in as root. If your editor is gedit, you can do this by typing the following at the comand line:


    gedit &


    Before you actually change "menu.lst" I recommend making a back-up copy of the current version by going to the correct directory within your command window where you're logged in as root and entering something like:


    cp menu.lst menu.lst_ok


    You probably knew the command, but the point is it has to be done within the command window where you've changed your user to root.


    Ubuntu also provides an alternative approach for opening an editor with "root"/superuser privileges:


    open a command/terminal window
    execute: "sudo gedit"
    enter your password


    This runs a session of the gedit editor as user "root".
blog comments powered by Disqus

Previous post:

Next post: