Re: Multiple slices on LTO6 tape

"Petr Skoda" <[email protected]> Wed, 08 Jun 2022 21:11:07 +0200 (CEST)
Newsgroups gmane.comp.sysutils.backup.dar.support
Message-ID <[email protected]>
Dear Denis,




I have read all the threads you mention below as well as I was searching in 
dar support archive using keywords as tape LTO etc ...

I have also read a LOT of stuff about tape, mt, tar ... in general and also 
on LTFS.

My conclusion is :




Your solution with symlink is NOT mentioned anywhere 


I am afraid that your ide to make a symlink to block device as the tape is 
wrong.

IMHO you can not use the same open file call as you do with ordinary file 
backup.1.dar

So the idea (as I understand you correctly , you suggest to make a symlink 
from the dumy file name - e.g. mybackup.1.dar to a tape device /dev/nst0

in order to cicumvent the problem of the filename argument - as the dar 
expects the generic name mybackup  as an argument .

I think this could be done by allowing the full filename as an argument 
(instead of the automatic adding of .n.dar)

But anyway I am afraid the opening of the file in such way does not work

I have made an experiment 





dar -c  myback  -R /home/skoda


dd if=myback.1.dar of=/dev/nst0




Now I make a symlink from /dev/nst0 to dummy file bigbackup.1.dar

sudo ln -s /dev/nst0 bigbackup.1.dar




Now the bigbackup.1.dar can be used instead of /dev/nst0 in command e.g. 


mt -f  bigbackup.1.dar status





SCSI 2 tape drive:
File number=1, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x5a (LTO-6).
Soft error count since last status=0
General status bits on (81010000):
 EOF ONLINE IM_REP_EN



So the link really works.




BUT not as dar argument 





When I use the command you suggest 





dar -C backup_isolated_cat -A bigbackup --sequential-read

or simply 


dar -l  bigbackup --sequential-read

the result is the same:




bigbackup.1.dar has a bad or corrupted header, please provide the correct 
file. [return = YES | Esc = NO]




The reason why the header is corrupted is seen by strace




openat(AT_FDCWD, "/home/skoda/bigbackup.1.dar", O_RDONLY) = 4
fadvise64(4, 0, 0, POSIX_FADV_NORMAL)   = 0
fstat(4, {st_mode=S_IFCHR|0660, st_rdev=makedev(9, 128), ...}) = 0
read(4, 0x7ffebbd5d0ac, 4)              = -1 ENOMEM (Cannot allocate memory)



It is result of a call 


strace dar -l  bigbackup --sequential-read




As it is seen, the opening of the file causes the memory allocation problem.




So to conclude - the symlink may not be used for opening the block device in
dar.




Anyway I think the dar seems to be the best utility  I have found so far - 
having lot of features including the catalogue capabilities , but still very
simple for calling from command line (in comparison to complex systems as 
bacula etc...)




If I  can ask you for future improvement, I would suggest to modify the code
to allow reading of individual slices (i.e. tapes ) even if the content is 
not consistent (i..e the slices 2 and more will have some file on the 
boundary but the listing still can be done after ignoring this - when 
finding next escape sequences.   So each slice could be read partly to 
identify what is there. It is important if you want to read a tape without 
knowing what is there.




But of course it would be perfect to write a small header in each slice - so
the individual tapes could be read easily.




But I understand it is a lot of work  and needs to change the dar format. 
Anyway it would help a lot.




BTW - LTFS has a lot of problems - so it is not good replacement for dar on 
tapes (it seems not to support multiple tapes either, moreover the symlink 
and special files cannot be written - so you cannot backup the system 
partition with it ...




Best regards,




Petr



























---------- Původní e-mail ----------
Od: Denis Corbin <[email protected]>
Komu: [email protected]
Datum: 31. 5. 2022 19:42:18
Předmět: Re: [Dar-support] Multiple slices on LTO6 tape 
"Le 31/05/2022 à 02:08, Petr Skoda a écrit : 
> Dear Denis, 

Hi Petr, 

> 
> after many experiments with different block sizes and writting the 
> slices either with dar_split or dd 
> using your link idea below, I came to the conclusion that the things DO 
> NOT WORK as you suppose (you admitted you did not have tape unit to test 
> it). 

Sorry to read you could not have it working. That's correct I do not 
have any tape device, the information I provided was just from former 
discussion with other users that had the same and approaching concern 
and which gave their feedback in this mailing-list, which archive is 
open and available: 

https://sourceforge.net/p/dar/mailman/message/36155625/ 
https://sourceforge.net/p/dar/mailman/message/35548551/ 
https://sourceforge.net/p/dar/mailman/message/36186874/ 
https://sourceforge.net/p/dar/mailman/message/35030573/ 
https://sourceforge.net/p/dar/mailman/message/35776798/ 
and so on... 

Maybe you can leverage the experience of others by searching the archive: 

https://sourceforge.net/p/dar/mailman/dar-support/ 

But maybe dar/dar_split is not adapted to your need, then you will have 
to find another solution. 

[...] 


> 
> best regards, 
> 
> Petr Skoda 
> 

Cheers, 
Denis 
"