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

Cuckoo com Vmware Esxi

Cuckoo is an open-source malware analysis platform using sandboxing technology. The tool allows people like us to analyze malicious binaries in an isolated environment. Since Cuckoo is commonly used with Oracle VirtualBox as its virtualization platform, a majority of online documentation is focused on configuration using VirtualBox. PlantainStan and I decided to test running Cuckoo on ESXi and document our success. This guide will help with the basic configuration of ensuring Cuckoo properly interacts with ESXi. We will continue to update this post as we make continue to make an even more baller Cuckoo environment! Note: In order to successfully interact with vSphere's API, you will need the VMWare ESX Standard license. API functionality is required for Cuckoo to work with ESX. Configure ESX Since this guide is not a "how to" on installing ESXi, we will assume that you have successfully installed the hypervisor on your system. There

CentOS7 with Snort Barnyard2 Snorby PulledPork SElinux

This post is about how to install Snort "stack" on CentOS7 with potentially all the latest libs an stuff. Here I will install and configure everything to run Snort as IDS. I will write another post shortly how to run it as IPS - INLINE. System details: [ root@nfsec-ids-01 ~ ] # cat /etc/redhat-release CentOS Linux release 7.3.1611 ( Core ) [ root@nfsec-ids-01 ~ ] # uname -a Linux nfsec-ids-01.nfsec.co.uk 3.10.0-514.2.2.el7.x86_64 #1 SMP Tue Dec 6 23:06:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Snort 2.9.9.0 Installation of snort is very basic: yum install https://www.snort.org/downloads/snort/daq-2.0.6-1.centos7.x86_64.rpm yum install https://www.snort.org/downloads/snort/snort-2.9.9.0-1.centos7.x86_64.rpm Register at Snort and download registered rule set: mkdir /usr/local/src/snortrules cd /usr/local/src/snortrules wget https://www.snort.org/rules/snortrules-snapshot-2990.tar.gz?oinkcode = < oinkcode > tar -zxvf snort