"Linux Gazette...making Linux just a little more fun!"


Clueless at the Prompt

By Mike List, [email protected]


Welcome to installment 5 of Clueless at the Prompt:

How's it goin'? This month I'm going to go into some basic admin ideas that you can use to make your home linux box a little easier to deal with, especially in an emergency.

I'm also going to hit xdm on a couple of points, although I've got the merest understanding of all the differences between it and running from "startx"


*Boot/Rescue Disks:

If you make a mockery of your filesystem by typing for instance a space between "/" and the file you were trying to rm as root, or your extraordinarily gifted child discovers how to cold boot your computer while you're in X and have a dozen windows open, or you accidentally kick the power strip while you're stretching, or geez, need I go on? You may discover one of the handiest things (two, actually) is a Boot/rescue/root disk combo.

To use these , you simply reboot or cycle offthe computer as "gracefully" as possible. Insert the boot disk, which can be your install boot disk and start the bootup. instead of using your install root disk, you drop a rescue disk in when prompted. These disks can be gotten from your distribution's ftp site or more conveniently, if you have linux on CDROM, guess where you might get it, most likely wherever you got your boot image. You can also roll your own, or use Yard to make a custom rescue disk. As a side note, you can use this method to make a usable, if not very flexible, minilinux system, something like xdenu.

To use your rescue disk, boot up with your installation bootdisk, and when you are prompted to insert root disk, just pop it in and hold tight a second. when you get a prompt, you are almost ready to fix your problems.You can run fsck on a disk partition without mounting it, in fact that's the safest way to use it. If you bollixed any init files, you can mount the /dev/?partition to "/mnt" cd /mnt and using vi, edit the mistaken lines or even recreate them if need be. One important note; your hard drive will be mounted below /mnt, so don't do anything to "/" or you risk hosing your rescue disk, not a nice thng to do when it's all that stands between you and your linux system.There is even a defrag utility that you can use after you fsck your filesystems, but you must make sure that you only run it on UNMOUNTED filesystems or you'll be subject to a REAL LEARNING EXPERIENCE!, as in learning to reinstall your box from scratch, or practice on your backup routine.


*Xdm:

If you ever thought it would be cool to be able to start your linux box in X mode and logging in from an X screen, it isn't too hard to do, using xdm, the X Display Manager. You can easily start it by simply typing:
		xdm
		
if you have X configured. It should start with a login screen, and look like the twm window manager, tweed background and all, and when you login for the first time, it probably will be twm, particularly if you got your XFree86 distribution from xfree86.org, although I'm really only accustomed to Slackware so another window manager might come as default in say, RedHat or SuSe, or Debian distributions. that can be changed, as can the tweed root window, and the login message, and a great many other small details. You should be aware that because of the way xdm invokes X, the path will not be the same as if you run startx. That means that you must either specify the full pathnames for executables or change your path in the" " file.Your access to remote xhosts will be different as well, a problem I haven't licked yet but by the time you finish reading this I might(or you might, or we both might or ...).

Better yet break out your favorite editor, save your /etc/inittab file in case of disaster and find the line that starts with id?:default runlevel? and read the file down a few lines to where it describes the runlevels and change to the one that describes X11R6 in Slackware it would be runlevel 4, so change the id and the runlevel description if you are a slacker, it may be different on other distributions, since they mostly use BSD style init and have their rc.files directly in /etc. That's enough to start Linux in a login screen.You could run

 
		locate xdm
to find the xdm files, and give them a good lookover. The files you'll want to look at are the Xresources, Xsession, and Xsetup_0. There are other files to work over but let's start with our local desktop.

If you look at your Xsession file you'll see you need these files in your home directory:.xinitrc and .Xresources. The .xinitrc you may have in your home directory is a reasonable default, and you can copy the system Xresources to your home .Xresources. If you would like to use other files as your startup and resources file, you'll need to specify them in the Xsession file, at the lines that read:

        startup=$HOME/.xinitrc
             resources=$HOME/.Xresources
	     
you might use .openwin, instead of .xinitrc and .Xdefaults instead of .Xresources, you'll have to lok at what X related dotfiles are present in your home directory.

Your Xsetup_0 fle can be used to start a background image in the login screen using a command like:

	     
	     xv -root -quit /your/image/here
assuming that you have xv installed on your system. You can use other viewers to start the image, but you will have to read up on the appropriate command line options for them. You can also enable or disable the xconsole log, which can be used to notify you of errors in execution, etc, by piping the xdm-errors file to it in this file, although I haven't done it and am not real familiar with the the specifics.

If you have any starting out type questions, or any tips you you think would be handy for the newbie reader, please email me at:

[email protected]

See you next month!


Copyright © 1997, Mike List
Published in Issue 30 of the Linux Gazette, July 1997


[ TABLE OF CONTENTS ] [ FRONT PAGE ]  Back  Next