-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add missing entry in Helm README list * Add suselinux_install_openiscsi function * Use single quote strings when possible * Add linux_create_fileAndDevice function
- Loading branch information
Showing
11 changed files
with
118 additions
and
40 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
# Collection of functions to work with disks on Linux | ||
|
||
####################################### | ||
# Create a file and binds it to a loop device | ||
# Arguments: | ||
# File name | ||
# Size file (number of blocks) | ||
# Look device | ||
# Examples: | ||
# linux_create_fileAndLoopDevice '/loop-file1' '10240' '/dev/loop1' | ||
####################################### | ||
linux_create_fileAndLoopDevice() { | ||
local fileName=$1 | ||
local sizeFile=$2 | ||
local loopDevice=$3 | ||
|
||
echo "Creating local file ${fileName} and loop device ${fileName}..." | ||
|
||
# prepares the file for use with loopback device (creates a file filled with zero bytes) | ||
dd if=/dev/zero of=${fileName} bs=1M count=${sizeFile} status=progress | ||
|
||
# binds the file to the loop device (enabling to work with the file as if it were a block device, like a physical disk) | ||
losetup ${loopDevice} ${fileName} | ||
} |
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
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
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
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
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