-
-
Save tomty89/d00ceba86e7437a017bea35cb8df3390 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
gpt=$(losetup -f --show /home/$SUDO_USER/$1/gpt.img) | |
sed "s/\/dev\/loop0/${gpt//\//\\\/}/" /home/$SUDO_USER/$1/table | dmsetup create $1 | |
setfacl -m u:tom:rw /dev/mapper/$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
loopdev=/dev/$(dmsetup deps -o devname /dev/mapper/$1 | grep -o 'loop[0-9]*') | |
dmsetup remove $1 | |
losetup -d $loopdev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment