1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/linux/losetup.md
2024-06-11 10:17:57 +05:30

28 lines
590 B
Markdown

# losetup
> Set up and control loop devices.
> More information: <https://manned.org/losetup>.
- List loop devices with detailed info:
`losetup -a`
- Attach a file to a given loop device:
`sudo losetup {{/dev/loop}} /{{path/to/file}}`
- Attach a file to a new free loop device and scan the device for partitions:
`sudo losetup --show --partscan -f /{{path/to/file}}`
- Attach a file to a read-only loop device:
`sudo losetup --read-only {{/dev/loop}} /{{path/to/file}}`
- Detach all loop devices:
`sudo losetup -D`
- Detach a given loop device:
`sudo losetup -d {{/dev/loop}}`