linux磁带存储,linux 磁带文件操作分析
這個磁帶包含四個備份,從頭開始使用tar tvf /dev/nst0列目錄會出現:有文件,無文件,有文件,無文件,有文件,無文件,有文件,無文件,錯誤這一系列結果(很有意思)。 另外說明一下/dev/nst0 里的n是不倒帶的意思,意味著對它的操作不會自動倒帶。 圖片里的箭頭是磁頭的位置。 這里只是我一個人的想法,也不知道實際情況是否如此!
列目錄、讀和寫目錄文件,下面是對磁帶機讀寫命令的介紹:列磁帶目錄:tar tvf磁帶機設備文件名首次寫入磁帶:tar cvf磁帶機設備文件名欲記錄的文件或目錄名增量寫入磁帶:tar rvf磁帶機設備文件名欲記錄的文件或目錄名讀磁帶: tar xvf磁帶機設備文件名欲讀出的文件或目錄名
[root@localhost cidai]# mt -f /dev/nst0 rewind磁帶到起點
[root@localhost cidai]# mt -f /dev/nst0 status查磁帶狀態(不轉動磁帶)
SCSI 2 tape drive:
File number=0, block number=0, partition=0.文件集號碼0,塊數0,分區0 (磁帶可以被格式化為多個分區,需要設備支持)
Tape block size 512 bytes. Density code 0x47 (TR-5).塊尺寸為512字節,密度代碼0x47 (TR-5)
Soft error count since last status=0軟錯誤0個
General status bits on (41010000):
BOT ONLINE IM_REP_EN(我猜是begin of type)
[root@localhost cidai]# tar tvf /dev/nst0執行前磁頭位于第一個文件集的開始,執行后磁頭位于第一個文件集的EOF前
-rw-r--r-- oracle/oinstall 10240 2007-04-16 10:03:48 waitdemo.c
[root@localhost cidai]# mt -f /dev/nst0 status磁頭位于第一個文件集的EOF前
SCSI 2 tape drive:
File number=0, block number=40, partition=0.說明第一個文件集占用40*512字節(這文件集只包含一個文件: waitdemo.c)
Tape block size 512 bytes. Density code 0x47 (TR-5).
Soft error count since last status=0
General status bits on (1010000):
ONLINE IM_REP_EN
[root@localhost cidai]# tar tvf /dev/nst0執行前磁頭位于第一個文件集的EOF前,執行后位于EOF后(也就是第二個文件集的開始)
[root@localhost cidai]# mt -f /dev/nst0 status磁頭位于第二個文件集的開始
SCSI 2 tape drive:
File number=1, block number=0, partition=0.
Tape block size 512 bytes. Density code 0x47 (TR-5).
Soft error count since last status=0
General status bits on (81010000):
EOF ONLINE IM_REP_EN
[root@localhost cidai]# tar tvf /dev/nst0執行前磁頭位于第二個文件集的開始,執行后位于EOF前
-rw-r--r-- oracle/oinstall 60712 2007-04-12 15:24:23 addvalue.pc
[root@localhost cidai]# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=1, block number=140, partition=0.說明第二個文件集占用140*512字節(這文件集只包含一個文件: addvalue.pc)
Tape block size 512 bytes. Density code 0x47 (TR-5).
Soft error count since last status=0
General status bits on (1010000):
ONLINE IM_REP_EN
[root@localhost cidai]# tar tvf /dev/nst0執行前磁頭位于第二個文件集的EOF前,執行后位于EOF后(也就是第三個文件集的開始)
[root@localhost cidai]# mt -f /dev/nst0 status磁頭位于第三個文件集的開始
SCSI 2 tape drive:
File number=2, block number=0, partition=0.
Tape block size 512 bytes. Density code 0x47 (TR-5).
Soft error count since last status=0
General status bits on (81010000):
EOF ONLINE IM_REP_EN
[root@localhost cidai]# tar tvf /dev/nst0執行前磁頭位于第三個文件集的開始,執行后位于EOF前
-rw-r--r-- oracle/oinstall 8305 2006-11-16 09:33:38 et.c
[root@localhost cidai]# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=2, block number=20, partition=0.說明第三個文件集占用20*512字節(這文件集只包含一個文件: et.c)
Tape block size 512 bytes. Density code 0x47 (TR-5).
Soft error count since last status=0
General status bits on (1010000):
ONLINE IM_REP_EN
[root@localhost cidai]# tar tvf /dev/nst0執行前磁頭位于第三個文件集的EOF前,執行后位于EOF后(也就是第四個文件集的開始)
[root@localhost cidai]# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=3, block number=0, partition=0.
Tape block size 512 bytes. Density code 0x47 (TR-5).
Soft error count since last status=0
General status bits on (81010000):
EOF ONLINE IM_REP_EN
[root@localhost cidai]# tar tvf /dev/nst0執行前磁頭位于第四個文件集的開始,執行后位于EOF前
-rw-r--r-- oracle/oinstall 2152 2006-11-16 09:33:38 qall.c
-rw-r--r-- oracle/oinstall 3537 2006-11-16 09:33:38 et.h
[root@localhost cidai]# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=3, block number=20, partition=0.說明第四個文件集占用20*512字節(這文件集只包含兩個文件: qall.c和et.h)
Tape block size 512 bytes. Density code 0x47 (TR-5).
Soft error count since last status=0
General status bits on (1010000):
ONLINE IM_REP_EN
[root@localhost cidai]# tar tvf /dev/nst0執行前磁頭位于第四個文件集的EOF前,執行后位于EOF后(也就是第五個文件集的開始)
[root@localhost cidai]# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=4, block number=0, partition=0。
Tape block size 512 bytes. Density code 0x47 (TR-5).
Soft error count since last status=0
General status bits on (81010000):
EOF ONLINE IM_REP_EN
[root@localhost cidai]# tar tvf /dev/nst0執行前磁頭位于第五個文件集的開始,因為沒有第五個文件集,磁帶稍轉,磁頭前移
[root@localhost cidai]# mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=4, block number=-1, partition=0.
Tape block size 512 bytes. Density code 0x47 (TR-5).
Soft error count since last status=0
General status bits on (9010000):
EOD ONLINE IM_REP_EN(我猜是End of Device)
[root@localhost cidai]# tar tvf /dev/nst0由于已經到尾部,磁帶不能繼續前轉
tar: /dev/nst0:無法read:輸入/輸出錯誤
tar:處于磁帶的起點,現在退出
tar:錯誤是不…
總結
以上是生活随笔為你收集整理的linux磁带存储,linux 磁带文件操作分析的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: agp接口常用于什么(Vivado使用心
- 下一篇: 200 人团队开发《巫师 4》,CDPR