NFS vs FTP
NFS and FTP (along with HTTP) are the three ways to install RedHat (as
well as most other distributions of linux) over a network. The major
difference between NFS and FTP is what they were originally intended for.
NFS (Network File System) is designed to allow a remote user to mount a
drive, similar to a local machine. Thus, it is optimized for frequent
access and changes, all while being transparent (i.e., using the same
commands as a local filesystem). FTP (File Transfer Protocol) is an
Internet protocol used for the transfer of files. Since all we need to do
is fetch a file, this is the preferred option for our setup. Actually,
remnant makes the installation directory available for both FTP and NFS,
from a common source.
The files in /images are disk images. The rawrite utility is used to copy
the data directly to a floppy in DOS, similar to burning a CD using a .ISO
(or a .CUE/.BIN combination). In linux, we can use a multipurpose tool,
called dd. For more information on dd, check the man page, or just read
the next paragraph.
A few notes on dd
Disk Duplicator (I guess... I dunno what it really stands for) is used to
image things. That sentence (you know, the one with the really poor
grammar) means to say that dd creates exact low-level copies. It works
lower than the file system level, so the 1.44MB file that is a floppy
image is an EXACT copy of the bits on the floppy disk. For making images,
we do: dd if(inputfile)=<inputfilename>
of(outputfile)=<outputfilename>. You don't actually need the count
line.. it'll stop when it's finished. Note that by default, for archaic
reasons, dd shows its results in 512 byte blocks... thus, doing a dd
if=/dev/fd0 of=diskimage.img will says 2880 blocks done. That's not
2.88MB, it's 2.88 thousand 512B blocks = 1.44MB. Think about it if you're
confused, but don't ask why ;). You can also tell it what size "chunks" to
copy data in, by using the bs (block size) command. Count is a multiple of
block size, so the following are all the same
dd if=/dev/fd0 of=image bs=1K count=100
dd if=/dev/fd0 of=image bs=10K count=10
dd if=/dev/fd0 of=image bs=100K count=1
Furthermore, all those will only image 100K worth of the file. Why you'd
want to do this, I don't know, but that's what it'll do.
Interesting uses of dd
These are some dd uses.
Create a floppy image / restore a floppy image:
dd if=/dev/fd0 of=file.img
Create an arbitrary sized file:
dd of=/dev/fd0 if=file.img
dd if=/dev/zero of=file # Don't do this! It'll run forever, or until
the filesystem gets full
Image copy of a hard disk (be careful using this for backups... do a
google search first)
dd if=/dev/zero of=file bs=1M count=100 # 100 Meg file (all zeros). You
can adjust bs and count to tweak performance... a good starting point
might be 1K bs
dd if=/dev/hda of=backupfile # for a full disk
dd if=/dev/hda1 of=backupfile # just one partition
Hard drive wipe (see this
story or this
one about getting old data from hard drives)
dd if=/dev/urandom of=/dev/hda # Don't do this here!!!
dd if=/dev/zero of=/dev/hda # Read up on why only zeros might not work
as well, or ask me, if I'm in a good mood.
Back to Installation...
RedHat's installer won't let you set the root password to a five character
string... try a minimum of 6.
Config file notes
resolv.conf is for host name lookups (mapping names (e.g. remnant) to ip
addresses (e.g. 192.168.5.250)). The search line tells it to try a default
domain or rutgers.edu. That way, if you type ping eden, it'll try
nsswitch tells the computer priorities in doing lookups. hosts: files dns
means check the default files (that is, /etc/hosts), then do to the DNS
servers listed in resolv.conf (188.8.131.52 and 184.108.40.206).
rpm-- too many options to list. Do a man rpm. One thing I will point
out... usually, I do installs with a -Uvh, the U meaning Upgrade. That
way, if a package is already installed, it'll update it nicely. However,
for kernels, I strongly advise using -ivh. That way, it installs
the new kernel adjacent to the current one, instead of overwriting the
previous version. Very useful in case you want (need) to go back.
If you're cutting and pasting the hosts file into vi, there's a good
chance you'll wind up with everything on one line. Here's how to fix
that. Read up on search and replace, but in a nutshell, this should do
The :s is for replace (substitute, actually), the first argument is what
to search for, the second is what to replace it with (the \r is a
newline (aka return)), and the /g is for
global, meaning everything on that line.
UPDATE- This is no longer true. We fixed the version on the
website so you can cut and paste.. but this trick remains extremely
Creating a boot disk
See above. Also, note that mcopy is (I guess) MSDOS Copy... that's why
you give it a:. The other way to is mount /dev/fd0 /mnt/floppy, cp
ks.cfg /mnt/floppy, umount /mnt/floppy. In linux, always unmount a
floppy before removing it, otherwise you run the risk of data
corruption. (In fact, I can almost guarantee that if you copy and eject
promptly w/o unmounting, your file won't be there).
For a floppy kickstart, you start the linux kernel with the option
ks=floppy. To automate this, look for an append line in the syslinux.cfg
file. That way, you can have a kickstart with no keyboard interaction
required (useful for clusters, where a machine might not have a keyboard
As a safety feature, the parts about partitioning the hard disk in the
automatic kickstart file are commented out. Make sure to remove the #'s
if you want it to actually work.
Also, by default, the standard kickstart asks you to hit enter to reboot
at the end. If you want completely unattended kickstarts, add the line
"reboot" somewhere in your ks.cfg. Of course (and I learned
this the hard way), you have to remove the floppy sometime during the
kickstart (package installation is a safe time) so it doesn't reinstall
over and over and over and over and over and over and i think i did that
a few times myself... and over...
Be advised that if you're confused about a file (say, lilo.conf), man is
your friend (even if you're not a dog... I didn't say best friend). Not
only can you do "man command", but "man filename"
works too. Try a man lilo.conf to see the options available.
Just a reminder. Your text is VERY good... read it, learn it, memorize the
%$#$ thing if you want. These notes are only what I think might be
interesting side points as I read through the lecture notes (or based on
comments I get from people during the Wednesday practical). They're not
necessary relevant to passing the class, though to be a good admin, you
should know all of this (and a heckuva lot more, too, of course).
| Course Homepage | Email Me | Contact Info]