. . .
Creates a boot floppy which can be used to bring up the system if, for example, the MBR (master boot
record) becomes corrupted. Of special interest is the --iso option, which uses mkisofs to create a
bootable ISO9660 filesystem image suitable for burning a bootable CDR.
The mkbootdisk command is actually a Bash script, written by Erik Troan, in the /sbin directory.
Creates an ISO9660 filesystem suitable for a CDR image.
CHange ROOT directory. Normally commands are fetched from $PATH, relative to /, the default
root directory. This changes the root directory to a different one (and also changes the working
directory to there). This is useful for security purposes, for instance when the system administrator
wishes to restrict certain users, such as those telnetting in, to a secured portion of the filesystem (this
is sometimes referred to as confining a guest user to a "chroot jail"). Note that after a chroot, the
execution path for system binaries is no longer valid.
A chroot /opt would cause references to /usr/bin to be translated to /opt/usr/bin.
Likewise, chroot /aaa/bbb /bin/ls would redirect future instances of ls to /aaa/bbb as
the base directory, rather than / as is normally the case. An alias XX 'chroot /aaa/bbb ls' in a user's
~/.bashrc effectively restricts which portion of the filesystem she may run command "XX" on.
The chroot command is also handy when running from an emergency boot floppy (chroot to
/dev/fd0), or as an option to lilo when recovering from a system crash. Other uses include
installation from a different filesystem (an rpm option) or running a readonly filesystem from a CD
ROM. Invoke only as root, and use with care.
It might be necessary to copy certain system files to a chrooted directory, since the
normal $PATH can no longer be relied upon.
This utility is part of the procmail package (www.procmail.org). It creates a lock file, a semaphore
that controls access to a file, device, or resource.
Definition: A semaphore is a flag or signal. (The usage originated in railroading, where a
colored flag, lantern, or striped movable arm semaphore indicated whether a particular track was in
use and therefore unavailable for another train.) A UNIX process can check the appropriate
semaphore to determine whether a particular resource is available/accessible.
The lock file serves as a flag that this particular file, device, or resource is in use by a process (and is
therefore "busy"). The presence of a lock file permits only restricted access (or no access) to other
# Creates a write-protected lockfile prefixed with the name of the script.
# A safer version of the above, as pointed out by E. Choroba.
Lock files are used in such applications as protecting system mail folders from simultaneously being
changed by multiple users, indicating that a modem port is being accessed, and showing that an
instance of Firefox is using its cache. Scripts may check for the existence of a lock file created by a
Advanced Bash-Scripting Guide
Chapter 17. System and Administrative Commands