Bug 206296 - mt - write protect is not reported in status
Summary: mt - write protect is not reported in status
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 10.2-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-15 20:58 UTC by andrew
Modified: 2016-01-15 20:58 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andrew 2016-01-15 20:58:29 UTC
The mt command does not show the "write protect" status of a tape. This would presumably apply to other devices that support write protection, but I cannot test for that. 

You cannot write to write protected tapes (see BID9933), and get an error if you try - but it is very hard to find the error message if you tar to a write protected tape using a remote login, and if you use a changer remotely, this is seriously hard to debug! 

So two bugs (possibly feature requests):

1) mt -f /dev/sa0 status
# Should report "Write protected" or "Write enabled" as appropriate
# I tried to implement this myself, but I think it might be easier for someone else to do it!

2) tar c -f /dev/sa0 file
# should write "Error: target is Write protected" to stderr
# which presumably requires significant design effort, as both cam and tar
# would need changes.