Last active
November 22, 2019 12:46
-
-
Save leolin310148/e545438aecba9cc4c9c313ee2c2ed8bb to your computer and use it in GitHub Desktop.
Revisions
-
leolin310148 revised this gist
Jan 18, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -26,4 +26,4 @@ ensure_loop $LOOP_B `sh /tmp/loopback.sh` Thank you from https://www.xdelve.com/article/80.html -
leolin310148 revised this gist
Jan 18, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -25,3 +25,5 @@ ensure_loop $LOOP_B `sh /tmp/loopback.sh` Thank you from (https://www.xdelve.com/article/80.html)[https://www.xdelve.com/article/80.html] -
leolin310148 renamed this gist
Jan 18, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
leolin310148 created this gist
Jan 18, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ Create `loopback.sh` in `tmp` ``` #!/bin/bash ensure_loop(){ num="$1" dev="/dev/loop$num" if test -b "$dev"; then echo "$dev is a usable loop device." return 0 fi echo "Attempting to create $dev for docker ..." if ! mknod -m660 $dev b 7 $num; then echo "Failed to create $dev!" 1>&2 return 3 fi return 0 } LOOP_A=$(losetup -f) LOOP_A=${LOOP_A#/dev/loop} LOOP_B=$(expr $LOOP_A + 1) ensure_loop $LOOP_A ensure_loop $LOOP_B ``` `sh /tmp/loopback.sh`