Professor Cullen Lecture Notes
COMS148
HOWTOs
Self-Updating
Message Console
Precede the TAIL display
command with WATCH will allow a rolling console of messages.
Example:
watch -n1 'tail /var/log/messages'
watch -n1 'tail /var/log/secure'
Measure the Elapsed Time of a command
Precede the command with TIME.
Example:
time rpm -qa | egrep 'office'
Install
a USB memory stick
From ROOT or SuperUser
Make a directory under the
/mnt directory. I called mine usbdrive. You can use any
name that is not already in use.
mkdir
/mnt/usbdrive
The USB memory stick is designed to look like a SCSI device to Linux.
Optionally, update /etc/fstab to allow accomodation of VFAT (MSDOS)
file type for the stick by
including the following line:
/dev/sda1 /mnt/usbdrive vfat noauto,user,rw 0 0
make sure that the usb modules are loaded into storage.
modprobe usb-storage
place the usb stick in an available usb port on your machine.
mount the stick
mount -t vfat /dev/sda1 /mnt/usbdrive
change to the stick's directory.
cd /mnt/usbdrive
list the contents of the stick.
ls -l
write a file to the stick.
echo this is a test > /mnt/usbdrive/testfile
display the new file
cat /mnt/usbdrive/testfile
finish and dismount
umount
/mnt/usbdrive
Linux
Nucleus System Generation Process (kernel rebuild)
First make backups of your /boot files and /lib modules.
Recommend that you have a spare hard drive that is a duplicate image of
your boot drive.
Save the output via redirection of every make step so that you can
check for errors.
Change into the kernel source directory.
cd
/usr/src/linux.n.n.n
Perform make mrproper to sweep residuals remaining from previous builds
clean.
make
mrproper
Edit the Makefile and ensure that you select a unique EXTRAVERSION name
so as not to overlay
your running system components.
vi
Makefile
Perform make xconfig or make config and select your options for the
nucleus build.
You have the option of selecting a previous stored kernel configuration
or to config
from scratch.
make
xconfig
Check and resolve dependencies.
make
dep
Clean up garbage and prepare the source tree for the build.
make
clean
Perform generation process using completed configuration.
make
bzImage
Compile and link any loadable program modules.
make
modules
Move all modules into the install area from staging area.
make
modules_install
Populate the nucleus, loadable modules and initrd disk and update
grub.conf.
make
install
Check all logging for any errors.
Check that the "initrd" disk has been built.
Check that the "grub.conf" file has been properly configured.
Reboot and select your new nucleus from GRUB menu.
If there is a problem you can always select your old kernel from the
menu.
[Return
to Professor Page]