tldr/pages/linux/losetup.md

29 lines
590 B
Markdown
Raw Normal View History

2017-06-25 22:41:09 +03:00
# losetup
> Set up and control loop devices.
> More information: <https://manned.org/losetup>.
2017-06-25 22:41:09 +03:00
- 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}}`
2020-02-05 21:22:17 +03:00
- Detach all loop devices:
`sudo losetup -D`
- Detach a given loop device:
`sudo losetup -d /dev/{{loop}}`