What are the common commands for a tape drive in solaris system?
Common commands for a tape drive include:
1.Rewind: #mt -f /dev/rmt/0n rewind
2.Forward and rewind: #mt -f /dev/rmt/0n retension
3.Offline: #mt -f /dev/rmt/0n offline
4.Forward: #mt -f /dev/rmt/0n fsf 1
5.Backward: #mt -f /dev/rmt/0n bsf 2
Note: Add 1 to the original number.
6 View the status of a tape drive: #mt -f /dev/rmt/0n status
The status of a tape drive can also be checked simply by using this command: #mt status
If the execution result prompts /dev/rmt/0n: No such file or directory, generally the message means no tape drive attached or no tape drive at all.
If the execution result displays /dev/rmt/0n: no tape loaded or drive offline, generally the message means no tape at all.
7. Query the files in the tape drive: #tar tvf /dev/rmt/0n
If the execution result displays tar: /dev/rmt/0n: I/O error, generally the message means no tape present.
8. If the type indicator light of the tape drive flickers for a short period and then lit-up, the tape drive hangs. You can solve the problem by the following steps:
Delete all files in /dev/rmt/
Run the devfsadm command to identify devices and rebuild device tree.
View the content of the tape drive: #tar tvf /dev/rmt/0n
9Attach the tape drive;
#mt status View status
10. The tape cartridge is automatically ejected a moment after being put in. This is a cleaning process using cleaning cartridge. In actual application, you should check whether the tape is indicated as a cleaning cartridge or a data cartridge.
Then n in the /dev/rmt/0n command stands for not rewinding the tape. If there is no n, the tape is rewound after the completion of the operation.
�If there is no n, the tape is rewound after the command of forward a space, backward a space or query contents is run.
If some data has been written into the tape and the tape is rewound, when you write data to the tape, the old data is overwritten. This is very dangerous. Thus add an n to the command when performing tape-related operation.