Pular para o conteúdo principal

Comandos com Fitas LTO-5

Instalação



1. Instalando os pacotes necessários, como uso Debian:

# apt-get install mt-st mtx

2. Verificando se o Linux reconheceu o driver:

# dmesg | grep scsi
[ 1.343286] scsi0 : sata_via
[ 1.354041] scsi1 : sata_via
[ 1.748725] scsi 0:0:0:0: Direct-Access ATA ST32000542AS CC34 PQ: 0 ANSI: 5
[ 2.132693] scsi 1:0:0:0: Direct-Access ATA ST32000542AS CC34 PQ: 0 ANSI: 5
[ 2.352554] scsi2 : ioc0: LSI53C1020A A1, FwRev=01032700h, Ports=1, MaxQ=255, IRQ=24
[ 4.507518] scsi 2:0:6:0: Sequential-Access IBM ULTRIUM-TD3 93G6 PQ: 0 ANSI: 3
[ 4.507588] scsi 2:0:6:0: Information Units disabled by blacklist
[ 4.507649] scsi target2:0:6: Beginning Domain Validation
[ 4.549424] scsi target2:0:6: Ending Domain Validation
[ 4.549555] scsi target2:0:6: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 127)
[ 4.556469] scsi 2:0:6:1: Medium Changer DELL PV-124T 0075 PQ: 0 ANSI: 2
[ 59.901052] ch 2:0:6:1: Attached scsi changer ch0
[ 59.901625] st 2:0:6:0: Attached scsi tape st0
[ 60.058964] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 60.059805] sd 1:0:0:0: Attached scsi generic sg1 type 0
[ 60.060737] st 2:0:6:0: Attached scsi generic sg2 type 1
[ 60.062052] ch 2:0:6:1: Attached scsi generic sg3 type 8


No meu caso listei o drive no device /dev/st0:

[ 4.507518] scsi 2:0:6:0: Sequential-Access IBM ULTRIUM-TD3 93G6 PQ: 0 ANSI: 3
[ 59.901625] st 2:0:6:0: Attached scsi tape st0


E listei o changer no device /dev/sg3:

[ 4.556469] scsi 2:0:6:1: Medium Changer DELL PV-124T 0075 PQ: 0 ANSI: 2
[ 60.062052] ch 2:0:6:1: Attached scsi generic sg3 type 8


3. Caso não encontre nada, levante os módulos st, mptbase e mptscsih e verifique de novo no dmesg:

# modprobe st
# modprobe mptbase
# modprobe mptscsih


4. Criei um link do sg3 para changer pois o comando mtx por padrão procura nele:

# ln /dev/sg3 /dev/changer

Comandos para o conhecimento

Agora alguns comandos para conhecimento.

mtx:

# mtx status Storage Changer /dev/changer:1 Drives, 8 Slots ( 0 Import/Export ) Data Transfer Element 0:Empty Storage Element 1:Full :VolumeTag=000011L3 Storage Element 2:Full :VolumeTag=000012L3 Storage Element 3:Full :VolumeTag=000013L3 Storage Element 4:Full :VolumeTag=000014L3 Storage Element 5:Full :VolumeTag=000015L3 Storage Element 6:Full :VolumeTag=000016L3 Storage Element 7:Full :VolumeTag=000017L3 Storage Element 8:Empty A saída acima mostra que não existe nenhuma fita no drive aonde vamos gravar o backup e existem 8 slots, no meu caso no Left Magazine com 7 fitas na espera.

# mtx load 1 0

Faz com que a fita que está no "Storage Element 1" vá para o drive "Data Transfer Element 0", ficando assim:

# mtx status Storage Changer /dev/changer:1 Drives, 8 Slots ( 0 Import/Export ) Data Transfer Element 0:Full (Storage Element 1 Loaded):VolumeTag = 000011L3 Storage Element 1:Empty Storage Element 2:Full :VolumeTag=000012L3 Storage Element 3:Full :VolumeTag=000013L3 Storage Element 4:Full :VolumeTag=000014L3 Storage Element 5:Full :VolumeTag=000015L3 Storage Element 6:Full :VolumeTag=000016L3 Storage Element 7:Full :VolumeTag=000017L3 Storage Element 8:Empty Para retornar a fita do drive para o storage número 1 uso o unload 1 0:

# mtx unload 1 0

Você pode sempre verificar com o mtx status.

Então para colocar a fita 7 no drive você executaria:

# mtx load 7 0

E para voltar no mesmo lugar:

# mtx unload 7 0

Você também pode transferir a fita de um lugar do Storage Element para outro. Ex.: Transferir do 7 para o 8:

# mtx transfer 7 8

Também pode inverter a posição das fitas com o invert:

# mtx invert 4 3

Existe também o mtx next, que tira a fita do drive e coloca a próxima fita usando a sequência do storage

Para maiores informações:

# man mtx

Os meios de uso do mt mais impotantes são:

# mt -f /dev/st0 rewind (rebobinar a fita)
# mt -f /dev/st0 erase (formatar a fita)
# mt -f /dev/st0 eject (ejeta a fita)

Para maiores informações:

# man mt

tar:

# tar -c -v -M -L 417333248 --new-volume-script=/etc/scripts/script-multi.sh -f /dev/st0 /diretorio-a-ser-becapeado

Onde:
  • -c: cria
  • -v: verbose
  • -M: opção multivolume
  • -L: tamanho que será gravado para pedir outra fita N*1024
  • --new-volume-script=/etc/scripts/script-multi.sh: na hora que ele acabar de gravar aquela quantidade estipulada no -L e faltar arquivo para gravar ele chama o script
  • -f: o arquivo aonde vai gravar

Para listar os arquivos com multivolume:

# tar -t -v -M -f /dev/st0

Para recuperar um arquivo:

# tar -x -v -M -f /dev/st0 arquivo_a_ser_recuperado

Com essas informações criei um script em shell para fazer o backup.

Fonte:  https://www.vivaolinux.com.br/artigo/Backup-em-fita-DAT-com-multivolume-%28LTO3%29



 
Testar a unidade de fita Com Bacula para ter certeza que a mesma funcione 
corretamente
 

Comentários

Postagens mais visitadas deste blog

Upgrading Iomega ix2-200 to Cloud Edition

You just got your ix2-200 from eBay and there are no disks inside the NAS. Or you have a brand new ix2-200 -yet you could not afford Cloud Edition. No problem. With just a USB stick and a SATA adapter or desktop PC, you will easily upgrade your ix2-200 to ix2-200 Cloud Edition. Not only your ix2-200 will have a brand new interface and Cloud options, but also will become Mac OS X Lion compatible! What do we need? Decrypted! ix2-200 Cloud Edition Firmware 3.1.12.47838 S endSpace or RapidShare * USB Flash Drive with at least 2 GB capacity and LED indicator** SATA to USB adapter or desktop PC Toothpick or paperclip Preparing Hard Drives Preparing hard drives is the first step because you have to wipe all the data inside the hard drives and make them just like brand new. We used 2 x Seagate 2 TB 5900 RPM Drives. Backup any files if you have and then remove both disks from ix2-200 and attach them to SATA to USB adapter or your desktop PC's SATA port. Using ...

How to Fix sub-process /usr/bin/dpkg returned an error code (1)

Introduction The error message “Sub-process /usr/bin/dpkg returned an error code (1)” indicates a problem with the package installer. This can happen in Ubuntu after a failed software installation, or if the installer becomes corrupted. The key phrase in this error is /usr/bin/dpkg. This refers to the dpkg package installer for Linux. A package installer is an application that tracks software, updates, and dependencies. If it is damaged, any new software installation will cause this error message. We cover several possible solutions, from easily-solved and straightforward solutions to more complex processes. This guide will help you resolve the dpkg returned an error code 1 on an Ubuntu operating system. Prerequisites A user account with sudo privileges A terminal window/command-line ( Ctrl - Alt - T ) Options to Fix sub-process /usr/bin/dpkg returned an error code (1) Method 1: Reconfigure dpkg Database ...

How to Create Reports from Audit Logs Using ‘aureport’ on CentOS/RHEL

  What is aureport? aureport is a command line utility used for creating useful summary reports from the audit log files stored in /var/log/audit/ . Like ausearch , it also accepts raw log data from stdin. It is an easy-to-use utility; simply pass an option for a specific kind of report that you need, as shown in the examples below. Create Report Concerning Audit Rule Keys The aurepot command will produce a report about all keys you specified in audit rules, using the -k flag. # aureport -k Report Audit Rule Keys You can enable interpreting of numeric entities into text (for example convert UID to account name) using the -i option. # aureport -k -i Create Report About Attempted Authentications If you need a report about all events relating to attempted authentications for all users, use the -au option. # aureport -au OR # aureport -au -i   Summary of Login Authentication Produce Report Concerning Logins The -l option tells aureport to ge...