LOSETUP(8) LOSETUP(8) losetup - : losetup [-] losetup -l [-a] losetup -j [-o ] ' : losetup -d - ... ' ' : losetup -D : losetup [-o ] [--sizelimit ] [--sector-size ] [--loop-ref ] [-Pr] [--show] -f|-- : losetup -c - losetup ' , ' . -, . , . , ( losetup -a) , , - --list. . , , . --nooverlap --find , . --find, losetup - . 16. , , flock(1), . KiB (=1024), MiB (=1024*1024) GiB, TiB, PiB, EiB, ZiB YiB ( <> ', , <> , <>) KB (=1000), MB (=1000*1000) GB, TB, PB, EB, ZB YB. -a, --all . , , root. . --list. ( --list) . -d, --detach -... ' , ' . , , Linux v3.7, << >>. ' EBUSY , , , . , . , udevadm settle losetup. -D, --detach-all ' ' . -f, --find [] . , , . , . --show ' , -f . -L, --nooverlap , . , , . --find. -j, --associated [-o ] , ' . -o, --offset . ; . . --loop-ref Set reference string. The backwardly compatible default is to use the backing filename as a reference in loop setup ioctl (aka lo_file_name). This option can overwrite this default behavior and set the reference to the string. The reference may be used by udevd in /dev/loop/by-ref. Linux kernel does not use the reference at all, but it could be used by some old utils that cannot read the backing file from sysfs. The reference is readable only for the root user (see --output +REF) and it is restricted to 64 bytes. --sizelimit . ; . . -b, --sector-size ( Linux 4.14). , . -c, --set-capacity - , ' . -P, --partscan . , . 512 . , --sector-size --partscan. -r, --read-only . --direct-io[=on|off] Enable or disable direct I/O for the backing file. The default is off. Specifying either --direct-io or --direct-io=on will enable it. But, --direct-io=off can be provided to explicitly turn it 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 ioctl LOOP_CONFIGURE ioctl. ioctl LOOP_SET_FD LOOP_SET_STATUS64. 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 . losetup util-linux, Linux . util-linux 2.41 2025-03-29 LOSETUP(8)