2014-02-21 15 views
0

我是磁帶存檔世界的新手,但我覺得很奇怪,我無法通過tar -r選項將兩個文件寫入磁帶。將多個文件寫入(倒帶)磁帶存檔

這裏是我想要做的事:

$ cd /tmp 
$ touch first second 
$ tar cvf /dev/st0 first 
$ tar cvf /dev/st0 second 
$ tar tvf /dev/st0 
-rw-r--r-- mathieu/mathieu 0 2014-02-21 15:00 second 

很顯然,我已經失去了first文件。我看不到我怎麼可能跳過這第一個tar檔案。我想:

$ export TAPE=/dev/st0 
$ mt fsf 2 
/dev/st0: Input/output error 
$ mt fsf 1 
$ mt tell 
At block 0. 

我的情況是,我想機能夠創建單獨的壓縮包,然後scp都在磁帶上的歸檔(cron作業)門店放入系統兩個分離的壓縮包。喜歡的東西:

$ tar zcf - /home | ssh tape_archiver "cat > /dev/st0" 

參考:

$ mt status 
SCSI 2 tape drive: 
File number=0, block number=0, partition=0. 
Tape block size 0 bytes. Density code 0x40 (DLT1 40 GB, or Ultrium). 
Soft error count since last status=0 
General status bits on (41010000): 
BOT ONLINE IM_REP_EN 

根據tldp應該可以跳過第一個歸檔。

+0

哇,我認爲磁帶在使用中不再! – jlhonora

+0

我還應該使用什麼來備份文件〜51Gb(CT掃描),它便宜?我不可能將數十張DVD用於單個文件。 – malat

回答

0

看來解決方案是非常容易的,只要使用非迴繞接口:

$ export TAPE=/dev/nst0 

可以看出here

You seem to be using the device /dev/st0 which is a SCSI tape device. There is no problem with using that device, but it will always do a rewind after every completed access to that device. So after you have written a tar file to the device, it will do a rewind afterwards. 

You wil need the device /dev/nst0. The "n" stands for no-rewind. After writing to that device, the tape position stays at the end of the tape. Try using the following commands: 

mt -f /dev/nst0 rewind 
tar cvf /dev/nst0 $HOME 
mt -f /dev/nst0 status