Backing Up In Linux
Next, you need to make sure that the SCSI devices have been created in your /dev directory. Once again, if you have a Linux distribution, this will more than likely have been done. Otherwise, you will have to create them manually. Do:
$ ls /dev/*st*
and you should have at least the following files:
If you do not, create them (you will have to be root):
$ mknod -m 666 /dev/st0 c 9 0 $ mknod -m 666 /dev/nst0 c 9 128
Note, the above assumes that you are using the first tape on the SCSI bus. If you have two tapes, and you want to use the second one, change the device names to /dev/st1 and /dev/nst1 and create them:
$ mknod -m 666 /dev/st1 c 9 1 $ mknod -m 666 /dev/nst1 c 9 129
If you have a more recent distribution, chances are you will have the MAKEDEV script available in your /dev directory. You can create all the appropriate devices by simply running that script:
$ cd /dev $ ./MAKEDEV st0
Unlike floppy tape drive tapes, SCSI tapes generally do not need formatting. They may, however, need erasing for use under Linux. To erase a tape, do:
$ mt -f /dev/st0 erase
DAT tapes, however, do not need erasing. The easiest way to find out if a particular tape needs erasing is to try using it without erasing first. If you can, well and good; if not, you will have to erase prior to use.
Accessing a tape drive is very similar to accessing a file on the hard disk, except that a tape drive has two filenames. For ftape, these two names are generally /dev/ftape and /dev/nftape. If you use zftape, the two device names are generally /dev/qftape and /dev/nqftape. For SCSI, the names are /dev/st0 and /dev/nst0 for the first SCSI tape device, /dev/st1 and /dev/nst1 for the second SCSI tape device, and so on.
When the tape drive is accessed by the first filename (/dev/ftape, /dev/qftape, or /dev/st0), we are said to be accessing the rewinding device. When the tape drive is closed, the tape is automatically rewound to the beginning. When accessing the tape drive via the second filename (/dev/nftape, /dev/nqftape, or /dev/nst0), we are using the non-rewinding device and when the tape drive is closed, the tape is left where it is.
Some applications need to use both devices and you will need to specify the correct names.
Now that you have set up your system for a tape drive, you will want to test it. GNU tar is the de facto backup standard under Linux and comes will all distributions. If you do not have it, obtain it from a site near you.
In the examples below, I will use dev_name to indicate your device name. As mentioned above, this will probably be /dev/ftape if you use ftape, /dev/qftape if you use zftape, and /dev/st0 if you use a SCSI drive.
Put a freshly prepared tape into the tape drive and try to make a small backup:
$ tar cf dev_name /etc
This should backup your /etc directory. You can now check to see if the backup was made correctly by:
$ tar df dev_name
Note that if you use ftape, you cannot use the Ar options to tar because of limitations in the current driver. That is, you cannot append files to an archive. You will have to use mt to move the tape to the end of one archive and then create another archive.
A more detailed look at tar is provided in the Tar and Taper for Linux article.
Please note that the above sites are very busy. In the interests of preserving your sanity and minimizing network traffic, find a mirror (and there are many) near you and use that. Both tsx-11 and sunsite will print a list of mirrors if you try to log on when they are busy.
The HOW-TOs are an invaluable source of information. There is a HOW-TO for both ftape and for SCSI.
Yusuf Nagree is a part time doctor and a full time Linux hacker (aargh—sorry, full time doctor and part time Linux hacker). He has been a computer buff since his dad bought him a ZX-80 in 1980 and has had various computers over the years. Bored with DOS, OS/2 and Windows, the aspect of Linux he finds most enjoyable is the community spirit and general willingness to help and share knowledge and experience.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- My +1 Sword of Productivity
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Non-Linux FOSS: Caffeine!
- Managing Linux Using Puppet
- Doing for User Space What We Did for Kernel Space
- Tech Tip: Really Simple HTTP Server with Python
- Parsing an RSS News Feed with a Bash Script
- SuperTuxKart 0.9.2 Released
- Google's SwiftShader Released