国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

Linux系統下磁帶機的直接備份過程

2024-08-28 00:13:40
字體:
來源:轉載
供稿:網友

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

The following assumes the tape device is “/dev/st0″

STEP 1 ( rewind the tape)

# mt -f /dev/st0 rewind

STEP 2 (check to see if you are at block 0)

# mt -f /dev/st0 tell

At block 0.

STEP 3 (Backup “tar compress” directories “one” and “two”)

# tar -czf /dev/st0 one two

STEP 4 (Check to see what block you are at)

# mt -f /dev/st0 tell

You should get something like block 2 at this point.

STEP 5 (Rewind the tape)

# mt -f /dev/st0 rewind

STEP 6 (List the files)

# tar -tzf /dev/st0

one/

one/test

two/

STEP 7 (Restore directory “one” into directory “junk”). Note, you

have to first rewind the tape, since the last operation moved

ahead 2 blocks. Check this with “mt -f /dev/st0″.

# cd junk

# mt -f /dev/st0 rewind

# mt -f /dev/st0 tell

At block 0.

# tar -xzf /dev/st0 one

STEP 8 (Next, take a look to see what block the tape is at)

# mt -f /dev/st0 tell

At block 2.

STEP 9 (Now backup directories three and four)

# tar -czf /dev/st0 three four

After backing up the files, the tape should be past block 2.

Check this.

# mt -f /dev/st0 tell

At block 4.

Currently the following exist:

At block 1:

one/

one/test

two/

At block 2:

three/

three/samplehere

four/

At block 4:

(* This is empty *)

A few notes. You can set the blocking factor and a label

with tar. For example:

$ tar –label=”temp label” –create –blocking-factor=128 –file=/dev/st0 Notes

But note if you try to read it with the default, incorrect blocking

factor, then, you will get the following error:

$ tar -t –file=/dev/st0

tar: /dev/st0: Cannot read: Cannot allocate memory

tar: At beginning of tape, quitting now

tar: Error is not recoverable: exiting now

However this is easily fixed with the correct blocking factor

$ mt -f /dev/st0 rewind

$ tar -t –blocking-factor=128 –file=/dev/st0

temp label

Notes

Take advantage of the label command.

$ MYCOMMENTS=”Big_important_tape”

$ tar –label=”$(date +%F)”+”${MYCOMMENTS}”

Writing to tape on a remote 192.168.1.155 computer

$ tar cvzf - ./tmp | ssh -l chirico 192.168.1.155 ‘(mt -f /dev/st0 rewind; dd of=/dev/st0 )’

Restoring the contents from tape on a remote computer

$ ssh -l chirico 192.168.1.155 ‘(mt -f /dev/st0 rewind; dd if=/dev/st0 )’|tar xzf -

Getting data off of tape with dd command with odd blocking factor. Just set ibs very high

$ mt -f /dev/st0 rewind

$ tar –label=”Contenets of Notes” –create –blocking-factor=128 –file=/dev/st0 Notes

$ mt -f /dev/st0 rewind

$ dd ibs=1048576 if=/dev/st0 of=notes.tar

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 亚东县| 商水县| 淳安县| 云霄县| 乌鲁木齐县| 大英县| 赣榆县| 遂平县| 西青区| 台安县| 武夷山市| 利津县| 郸城县| 酉阳| 色达县| 赤壁市| 海宁市| 信宜市| 舟曲县| 晋江市| 石家庄市| 普洱| 砚山县| 育儿| 黄浦区| 准格尔旗| 当涂县| 阜宁县| 平顺县| 鹤庆县| 马尔康县| 崇文区| 宜川县| 清镇市| 永嘉县| 德格县| 嘉义市| 宜兰县| 油尖旺区| 焦作市| 突泉县|