Util-Linux package development
 help / color / mirror / Atom feed
From: Nuno Silva <nunojsilva@ist.utl.pt>
To: util-linux@vger.kernel.org
Subject: Re: `losetup --remove` is confusing, and misuse silently fails
Date: Sat, 11 Oct 2025 11:16:45 +0100	[thread overview]
Message-ID: <10cdaqe$vrk$1@ciao.gmane.io> (raw)
In-Reply-To: a5909aac-3f54-4fce-8785-410535dd4098@telfort.nl

On 2025-10-10, Benno Schulenberg wrote:

> After setting up a loop device with:
>
>   # ./losetup loop4 some.img
>
> I wanted to see what happens when trying to "remove" it
> (since the man page says it is "not recommended"):
>
>   # ./losetup -R loop4
>
> There is no feedback, but it failed:
>
>   # echo $?
>   1
>
> When a command fails, shouldn't it print an error message?

For all commands after this one in your message, where there was no
output, what was the exit status?

[...]
> Trying a different order of the options:
>
>   # ./losetup -d -R loop4
>   losetup: /dev/-R: detach failed: No such file or directory
>
> Huh?  Why does it try to interpret an option as a loop device name?

The online manual here says that -d takes one argument, so my
understanding is that that is expected? (Just as for -R, apparently:)

>   # ./losetup -d loop4 -R
>   /home/ben/Sources/util-linux/.libs/losetup: option requires an argument -- 'R'
>   Try 'losetup --help' for more information.
>
>   # ./losetup -d loop4 -R loop4
>
> Oh.  Surprisingly, this last invocation worked.

[...]

-- 
Nuno Silva


  reply	other threads:[~2025-10-11 10:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-10  9:41 `losetup --remove` is confusing, and misuse silently fails Benno Schulenberg
2025-10-11 10:16 ` Nuno Silva [this message]
2025-10-11 12:47   ` [DKIM] " Benno Schulenberg
2025-10-14 10:06 ` Karel Zak
2025-10-16 10:28 ` Karel Zak
2025-10-17  8:37   ` Benno Schulenberg
2025-10-17  8:55   ` Benno Schulenberg
2025-10-21 10:00     ` Karel Zak
2025-10-21 13:49       ` Benno Schulenberg
2025-11-03 12:49         ` Karel Zak
2025-11-03 14:42           ` Benno Schulenberg
2025-11-07 10:16             ` Karel Zak
2025-11-07 11:21               ` Benno Schulenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='10cdaqe$vrk$1@ciao.gmane.io' \
    --to=nunojsilva@ist.utl.pt \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox