Browse Source

Adding loopback commands

Common loopback device commands. Useful for dealing with filesystems
in a file.
master
Nate Bohman 6 years ago
parent
commit
37ddde808c
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      loopback_device.sh

+ 15
- 0
loopback_device.sh View File

@@ -0,0 +1,15 @@
# If an available /dev/loop device is
# known before running the command
# losetup /dev/loop0 floppy.img

# Use the first available /dev/loopN device
losetup -f floppy.img

# Create the filesystem
mkfs.xfs /dev/loop0

# Destroy loopback device
losetup -d /dev/loop0

# Mount the loopback image
mount -o loop -t xfs floppy.img /mnt

Loading…
Cancel
Save