558 561




Using Linux:System Maintenance






-->















Previous
Table of Contents
Next




To use floppy disks as storage devices, you must know the device name your floppy disk drive uses. Usually, this is /dev/fd0, but you may need to do some snooping to verify this—one way to snoop is to try the procedures for formatting or mounting floppies (described later in this section) on different device files (/dev/fd0, /dev/fd1, and so on). Then you must mount a preformatted floppy disk (you must have more than one disk handy, so format extras if you need to). You can do a low-level format (similar to the one performed by the MS-DOS command format) using the fdformat utility to preformat a floppy:


#fdformat /dev/fd0


After the floppy disk has been formatted with fdformat, you must configure it for the ext2 file system. The mkfs command sets up the parameters for the Linux Second Extended file system:


#mkfs -t ext2 /dev/fd0 1440





Use fdformat with careUsing fdformat erases all data on the floppy disk. Try mounting and reading from it (using the mount and ls commands) to make sure it is empty before formatting if you're not sure.


The 1440 indicates that the floppy disk contains 1,440 kilobytes of storage, or 1.44 MB).
Finally, we can mount the floppy disk by using the default mount point /mnt/floppy.


#mount -t ext2 /dev/fd0 /mnt/floppy


Be sure to use one mount point per mounted device. Now that you have a mounted floppy disk at your disposal, you can start to back up information onto it:



#tar -cvfz /dev/fd0 files


The preceding command creates an archive on the device /dev/fd0. Note that in this command, you use the name of a device and not the tarfile.tar filename structure. tar recognizes that /dev/fd0 is a device, but allows you to treat the device like an archive file. Usually, when backing up onto floppy disks, you will use the M option with tar to signify that this is a backup with multiple volumes.


#tar -cvzMf /dev/fd0 files


tar prompts you when you need to change floppy disks. Make sure you mark the disk order number on each floppy used, or you will have problems when you try to restore the archive.

SEE ALSO

•  For more information about formatting and mounting devices, see page 99.
•  For more information about the tar command, see page 544.



Backing Up with Removable Drives
If you plan to use removable tape drives connected to your floppy disk controller for backups, you must determine the device file associated with your tape drive. Usually, tape drives are divided into two types: rewindable (represented by the device files /dev/rft0, /dev/rft1, /dev/rft2, and so on) and non-rewindable (represented by the device files /dev/nrft0, /dev/nrft1, /dev/nrft2, and so on). Rewindable tape devices rewind the tape automatically after tar finishes writing an archive to the tape, so they are best used when you use a tape for only one archive file. Non-rewindable tape devices do not automatically rewind after tar finishes, so you can place several archive files, one after the other, on one tape.
Consider the following commands:


#tar -cvzf /dev/rft0 /usr/doc


When used with a rewindable tape drive, this tar command creates a compressed archive of all the Red Hat documentation installed on your main system. After the command has finished running, the tape rewinds automatically. Running tar again on the same tape overwrites this archive (so label your tapes well). Conversely, with a non-rewindable tape drive, you can put several successive archives on one tape.


#tar -cvzf /dev/nrft0 /usr/src


This command creates an archive of all the standard source code on the main system. Assuming there is enough space left on the tape, after this command runs you can run another tar command to create a second archive on the tape.


#tar -cvzf /dev/nrft0 /usr/lib


This command is not the same as using tar with the -A function to append files to an existing archive. This command creates a second archive, distinct from the first, on the device /dev/nrft0. To restore the second archive, you must use the mt command to skip over the first archive file on the tape:


#mt /dev/nrft0 fsf 1


If you use another kind of drive for backups, you can substitute the device file it uses for the previous floppy tape device files. So, if you use a SCSI tape device, for instance, you’d indicate it with the nomenclature /dev/st0, as follows:


#tar -cvzf /dev/st0 /home


Likewise, if you use an Iomega Zip drive on a SCSI port, you would use the /dev/sda1 drive (sda1 usually refers to the first SCSI device that is removable, but not a tape):


#tar -cvzf /dev/sda1 /home


The device you use depends on the device that the kernel supports . To check available devices, you can run mount with no arguments:


#mount
/dev/hda5 on / type ext2 (rw)
/dev/hda7 on /usr type ext2 (rw)
/dev/fd0 on /mnt/floppy type msdos (rw)
/dev/sda1 on /mnt/zip type ext2 (rw)



SEE ALSO

•  For more information about formatting and mounting devices, see page 99.
•  For more information about using tape drives and Iomega Zip drives with Red Hat Linux 5.0, see page 119.
•  For more information about the tar command, see page 544.



Automating Incremental Backups
You can use the find and tar commands to automatically back up files that have changed since the last time the entire system was backed up. Backing up the entire system, called a full backup, usually involves backing up everything that was created or changed after the initial installation. There is little need to include in a full backup most packages that can be reloaded with rpm or glint, because these packages exist on separate devices. However, if you have added some utilities via ftp from the Internet, or have lost the original disks that packages came on, you should make sure you have at least one good backup copy.
If you have enough room on tapes, a full backup can be simple:


#tar -cvzMf /dev/rft0 /


Or, you could be more selective:



#tar -cvzMf /dev/rft0 /etc /var /sbin /usr/local /home






Previous
Table of Contents
Next














Wyszukiwarka

Podobne podstrony:
Nuestro Circulo 561 Vladimir Petrov
Chem ch16 pg527 558
561 564
558,8,artykul
22 zalacznik 1 material na temat dobrego menedzera oraz stylow zarzadzaniaid)558
README (558)
558 (2)

więcej podobnych podstron