Bug 1215370 - Thoroughly misleading error message when running "losetup -f" as non-root user
Thoroughly misleading error message when running "losetup -f" as non-root user
Product: Fedora
Classification: Fedora
Component: util-linux (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Karel Zak
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-04-25 17:42 EDT by Nick Coghlan
Modified: 2015-06-03 06:12 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-06-03 06:12:53 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Nick Coghlan 2015-04-25 17:42:52 EDT
Description of problem:

Running "losetup -f" as a non-root user when no loop devices are available fails with an unhelpful error message that doesn't tell the user they can run "sudo losetup -f" to automatically create a new loopback device.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Run "losetup -f" as a non-root user with no loop devices created (the default)

Actual results:

$ losetup -f
losetup: cannot find an unused loop device: No such file or directory

Expected results:

$ losetup -f
losetup: cannot find an unused loop device (Root access required to automatically create new loop devices)

(It doesn't necessarily need to be that exact message, but there should be an explicit nudge towards "run losetup as root to create a new loop device"

Additional info:

The man pages for losetup, cryptsetup and tcplay also fail to mention this fact, which makes the default behaviour of failing to provide any loop devices by default (as per bug 896160) very confusing when attempting to follow the cryptsetup and tcplay man pages to mount an encrypted file as a volume (as per bug 1019440).
Comment 1 Karel Zak 2015-06-03 06:12:53 EDT
Improved in upstream tree by commit 362f5d203581e895005b91383ea7b1affafd8eba.

I don't think it's good idea to talk about "root", like in many other situations "Permission denied" is good enough.

$ losetup -f
lt-losetup: cannot find an unused loop device: Permission denied

Note You need to log in before you can comment on or make changes to this bug.