当前位置: 首页 > 未分类 > 正文

Linux Tape Backup With mt And tar Command

Working with “mt” Commands: reading and writing to tape.

The following assumes the tape device is “/dev/st0”
Display status information about the tape unit:

Install MT command on Linux 
Download the rmp files
Then install as below
Log in to server as root
copy downloaded  mt rpm file to Linux server using  wincp  or related software
[root@localhost ~]# rpm -ivh mt-st-0.5-1.i386.rpm
I have tested with oracle Linux 5.4
Now you will be able to access mt command as bellows
# mt -f /dev/st0 status

Unload the tape:
# mt -f /dev/st0 offline

Rewind tape drive:
# mt -f /dev/nst0 rewind

Find out what block you are at with mt command:
# mt -f /dev/nst0 tell

Backup directory /www and /home with tar command (z – compressed):

# tar -czf /dev/nst0 /www /home

Display list of files on tape drive:
# tar -tzf /dev/nst0

Restore /www directory:
# cd /
# mt -f /dev/nst0 rewind
# tar -xzf /dev/nst0 www

Erase the tape:
# mt -f /dev/nst0 erase

You can go FORWARD or BACKWARD on tape with mt command itself:
(a) Forward record:
# mt -f /dev/nst0 fsf 1

(b) Goto previous record:
# mt -f /dev/nst0 bsfm 1

(c) Go to end of data:
# mt -f /dev/nst0 eod

本文固定链接: http://t.yjsec.com/index.php/2018/08/14/612/ | 下一站

该日志由 admin 于2018年08月14日发表在 未分类 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: Linux Tape Backup With mt And tar Command | 下一站

Linux Tape Backup With mt And tar Command:等您坐沙发呢!

发表评论

快捷键:Ctrl+Enter