losetup
Associate a loopback device with a file, or show current file (if any) associated with a loop device. toybox
On Linux
Linux
losetup [-cdrs] [-o OFFSET] [-S SIZE] {-d DEVICE...|-j FILE|-af|{DEVICE FILE}}
-aIterate through all loopback devices-fFind first unused loop device (may create one)-j FILEIterate through all loopback devices associated with FILE-cCheck capacity (file size changed)-d DEVDetach loopback device-DDetach all loopback devices-sShow device name (alias --show)-o OFFStart association at offset OFF into FILE-rRead only-S SIZELimit SIZE of loopback association (alias --sizelimit)Linux
Set up and control loop devices.
List loop devices with detailed info
losetup --allIdentifyAttach a file to a given loop device
sudo losetup /dev/loop /path/to/fileIdentifyAttach a file to a new free loop device and scan the device for partitions
sudo losetup --show --partscan --find /path/to/fileIdentifyAttach a file to a read-only loop device
sudo losetup --read-only /dev/loop /path/to/fileIdentifyDetach all loop devices
sudo losetup --detach-allIdentifyDetach a given loop device
sudo losetup --detach /dev/loopIdentify