LinearTapeFileSystem / ltfs

Reference implementation of the LTFS format Spec for stand alone tape drive
BSD 3-Clause "New" or "Revised" License
255 stars 76 forks source link

Cannot access tape drive out of container #439

Closed alwe2710 closed 8 months ago

alwe2710 commented 8 months ago

Hello, I know this is a very unusual case of use. I'm running a Proxmox server which has a tape library directly plugged into an HBA. I set up the cgroup mapping of /dev/sg0 to /dev/sg12 to avoid any issues. That's the first thing I had to do to get further output. However, now I'm getting this message:

75 LTFS17089I Distribution: . 75 LTFS17089I Distribution: NAME="Arch Linux". 75 LTFS14063I Sync type is "time", Sync time is 300 sec. 75 LTFS17085I Plugin: Loading "sg" tape backend. 75 LTFS17085I Plugin: Loading "unified" iosched backend. 75 LTFS14095I Set the tape device write-anywhere mode to avoid cartridge ejection. 75 LTFS30209I Opening a device through sg-ibmtape driver (0). 75 LTFS30288I Opening a tape device for drive serial 0. 75 LTFS12012E Cannot open device: failed backend open call. 75 LTFS10004E Cannot open device '0'.

It seems to fail to open some device. I sadly don't know what else it needs to access to work properly. I'll happily provide further information if needed.

piste-jp commented 8 months ago

It looks a command line that you specified is wrong because LTFS tried to open device file 0.

Could you provide your command line typed in ?

alwe2710 commented 8 months ago

I've just been running sudo ltfs -o list_devices out of the bash

piste-jp commented 8 months ago

I've just been running sudo ltfs -o list_devices out of the bash

Your command line is not correct, it shall be ltfs -o device_list...

piste-jp commented 8 months ago

I'm really confused because I cannot imagine what is going on your side from your description.

# ltfs -o device_list
50c4 LTFS14000I LTFS starting, LTFS version 2.4.0.0 (10022), log level 2.
50c4 LTFS14058I LTFS Format Specification version 2.4.0.
50c4 LTFS14104I Launched by "/home/piste/ltfsoss/bin/ltfs -o device_list".
50c4 LTFS14105I This binary is built for Linux (x86_64).
50c4 LTFS14106I GCC version is 4.8.5 20150623 (Red Hat 4.8.5-11).
50c4 LTFS17087I Kernel version: Linux version 3.10.0-514.10.2.el7.x86_64 (mockbuild@x86-039.build.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Mon Feb 20 02:37:52 EST 2017 i386.
50c4 LTFS17089I Distribution: NAME="Red Hat Enterprise Linux Server".
50c4 LTFS17089I Distribution: Red Hat Enterprise Linux Server release 7.3 (Maipo).
50c4 LTFS17089I Distribution: Red Hat Enterprise Linux Server release 7.3 (Maipo).
50c4 LTFS17085I Plugin: Loading "sg" tape backend.
Tape Device list:.
Device Name = /dev/sg43, Vender ID = IBM    , Product ID = ULTRIUM-TD5    , Serial Number = 9A700L0077, Product Name = [ULTRIUM-TD5] .
Device Name = /dev/sg38, Vender ID = IBM    , Product ID = ULT3580-TD6    , Serial Number = 00013B0119, Product Name = [ULT3580-TD6] .
Device Name = /dev/sg37, Vender ID = IBM    , Product ID = ULT3580-TD7    , Serial Number = 00078D00C2, Product Name = [ULT3580-TD7] .
alwe2710 commented 8 months ago

Sure, I'll do that. The list_devices has been my fault, sorry for that. Now I'm not getting the error anymore after typing it correctly. I have also solved my second problem. The HBA has been passed through into a virtual machine which I have shut down a day before. The HBA however has not been remounted in the Host. So there was nothing being passed through into the container because it was not available in the Host in that moment of time. I did a reboot on the Host, now the tape drive shows up correctly.

75 LTFS14000I LTFS starting, LTFS version 2.4.5.0 (10502), log level 2.
75 LTFS14058I LTFS Format Specification version 2.4.0.
75 LTFS14104I Launched by "ltfs -o device_list".
75 LTFS14105I This binary is built for Linux (x86_64).
75 LTFS14106I GCC version is 13.2.1 20230801.
75 LTFS17087I Kernel version: Linux version 6.5.11-8-pve (build@proxmox) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC PMX 6.5.11-8 (2024-01-30T12:27Z) i386.
75 LTFS17089I Distribution: .
75 LTFS17089I Distribution: NAME="Arch Linux".
75 LTFS17085I Plugin: Loading "sg" tape backend.
Tape Device list:.
Device Name = /dev/sg13 (7.0.0.0), Vendor ID = IBM     , Product ID = ULTRIUM-HH6     , Serial Number = 90WT126589, Product Name =[ULTRIUM-HH6].