[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: losetup: cannot find an unused loop device , kernel config of loopback device



Hi,

Colin Williams wrote:
> http://ix.io/3v3i

At least this shows an impressive partition table.
(Among them 5 partitions of size 512 bytes.)


> http://ix.io/3v6K

(Best to be downloaded and viewed in a text editor.)


> I believe the issues arise in
> https://github.com/drocsid/cros-scripts/blob/main/common.sh
> [...]
> +++ sudo losetup --show -f
> /mnt/host/source/src/build/images/kukui/R94-14125.0.2021_08_05_1510-a1/chrom
> iumos_base_image.bin
> losetup: cannot find an unused loop device

According to the man page this aims for acquiring an existing but unused
loop device. But in my local experiments it also creates a new loop device
if all existing ones are occupied.
So this should work if new loop devices can be created at all.


> 10) The path
> /mnt/host/source/src/build/images/kukui/R94-14125.0.2021_08_05_1510-a1/chromiumos_base_image.bin
> does not exist

But

  sudo losetup --show -f non_existing_file_name

yields

  losetup: non_existing_file_name: failed to set up loop device: No such file or directory

and not "cannot find an unused loop device".


So currently i think that at your point 10 your investigation left the road
to the loop device problem.

You should in any case look how many loop devices are occupied before
your script run:

  losetup -l -a

If this does not show a lot of devices, then you will have execute this
command at various places in the script in order to see how the list of
used loop devices evolves during the script run.


Have a nice day :)

Thomas


Reply to: