How to use mt and tar ?
Hi,
I'm just trying to use a DLT to backup my Linux System. Obviously, I can't find a good way of using tar and mt. The device /dev/st0 seems to work well : it gives me the number of the block where it points (with mt -f /dev/st0 tell), it rewinds... But as soon as I'm trying to backup and restore with tar the system react as if he throw the data in /dev/null What are my errors? Did I badly configure my DLT? Do I need to use something else than tar?(I didn't succeed with dump-restore but ...) Does someone have an idea:Pengy: There's maybe not enough information. Tell me please. |
What commands are you exactly using? If you trying to add data after each other without rewinding you will have to use the nonrewind device /dev/nst0.
But in any case the following commands should at least give you something: mt -f /dev/st0 rewind tar cvf /dev/st0 testfile (will rewind after this command) tar tvf /dev/st0 |
Trying to better understand
Well in fact, wouldn't it be possible to use the creation of blocks or partitions to quickly find the data on the tape. With such a possibility I could program a shell to remember what is going on which place on the tape and then do it.
With this file I could maybe backup easily? Am I right or is there a better way to do that:Pengy: Thanks by advance Goyome.will.backup.his.system |
Here is all the problem !!
Hi,
I tried to do what you describe but I had the same problem as before. So I just copy what is given on my terminal : [root@MACHINE donnees]# mt -f /dev/nst0 rewind [root@MACHINE donnees]# tar -cvf /dev/nst0 /tmp tar: Removing leading `/' from member names tmp/ tmp/lost+found/ tmp/install.log tar: /dev/nst0: n'a pu écrire seulement 0 sur 10240 octets tar: Erreur non récupérable: fin de l'exécution immédiate [root@MACHINE donnees]# This means that it couldn't write on the device /dev/nst0 and I've got the same problem with the device st0 This makes me think that I have a problem of configuration of the driver, so I printed the status of my DLT [root@MACHINE donnees]# mt -f /dev/st0 status SCSI 2 tape drive: File number=0, block number=0, partition=0. Tape block size 32768 bytes. Density code 0x7f (no translation). Soft error count since last status=0 General status bits on (41010000): BOT ONLINE IM_REP_EN Isn't it a problem in the density code? Do I have to create a partition? Please HELP !!!! :( |
mt densities gives you a list of all the densities. I don't see any 7f in my list. You could look up the densities in the tape drive documentation and try 'mt setdensity number'. What kind of DLT tape is it by the way? And is it recognized properly by the kernel? What does 'cat /proc/scsi/scsi' tell you? And what happens when you try setting the blocksize to something smaller. Like 1024 maybe.
If you create partitions or blocks on the tape then you won't be able to read and write from it using standard tape tools like tar. But if you only use your own program to read and write to the tape then I suppose it could be faster. Depends on how much you read and write to the tape though and the size and amount of the files. I don't know how you would create partitions on a tape in linux though, only done that in windows NT. |
I used tar and mt to make backups on .DAT tapes. If you have problems with tar, then maybe you can try to use the program taper for making backups.
Every time your tape is full you can use mt /dev/st0 rewind to rewind the tape and overwrite your existing data. |
All times are GMT -5. The time now is 02:20 PM. |