Map a disk image file to the next free loop device.
Section: Mount and Unmount
Attach a loop device
bash
bash
sudo losetup -fP disk.imgExplanation
Map a disk image file to the next free loop device.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Mount and Unmount
Mount a device to a directory
Mount a block device using filesystem auto-detection.
Mount a filesystem read-only
Useful for safe inspection or recovery work.