Interested in speaking?
Past topics can (and should) be repeated
occasionally. In addition,
here are some topics people might like to hear about:
- Femlab (PDE modeling environment)
- GAP (computer algebra software)
- Getting started with Maple (or Matlab, or Mathematica, ...)
- How to do math on a Mac
- How to filter e-mail spam
- HTML vs. XHTML (the new HTML standard)
- Octave (free Matlab-like system)
- PDAs (handheld personal digital assistants and much more)
- PHP (server-side webpage scripting)
- R (free statistics system)
- Remote access (SSH, VNC, dial-up, ...)
- Scientific WorkPlace (graphical front end to TeX)
- Setting up a dual boot system (DOS/Linux)
- TeX / LaTeX topics
- Using scanners efficiently
- Using the WINEDT editor (a front end to TeX, HTML)
- XML (extensible markup language)
- [your favorite topic here]
To give a talk, please contact
swig@math.arizona.edu.
Using Removable Media in Linux, or How to Back Up Your Linux
Account
by Joe "VI" Erker
Table of Contents
Introduction
Whether you have a Linux account in the department or you
run Linux at home, it is a good idea to back up your files
regularly. The issue of backing up aside, some people like to
do their computing at home in addition to the lab or office. Or
sometimes it is necessary to travel with one's data for a
conference or other work-related trip. Whatever the case, one
should know how to read from and write to removable media
– ZIP disks, CD's, and diskettes – in the Linux
system.
Here, we go into ways to transfer data between the hard drive
and removable media via drag and drop, other GUI's, and
old-fashioned commands.
Using Zip Disks and Diskettes
Use of removable disks has become remarkably easy in
Linux. It has even gotten to the point where there is a
graphical user interface (GUI) for the file systems, and one
can "drag and drop" files between the hard drive and removable
disk, like in the Windows or Mac environment.
In the recent versions of Red Hat Linux (7.3 and above), it
is very easy to mount a disk for reading and writing.
Here's how:
- Insert the disk.
- Right click the mouse in the desktop background. Choose
"Disks" in the pop-up menu, then "floppy" or "zip" (or, for
reading a CD, "cdrom"), depending on the disk you inserted.
- After a few seconds, an icon will pop up in the desktop.
To see the contents of the disk, double-click the icon.
- If you want to transfer files between the removable disk
and hard drive, click on the "Home" icon on the desktop. Now
you'll have a window for your removable disk and hard drive,
and files can traverse directories and "drag and drop" files
just as in a Mac or Windows environment.
- When finished with the disk, unmount by repeating step 2,
this time "unchecking" the "floppy" or "zip" menu option.
Reading removable disks with commands:
- Insert the disk.
- Enter mount /mnt/floppy at the command prompt
for a diskette or mount /mnt/zip for a ZIP disk. (
Note: on older versions of Red Hat, mount
/mnt/zip100.0 for ZIP disks.)
- With the filesystem mounted in your linux session, you
can now move files back and forth as you normally would in
Linux, with the mv and cp commands. The
files on the removable disk are "in" the /mnt/floppy/
directory for a diskette, /mnt/zip for a ZIP disk, and
/mnt/cdrom for a readable CD.
- Unmount the disk with the command umount
/mnt/floppy or umount /mnt/zip .
Note on mounting: Linux is very particular about
mounting and unmounting the disk properly. Unmounting will not
work if there is a window open that displays the contents of
the disk, or if the mounted file system is the "current
directory"
Note on CD's: To read data from a CD-ROM, mimic the
commands above, substituting the word "CDROM" where "zip" or
"floppy" appears. For writing to CD's, see the instructions
below.
Notes on Various Types of Disks and Disk Drives
- Most commonly, a ZIP disk holds 100 MB of data. This is
over 70 times the storage of a floppy disk, or diskette. For
many purposes this capacity makes the ZIP disk very useful.
For example, if you are a graduate student who wants to back
up your thesis files regularly, or work alternately between
the departmental computers and your home computer, a ZIP disk
should suffice. For a small number of people, a ZIP disk can
hold all the files in your account. For many people, it is a
good way to back up the very important stuff.
- Some ZIP drives accomodate disks that can hold up to 250
Mb of information, but they are not used in the department.
- Cost: A good ZIP or writable CD drive should cost under
$100 and is available for internal IDE and SCSI, and external
SCSI and parallel port models. Zip disks should never cost
more than $10, and of course can be reused. Writable CD's are
much cheaper -- on the order of pennies per disk -- but can
be written to only once.
- Notes on types of ZIP drives: DO NOT buy a parallel port
ZIP for your PC, especially if you have a printer. It won't
work well with either Linux or Windows. The problem is that
the printer tends to try to interpret the ZIP's SCSI commands
and the poor ZIP drive tries to interpret the printer's
PostScript. It's a real mess. If you must purchase one of
these beasts, at least get the "ZIP plus" because it works on
both SCSI and parallel ports.
- JAZ drives: JAZ disks hold much more than ZIP disks -
they go as high as 2 GB - but they are not very cost
effective. A writable CD can hold 650 MB, and the CD drives -
not to mention the disks themselves - are significantly
cheaper.
Writing Data to CD's
The most recent version of Red Hat Linux, 9.0 comes with a
program called
xcdroast , which has been found very
buggy. This is unfortunate, since it provides a graphical user
interface that is supposed to make the process of writing data
to a CD, or "burning" very easy in Linux. Fortunately, burning
via Linux commands is fairly simple. As an example, we now see
how to back up your account onto a CD.
- Make sure the computer you are using has a CD-writable or
rewritable drive.
- Insert a writable CD into the drive. If you are unsure as
to whether the CD is blink or already has data on it, try to
mount it (see instructions elsewhere in this document). If it
can't be mounted, the CD is likely blink, and ready for use.
- Suppose the files in your account are in the directory
/home/username/ . Enter the command mkisofs -o
/var/tmp/<name>.cd -R /home/username The command
mkisofs converts all your files into one 'iso' file. The -R
flag ensures that all file names stay intact. The file name
name is of your choice. The directory /var/tmp/ is
where the iso file is placed temporarily, and from where the
data is read by the CD drive. (The extension of .cd
is not necessary; it is just a reminder to ourselves that it
is a file that is to be burned onto a CD.)
- Enter cdrecord -v dev=0,0,0 speed=## -data
/var/tmp/<name>.cd The number for the speed
argument should be the writing speed on the CD drive. On most
CD drives, this is indicated on the front of the drive. In
this case, there are three numbers. The highest is the
reading speed, the smallest is the rewriting speed, and the
middle is the writing speed. That number takes the place of
## in the above command. On the computers in the
grad labs, the writing speed is 40. The -v flag is
optional. It stands for "verbose", which means you will be
shown on the screen what is happening during the burning
process.
- At this point, you have your backed up data. Finally, you
should clean up by deleting the iso file:
rm /var/tmp/<name>.cd
You don't have to back up your entire account. Suppose for
example that you are a graduate student who wishes to back up
only the files that make up your thesis. Suppose that these
files are all in the directory /home/username/thesis. Then, to
back up your thesis:
- Enter a blink writable CD into the CD drive.
- Enter mkisofs -o /var/tmp/thesis.cd -R
/home/username/thesis/
- Enter cdrecord -v dev=0,0,0 speed=## -data
/var/tmp/thesis.cd (Remember to be aware of the writing
speed of the CD drive, and fill in that number
appropriately.)
-
rm /var/tmp/thesis.cd
In this case, it is not necessary, to use the name
thesis.cd. You can use whatever name you want. All
subdirectories of the thesis directory will be included in the
backup. Also, one can back up two directories at the same time.
Suppose in addition to the thesis directory, one has a
directory called "research". Then in item 2 in the above
example, one can type
mkisofs -o /var/tmp/backup.cd -R /home/username/thesis/
/home/username/research/
Reading CD's
Reading data from CD's, and thereby enabling one to copy
files from a CD to a hard drive is very easy. The procedure for
doing so is completely analogous to that for diskettes and ZIP
disks (see above), whether using commands or graphical 'drag
and drop' for transferring files between the CD and hard drive.
When a CD is mounted, the files are accessed in the /mnt/cdrom
directory.
A Note on Tapes and Tape Drives
The departmental file servers are backed up regularly with
tapes. Tapes are useful in that they can hold large amounts of
information. However, for individual users, backing up with
tapes is not recommended, for several reasons. First of all,
using other media is much simpler. Secondly, for most people
the amount of data that needs to be backed up can fit on a CD
(650 Megabytes). Thirdly, CD and ZIP disks and drives drives
are much cheaper than tapes and their drives. For the small
number of those who have gigabytes of data that needs to be
backed up, it is recommended to have a second hard drive that
acts as a "mirror" to the one that is used. One can back up an
entire hard drive to another hard drive in much less time than
to a tape. Ideally, the security-minded user would have a
second hard drive for day to day backups and a CD drive for
less frequent permanent backups of the most important data,
which of course can be taken away from the office for extra
security.
Currently in the department, we are gradually switching from
tapes to CD's as the primary source of backing up for the
computers of individual faculty members. Graduate students
are encouraged to occasionally back up their data using the
ZIP and CD-writable drives, which are available in the
graduate student computer labs.