1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-28 21:55:27 +02:00
tldr/pages/linux/losetup.md

29 lines
667 B
Markdown
Raw Normal View History

2017-06-25 21:41:09 +02:00
# losetup
> Set up and control loop devices.
> More information: <https://manned.org/losetup>.
2017-06-25 21:41:09 +02:00
- List loop devices with detailed info:
`losetup {{[-a|--all]}}`
2017-06-25 21:41:09 +02:00
- Attach a file to a given loop device:
`sudo losetup {{/dev/loop}} /{{path/to/file}}`
2017-06-25 21:41:09 +02:00
- Attach a file to a new free loop device and scan the device for partitions:
`sudo losetup --show {{[-P|--partscan]}} {{[-f|--find]}} /{{path/to/file}}`
- Attach a file to a read-only loop device:
`sudo losetup {{[-r|--read-only]}} {{/dev/loop}} /{{path/to/file}}`
2020-02-05 19:22:17 +01:00
- Detach all loop devices:
`sudo losetup {{[-D|--detach-all]}}`
2020-02-05 19:22:17 +01:00
- Detach a given loop device:
`sudo losetup {{[-d|--detach]}} {{/dev/loop}}`