ENOTBLK
Linux / POSIXERRORCriticalDeviceHIGH confidence

Block Device Required

Production Risk

Low — mount failures are obvious and do not cause data loss.

What this means

ENOTBLK (errno 15) is returned when an operation requires a block device but was given something else — for example, trying to mount a regular file or character device directly using mount(2) without the loop device.

Why it happens
  1. 1Calling mount(2) with a path that is not a block device and not using the loop device
  2. 2Passing a regular file or character device where a block device is expected
How to reproduce

Trying to mount a regular file directly.

trigger — this will error
trigger — this will error
# Shell: mount without loop option
mount /path/to/disk.img /mnt
# mount: /path/to/disk.img: not a block device

expected output

mount: /path/to/disk.img: not a block device (ENOTBLK)

Fix

Use the loop option to mount image files

WHEN When mounting disk images or ISO files

Use the loop option to mount image files
mount -o loop /path/to/disk.img /mnt
# Or with losetup:
losetup /dev/loop0 /path/to/disk.img
mount /dev/loop0 /mnt

Why this works

The loop device presents a file as a block device, satisfying the kernel's requirement for mount operations.

Sources
Official documentation ↗

Linux Programmer Manual mount(2)

losetup(8)

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Linux / POSIX errors