在Linux下如何使用磁带机:
1.识别磁带机:
IDE磁带机识别为/dev/ht0, /dev/hd1或/dev/nht0, /dev/nht1
其他磁带机均识别为/dev/st0, /dev/sd1或/dev/sht0, /dev/sht1(其中n代表不可倒带(no rewind))
检查是否识别到驱动器:
# cat proc/scsi/scsi
列出如下图的厂商,型号,固件版本等等
2.使用mt控制磁带机:
MT的用法: mt [-v] [-h] [ -f device ] command [ count ]
如:
# mt –f /dev/st0 offline弹出磁带
# mt –f /dev/st0 status查看状态
# mt –f /dev/st0 erase擦除磁带
# mt –f /dev/st0 rewind倒带
3.用tar备份:
# tar cvf /dev/st0 /home备份/home目录
#tar tvf /dev/st0校验磁带
#tar xvf /dev/st0恢复到当前目录
4.用cpio备份:
# find /tmp | cpio –ocv > /dev/st0
# cpio –tvF /dev/st0校验
Use copy in mode to restore archived data from an archive destination file. The restore will not overwrite files that are more or the same age without a force switch.
# cpio –icv
Notice that the data is restores to its original directory by default.
# cd /tmp
# ls
Cpio can also be used to archive files in the tar archive format.
# find /tmp | cpio –ovH tar > /dev/st0
Verify the contents of the tape.
# tar -tvf /dev/st0
Perform a restore.
# cpio –ivH tar
Notice that the cpio restore in tar format restores to the current working directory.