From c6b2d8301fc3c23cfe073c28c11f463a8e001e7e Mon Sep 17 00:00:00 2001 From: Kreyren Date: Sat, 25 Feb 2023 18:58:40 +0000 Subject: [PATCH] Create losetup --- losetup | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 losetup diff --git a/losetup b/losetup new file mode 100644 index 0000000..5c4c2d9 --- /dev/null +++ b/losetup @@ -0,0 +1,12 @@ +--- +tags: [ mount loop ] +--- + +# Output available loop device +$ losetup -f + +# Attach an image file with partitioning table on available loop device +$ losetup "$(losetup -f)" path/to/file.img + +# Detatch loop device +$ losetup -d /dev/loopX