For example, I would like to setup mydata.img
to /dev/loop5
, I would expect using the command below. However it gives the error losetp: unexpected arguments.
losetup --show -Pvf /dev/loop5 mydata.img
(-v is optional, just for more verbose output. -P is not a main concern in this question too. It forces partition scan. --show is also optional. It shows the assigned loop device.)
In particular, the simpler command below gives the same losetp: unexpected arguments error.
losetup -f /dev/loop5 mydata.img
I think I am following the syntax below. But why -f
does not setup mydata.img
to /dev/loop5
? I know losetup -f
will find the first unused loop device. But is it possible to assign another loopdev
instead of the first unused found? In particular, there is a loopdev
argument in the syntax below. How should we interpret it?
Set up a loop device:
losetup [-o offset] [--sizelimit size] [--sector-size size] [-Pr] [--show] -f loopdev file
...
-f, --find [file] Find the first unused loop device. If a file argument is present, use the found device as loop device. Otherwise, just print its name.
-f loopdev
is there. This particular manual seems wrong. – Kamil Maciorowski Jan 06 '22 at 07:02losetup
manual page was converted to Asciidoc. – Stephen Kitt Jan 06 '22 at 07:09losetup
manpage and I'm still on 2.36. I've created a PR for util-linux to add the pipe back. – Vojtech Trefny Jan 06 '22 at 08:24