Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot mount a tape after data is copied #474

Open
upndr-octro opened this issue Jul 31, 2024 · 16 comments
Open

Cannot mount a tape after data is copied #474

upndr-octro opened this issue Jul 31, 2024 · 16 comments
Labels

Comments

@upndr-octro
Copy link

upndr-octro commented Jul 31, 2024

There are many cases that tape is not able to mount in a sequence below. (Modified by @piste-jp)

Report from the originator

the main problem is that out of 10 cartridges only 4 of them is showing this error. I'm really confused with this. As i have put data in all of the cartridges in the same way then why is it showing this error. Usually i am putting data with
cp
mv
commands.
i am using the below commands for tape operations.

% sudo mtx -f /dev/sg2 status
% sudo umount /home/tapedata1
% sudo mt -f /dev/st0 offline
% sudo mtx -f /dev/sg2 unload 25 0
% sudo mtx -f /dev/sg2 load 1 0
% sudo mkltfs -d /dev/sg1    #this command i use for the first time only
% sudo ltfs -o devname=/dev/sg1 /home/tapedata1

Mount log

Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS14000I LTFS starting, LTFS version 2.4.5.0, log level 2.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS14058I LTFS Format Specification version 2.4.0.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS14104I Launched by "ltfs -o devname=/dev/sg1 /home/tapedata1".
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS14105I This binary is built for Linux (x86_64).
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS14106I GCC version is 4.8.5 20150623 (Red Hat 4.8.5-16).
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS17087I Kernel version: Linux version 3.10.0-1160.99.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Wed Sep 13 14:19:20 UTC 2023 i386.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS17089I Distribution: NAME="CentOS Linux".
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS17089I Distribution: CentOS Linux release 7.9.2009 (Core).
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS17089I Distribution: CentOS Linux release 7.9.2009 (Core).
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS17089I Distribution: CentOS Linux release 7.9.2009 (Core).
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS14063I Sync type is "time", Sync time is 300 sec.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS17085I Plugin: Loading "sg" tape backend.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS17085I Plugin: Loading "unified" iosched backend.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS14095I Set the tape device write-anywhere mode to avoid cartridge ejection.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg1).
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS30250I Opened the SCSI tape device 15.0.0.0 (/dev/sg1).
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS30207I Vendor ID is IBM     .
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS30208I Product ID is ULTRIUM-HH9     .
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS30214I Firmware revision is PA63.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS30215I Drive serial is 10WT015978.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS30285I The reserved buffer size of /dev/sg1 is 524288.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS30294I Setting up timeout values from RSOC.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS30871I (no message found).
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS17160I Maximum device block size is 1048576.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS11330I Loading cartridge.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS30252I Logical block protection is disabled.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS11332I Load successful.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS17157I Changing the drive setting to write-anywhere mode.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS11005I Mounting the volume.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS30252I Logical block protection is disabled.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS11175E Cannot read ANSI label: expected 80 bytes, but received 0.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS11170E Failed to read label (-1012) from partition 0.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS11009E Cannot read volume: failed to read partition labels.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS14013E Cannot mount the volume.
Jul 31 06:35:55  ltfs[116858]: 1c87a LTFS30252I Logical block protection is disabled.
@piste-jp

This comment was marked as off-topic.

@upndr-octro

This comment was marked as off-topic.

@piste-jp

This comment was marked as off-topic.

@upndr-octro

This comment was marked as off-topic.

@upndr-octro

This comment was marked as off-topic.

@piste-jp

This comment was marked as off-topic.

@upndr-octro

This comment was marked as off-topic.

@piste-jp

This comment was marked as off-topic.

@upndr-octro
Copy link
Author

upndr-octro commented Jul 31, 2024

@piste-jp Thanks for the response.

But the main problem is that out of 10 cartridges only 4 of them is showing this error. I'm really confused with this. As i have put data in all of the cartridges in the same way then why is it showing this error. Usually i am putting data with
cp
mv
commands.
i am using the below commands for tape operations.

mtx -f /dev/sg2 status

sudo umount /home/tapedata1

sudo mt -f /dev/st0 offline

mtx -f /dev/sg2 unload 25 0

sudo mtx -f /dev/sg2 load 1 0

mkltfs -d /dev/sg1    #this command i use for the first time only

sudo ltfs -o devname=/dev/sg1 /home/tapedata1

Could you please tell me what is the main cause ?

@piste-jp
Copy link
Member

piste-jp commented Aug 1, 2024

Oops, This is the most important info... Why don't you provide this information when you opened this issue?

For me, it is obvious that this kind of problem happens.

Problem is touching to /dev/st0 by sudo mt -f /dev/st0 offline just after sudo umount /home/tapedata1.

The ltfs process you launched is not finished yet when the command sudo umount /home/tapedata1 returns to your shell (This is the spec of FUSE so we cannot do anything about this.). So the ltfs process is writing a latest index on tape when sudo mt -f /dev/st0 offline is issued actually.

On the other hand, st device issues REWIND command when it is closed (PLEASE confirm manual!!!). As a result, tape position in the drive is unexpectedly changed while the ltfs process is writing latest index on tape and data sequence is corrupted.

You need to wait the ltfs process is finished completely before issuing sudo mt -f /dev/st0 offline, technically (You can use pidof command I think).

Basically, your procedure is really dangerous to us. I strongly recommend not to touch any st devices while you are using LTFS.

My recommendation is

  1. Move target tape by sudo mtx -f /dev/sg2 load 1 0
  2. Format tape by sudo mkltfs -d /dev/sg1 if you need
  3. Mount LTFS by sudo ltfs -o devname=/dev/sg1 -o eject /home/tapedata1
  • -o eject is the option to eject tape from drive after unmount
  1. Copy your data
  2. Unmount LTFS by sudo umount /home/tapedata1
  3. Wait ltfs process finishes by pidof ltfs (sudo is required ?? I don't know.)
  4. The tape shall be ejected when ltfs process finishes because of -o eject option
  5. Move target tape to a slot by sudo mtx -f /dev/sg2 unload 25 0

Finally, the LTFS project never supports the drive which is in a library. You need to use IBM's LTFS LE or other S/W to support library environment. Please use it with your own risk and please don't think you can have a quick support from this project.

@piste-jp piste-jp changed the title LTFS11170E Failed to read label (-1012) from partition 0. 1c87a LTFS11009E Cannot read volume: failed to read partition labels. 1c87a LTFS14013E Cannot mount the volume. 1c87a LTFS30252I Logical block protection is disabled. Cannot mount a tape after write Aug 1, 2024
@piste-jp piste-jp changed the title Cannot mount a tape after write Cannot mount a tape after data is copied Aug 1, 2024
@piste-jp
Copy link
Member

piste-jp commented Aug 1, 2024

@upndr-octro
Copy link
Author

upndr-octro commented Aug 1, 2024

@piste-jp Thanks for your quick responses.

How would i be able to recover the data from the data cartridges that are failing to mount on my server? showing this error

12da LTFS11175E Cannot read ANSI label: expected 80 bytes, but received 0. 12da LTFS11170E Failed to read label (-1012) from partition 0. 12da LTFS11009E Cannot read volume: failed to read partition labels. 12da LTFS14013E Cannot mount the volume. 12da LTFS30252I Logical block protection is disabled.

is there any way to recover data?

@piste-jp
Copy link
Member

piste-jp commented Aug 1, 2024

No, no convenient way for normal level users.

Technically, it depends on how data corrupted on tape. But super expert, whole scan of tape, large capacity of work space (disk), and so much working time is required.

@upndr-octro
Copy link
Author

@piste-jp
It would be really helpful if you can suggest me some troubleshooting which i can perform on the data cartridge. As the data it has is really important to me.

thanks

@upndr-octro
Copy link
Author

upndr-octro commented Aug 1, 2024

@piste-jp
As you told me that st device issues REWIND. Is there anything with which we can move the tape in FORWARD direction ? so that we can read the tape ?

like this example
mt -f /dev/st0 fsf 2 # Forward space to the third file

@piste-jp
Copy link
Member

piste-jp commented Aug 2, 2024

I'm really sorry to say you look you are not familiar with tape device and the LTFS format. So I believe I need to educate you from the beginning about what tape drive is and what the LTFS format is.

I don't want to spend my personal time such kind of thing, honestly.

Your data recovery is completely out-of-scope of the project and also the project doen't have any responsibility about that at all clearly.

I will not make another comments more than this on this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants