pojntfx/stfs

Seek/tell relies on scsi2logical option

Opened this issue · 3 comments

This is a really great program. I'm busy getting familiar with it, but I really appreciate the thoughtful UI: serving the tape over FTP server is actually extremely handy for me because I need to back up files from a different machine to the one the tape drive is attached to.

On my drive, however, stfs operation initialize or stfs operation archive panics with input/output error. I traced this down to the fact that seek/tell do not work on the drive (even using the mt command from mt-st package) until I run sudo mt -f /dev/nst0 stsetoptions scsi2logical. This seems to persist until the machine reboots.

Did you hit this at all? I can try adding in the syscall to set this parameter as part of MagneticTapeIO methods? Based on strace, all the mt command boils down to is an MTIOCTOP ioctl. And the flag seems to be defined here so I could probably work out what the full ioctl needs to be.

But I figured I'd ask, because you are likely a lot more familiar with how to do ioctls to tape drives than I am.

Hmm, that is a really good point. I'm not sure if adding it as part of the CLI though is the right idea - after all, this isn't something that should be run with every command or every time stfs is run, only once for the setup. How do you feel about me adding it to the documentation instead? I've been working on a similar project that exposes tapes as block devices recently (https://github.com/pojntfx/tapisk) and there I plan on doing the same :)

Yeah, adding something to the docs makes sense as an alternative. Perhaps also the app could catch the error and return an augmented error that says something like "error ... (you might need to enable ... see docs)"

That def. sounds like a good idea! I'm sure that we can add a "check" before we mount the FS and exit earlier!