Upon listing the blocks using lsblk
, I found 14 look blocks listed, from loop 0 to loop 13.
me@alpha:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 87.9M 1 loop /snap/core/5662
loop1 7:1 0 140.7M 1 loop /snap/gnome-3-26-1604/74
loop2 7:2 0 3.7M 1 loop /snap/gnome-system-monitor/57
loop3 7:3 0 140.9M 1 loop /snap/gnome-3-26-1604/70
loop4 7:4 0 34.6M 1 loop /snap/gtk-common-themes/818
loop5 7:5 0 42.1M 1 loop /snap/gtk-common-themes/701
loop6 7:6 0 89.5M 1 loop /snap/core/6130
loop7 7:7 0 2.3M 1 loop /snap/gnome-calculator/238
loop8 7:8 0 130.2M 1 loop /snap/gnome-3-28-1804/4
loop9 7:9 0 14.5M 1 loop /snap/gnome-logs/45
loop10 7:10 0 13M 1 loop /snap/gnome-characters/124
loop11 7:11 0 53.7M 1 loop /snap/core18/536
loop12 7:12 0 13M 1 loop /snap/gnome-characters/139
loop13 7:13 0 2.3M 1 loop /snap/gnome-calculator/260
sda 8:0 0 113G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 112.5G 0 part /
However, when I list using ls /dev
and find blocks using grep 'loop'
, I found 15 blocks listed, with an extra loop14
shown.
me@alpha:~$ ls /dev | grep 'loop'
loop0
loop1
loop10
loop11
loop12
loop13
loop14
loop2
loop3
loop4
loop5
loop6
loop7
loop8
loop9
loop-control
Why loop14
is not listed from lsblk
?
lsblk
lists loop devices with a backing file. In your case, loop devices 0-13 have backing files, and show up.losetup --find
, used to find the next available loop device, automatically creates a new loop device if all existing loop devices are in use (if run as root). So some process might have runlosetup --find
as root to look for an available loop device, and probably didn't use it.Example:
I have seven loop devices, all backed:
I ask
losetup
for the next available loop device as root:And
losetup
has created this for me:But it's not in
lsblk
:Because it's not backed by anything usable as a block device.