Front page
Archive
Silflay Hraka?


Bigwig is a systems administrator at a public university
Hrairoo is the proprietor of a quality used bookstore
Kehaar is.
Woundwort is a professor of counseling at a private university

The Hraka RSS feed

Email
bigwig AT nc.rr.com

Friends of Hraka
InstaPundit
Daily Pundit
cut on the bias
Meryl Yourish
This Blog Is Full Of Crap
Winds of Change
A Small Victory
Silent Running
Dr. Weevil
Little Green Footballs
ColdFury
Oceanguy
Fragments from Floyd
VodkaPundit
Allah
The Feces Flinging Monkey
Dean's World
Little Tiny Lies
The Redsugar Muse
Sperari
Natalie Solent
From the Mrs.
ErosBlog
The Anti-Idiotarian Rottweiler
On the Third Hand
Public Nuisance
Not a Fish
Rantburg
AMCGLTD
WeckUpToThees!
Electric Venom
Skippy, The Bush Kangaroo
Common Sense and Wonder
Neither Here Nor There
Wizbang!
Bogieblog
ObscuroRant
RocketJones
The Greatest Jeneration
Ravenwolf
Ipse Dixit
TarHeelPundit
Blog On the Run
blogatron
Redwood Dragon
Notables
Greeblie Blog
Have A Cuppa Tea
A Dog's Life
IMAO
Zonitics.com
Iberian Notes
Midwest Conservative Journal
A Voyage to Arcturus
HokiePundit
Trojan Horseshoes
In Context
dcthornton.blog
The People's Republic of Seabrook
Country Store
Blog Critics
Chicago Boyz
Hippy Hill News
Kyle Still Free Press
The Devil's Excrement
The Fat Guy
War Liberal
Assume the Position
Balloon Juice
Iron Pen In A Velvet Glove
IsraPundit
Freedom Lives
Where Worlds Collide
Knot by Numbers
How Appealing
South Knox Bubba
Heretical Ideas
The Kitchen Cabinet
Dustbury.com
tonecluster
Bo Cowgill
mtpolitics.net
Raving Atheist
The Short Strange Trip
Shark Blog
Hoplites
Jimspot
Ron Bailey's Weblog
Cornfield Commentary
Testify!
Northwest Notes
pseudorandom
The Blog from the Core
Ain'tNoBadDude
CroMagnon
The Talking Dog
WTF Is It Now??
Blue Streak
Smarter Harper's Index
nikita demosthenes
Bloviating Inanities
Sneakeasy's Joint
Ravenwood's Universe
The Eleven Day Empire
World Wide Rant
All American
Pdawwg
The Rant
The Johnny Bacardi Show
The Head Heeb
Viking Pundit
Mercurial
Oscar Jr. Was Here
Just Some Poor Schmuck
Katy & Bruce Loebrich
But How's The Coffee?
Roscoe Ellis
Foolsblog
Sasha Castel
Dodgeblogium
Susskins Central Dispatch
DoggerelPundit
Josh Heit
Attaboy
Aaron's Rantblog
MojoMark
As I was saying...
Blog O' Dob
Dr. Frank's Blogs Of War
Betsy's Page
A Knob for Brightness
Fresh Bilge
The Politburo Diktat
Drumwaster's rants
Curt's Page
The Razor
An Unsealed Room
The Legal Bean
Helloooo chapter two!
As I Was Saying...
SkeptiLog AGOG!
Tong family blog
Vox Beth
Velociblog
I was thinking
Judicious Asininity
This Woman's Work
Fragrant Lotus
DaGoddess
Single Southern Guy
Caerdroia
GrahamLester.Com
Jay Solo's Verbosity
TacJammer
Snooze Button Dreams
Horologium
You Big Mouth, You!
From the Inside looking Out
Night of the Lepus
No Watermelons Allowed
From The Inside Looking Out
Lies, Damn Lies, and Statistics
Suburban Blight
Aimless
The SmarterCop
Dog of Flanders
From Behind the Wall of Sleep
Beaker's Corner
Bad State of Gruntledness
Who Tends The Fires
Granny Rant
Elegance Against Ignorance
Moxie.nu
Eccentricity
Say What?
Blown Fuse
Wait 'til Next Year
The Pryhills
The Whomping Willow
The National Debate
The Skeptician
Zach Everson
MonkeyWatch
Geekward Ho
Argghhh!!!
Life in New Orleans
Rotten Miracles
Fringe
The Biomes Blog
illinigirl
See What You Share
Truthprobe
Blog d’Elisson
Your Philosophy Sucks
Watauga Rambler
Socialized Medicine
Consternations
Verging on Pertinence
Read My Lips
ambivablog
Soccerdad
The Flannel Avenger
Butch Howard's WebLog
Castle Argghhh!
Andrew Hofer
kschlenker.com
Moron Abroad
White Pebble
Darn Floor
Wizblog
tweedler
Pajama Pundits
BabyTrollBlog
Cadmusings
Goddess Training 101
A & W
Medical Madhouse
Slowly Going Sane
The Oubliette
American Future
Right Side Redux
See The Donkey
Newbie Trucker
The Right Scale
Running Scared
Ramblings Journal
Focus On Reality
Wyatt's Torch

December 01, 2003

Modifying The grub.conf For Serial Output On A Headless Red Hat Server

I know, I know. Might as well be typing with rocks in my hands for all the sense that title makes. I would skip describing the grub modification process entirely if I hadn't spent most of the day on it. Also, I have to write documentation on what I've done anyway. May as well kill two birds with one stone.

Grub, like far too many other things in the computing world, is an acronym, standing for Grand Unified Boot Loader. Boot loaders are programs designed to do one thing--hand over control of the computer to the operating system from the BIOS after the machine has been started. "Grand Unified" means that this particular boot loader can load a number of different operating systems; Windows, Linux, DOS--whatever you like. How it behaves when it is called during the startup procedure is determined by a text file called the grub.conf--conf being short for "configuration" in this case. More on that later.

A "Headless Red Hat Server" is unfortunately not a evil computer of death, riding down the more timid computers at night on a black horse and tossing flaming pumpkins at them. Instead, a "Headless" computer is one that lacks a monitor (or TV, as my daughter refers to it). All of our servers are headless. Monitors take up space, and space is at a premium in the UNC machine room.

The problem with headless machines is that a lot of what would normally appear on a monitor, especially during startup, cannot be seen unless a sysadmin drags the emergency monitor over to the machine in question and plugs it in.

This would require the sysadmin in question to not only brave the Arctic chill of the machine room, but to get up out of his chair in the first place. Might as well dig ditches for a living, if it's come to that. It's easier, theoretically, to redirect what would normally appear on the monitor screen and instead make it appear on another monitor, one conveniently closer to the systems administrator. That's what "Serial Output" does.

So in essence what I want to do is tell the computer that, come startup, send what would normally appear on the monitor screen, had it a monitor screen, somewhere else. Sadly, this is more complicated than it sounds, which is why any sysadmin worth his salt will describe it as "Modifying The grub.conf For Serial Output On A Headless Red Hat Server" instead. As a process description it sounds far more complicated than the layman's translation above--good for job protection in these parlous economic times. It also makes people who only have a vague idea of what you are doing nod their heads and go away.

So far, so good. The tricky bit comes when one actually has to make it happen. Remember, Grub is the critical middleman between the BIOS and the operating system. Misconfigure or break it, and not only will bad things happen, they will be very hard to fix. Both "getting up out of the chair" and "braving the Arctic air of the server room" will be required. "Boss thinking you a dumbass and mentally calculating the cost of replacing you" is also a distinct possibility.

I know this from experience. I slogged my way through rescue disks and emergency consoles aplenty on the way to the promised land of milk, honey, and Serial Outputs.

I could also have read the documentation, but really, where's the fun in that?

Here's a default instance of a grub.conf--lines that start with a "#" are commentary, ignored by the computer when the file is read just after startup.

-------------

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
default=0
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Red Hat Linux (2.4.9-31smp)
root (hd0,0)
kernel /boot/vmlinuz-2.4.9-31smp ro root=/dev/md1
initrd /boot/initrd-2.4.9-31smp.img

title Red Hat Linux-up (2.4.9-31)
root (hd0,0)
kernel /boot/vmlinuz-2.4.9-31 ro root=/dev/md1
initrd /boot/initrd-2.4.9-31.img

-------------

On the assumption that only sysadmins have bothered to read this far anyway, I won't explain everything in the above. It also saves me from having to point out that I only have a rudimentary understanding of it in the first place.

Here's what the grub.conf above would like if I configured it for serial output. Changes are in bold

-------------

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
default=0
timeout=10
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz
serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal --timeout=0 serial console

title Red Hat Linux (2.4.9-31smp)
root (hd0,0)
kernel /boot/vmlinuz-2.4.9-31smp ro root=/dev/md1 console=tty0 console=ttyS0,9600 initrd /boot/initrd-2.4.9-31smp.img

title Red Hat Linux-up (2.4.9-31)
root (hd0,0)
kernel /boot/vmlinuz-2.4.9-31 ro root=/dev/md1 console=tty0 console=ttyS0,9600
initrd /boot/initrd-2.4.9-31.img

-------------

If one wished to allow access to single user-mode from a serial console as well, it could be done by adding the following entry to the bottom of the file;

-------------
title Red Hat Linux (2.4.9-31smp single user)
root (hd0,0)
kernel /boot/vmlinuz-2.4.9-31smp ro root=/dev/md1 s console=tty0 console=ttyS0,9600
initrd /boot/initrd-2.4.9-31smp.img
-------------

Things to remember

1. When adding an boot option, (the four line entries in the grub.conf beginning with "title"), make sure that the title line is different for each. A computer will get mighty confused if it sees differing boot options with the same title.

2. The "/dev/md1" locations in each entry will differ from computer to computer. Forgetting to change them to reflect the setup of the particular server one is working on will lead directly to chair abandonement and chills.

3. Forgetting to comment out the "splashimage" line will mean that, while one's commands will be accepted via a serial connection, most of the output from them will not appear. This is confusing, but only to humans. The computer is perfectly happy under this setup.

4. Leaving the "--timeout=0" out of "terminal --timeout=0 serial console" will cause a "Press any key to continue" message to appear multiple times on the display. The console will still accept some commands ( though very few. Try pressing "b"), but will again not display most of the output.

5. On days when you have to modify the grub.conf, bring a jacket.

Posted by Bigwig at December 1, 2003 02:59 PM | TrackBack
Postscript:
First time visitor to House Hraka? Wondering if everything we produce could possibly be as brilliant/stupid/evil/pedantic/insipid/inspired as the post you just read? Check out the Hraka Essentials, the (mostly) reader-selected guide to Hraka's best posts, and decide for yourself.
Comments
Post a comment Note: Comments with more than two dashes per line will be blocked as spam.









Remember personal info?