LOSETUP(8) losetup - : losetup [-] losetup -l [-a] losetup -j [-o ] : losetup -d - ... : losetup -D : losetup [-o ] [--sizelimit ] [--sector-size ] [-Pr] [--show] -f| - : losetup -c - losetup , . loopdev, . , . (., losetup -a) --list . . , , . --nooverlap --find . --find, losetup . 16. flock(1)* . KiB (=1024), MiB (=1024*1024), GiB, TiB, PiB, EiB, ZiB YiB (,,iB" , ., ,,K" ,,KiB") KB (=1000), MB (=1000*1000), GB, TB, PB, EB, ZB YB. -a, --all . . --list. ( --list) . -d, --detach -... Detach the file or device associated with the specified loop device(s). Note that since Linux v3.7 kernel uses "lazy device destruction". The detach operation does not return EBUSY error anymore if device is actively used by system, but it is marked by autoclear flag and destroyed later. Even if the device is not used, the loop device can be destroyed later. If you need to wait for a complete removal of the loop device, call udevadm settle after losetup. -D, --detach-all . -f, --find [] . , . , . --show -f . -L, --nooverlap . . --find. -j, --associated [-o ] . -o, --offset . ; . --loop-ref . ,,ioctl" (. lo__). . ,,udevd" ,,/dev/loop/by-ref". , . ( --output +REF) 64 . --sizelimit . ; . -b, --sector-size ( 4.14). . -c, --set-capacity _ . -P, --partscan . . 512 , --sector-size --partscan. -r, --read-only . --direct-io[=on|off] / . off. --direct-io --direct-io=on . --direct-io=off . -v, --verbose . -l, --list -a, ; . --output, --noheadings, --raw, --json. -O, --output [,]... --list-. --help . --output-all . -n, --noheadings --list . --raw --list . -J, --json JSON --list . ,,Cryptoloop" ,,dm-crypt"-. cryptsetup(8). losetup 0 , . losetup , 1 2 . 2.37 losetup LOOP_CONFIGURE ,,ioctl" ,,ioctl" . LOOP_SET_FD LOOP_SET_STATUS64 ,,ioctl"- . LOOPDEV_DEBUG=all . /dev/loop[0..N] /dev/loop-control . # dd if=/dev/zero of=~/file.img bs=1024k count=10 # losetup --find --show ~/file.img /dev/loop0 # mkfs -t ext2 /dev/loop0 # mount /dev/loop0 /mnt ... # umount /dev/loop0 # losetup --detach /dev/loop0 Karel Zak , Theodore Ts'o . For bug reports, use the issue tracker . losetup ,,util-linux" . util-linux 2.41 2025-03-29 LOSETUP(8)