desinfect_install.sh
· 407 B · Bash
Eredeti
#!/bin/bash
#
# this shell script will install nbd-client package on desinfect
#
cd ~/Downloads
echo "[*] download nbd-client package for AMD64 architecture"
wget -O -J http://de.archive.ubuntu.com/ubuntu/pool/universe/n/nbd/nbd-client_3.20-1_amd64.deb
echo "[*] install nbd-client package"
sudo dpkg -i nbd-client_3.20-1_amd64.deb
echo "[*] delete downloaded package file"
rm nbd-client_3.20-1_amd64.deb
cd
| 1 | #!/bin/bash |
| 2 | # |
| 3 | # this shell script will install nbd-client package on desinfect |
| 4 | # |
| 5 | cd ~/Downloads |
| 6 | echo "[*] download nbd-client package for AMD64 architecture" |
| 7 | wget -O -J http://de.archive.ubuntu.com/ubuntu/pool/universe/n/nbd/nbd-client_3.20-1_amd64.deb |
| 8 | echo "[*] install nbd-client package" |
| 9 | sudo dpkg -i nbd-client_3.20-1_amd64.deb |
| 10 | echo "[*] delete downloaded package file" |
| 11 | rm nbd-client_3.20-1_amd64.deb |
| 12 | cd |
install_tools.sh
· 189 B · Bash
Eredeti
#!/bin/bash
#
# use this script to install requirements in a native debian based linux.
#
# install qemu utils
sudo apt install qemu-utils
# install nbd client
sudo apt install nbd-client
| 1 | #!/bin/bash |
| 2 | # |
| 3 | # use this script to install requirements in a native debian based linux. |
| 4 | # |
| 5 | # install qemu utils |
| 6 | sudo apt install qemu-utils |
| 7 | |
| 8 | # install nbd client |
| 9 | sudo apt install nbd-client |
| 10 |
mount_vhdx.sh
· 508 B · Bash
Eredeti
#!/bin/bash
#
# This script takes two arguments:
# SYNTAX: mount_vhdx.sh <path/to/vhdx_image.vhdx> </path/to/mountpoint>
#
VHDX_IMG="$1"
MOUNT_POINT="$2"
# [ubuntu] How do you mount a VHD image
# https://ubuntuforums.org/showthread.php?t=2299701
#
# Load the nbd kernel module.
sudo rmmod nbd;sudo modprobe nbd max_part=16
# mount block device
sudo qemu-nbd -c /dev/nbd0 "$VHDX_IMG"
# reload partition table
sudo partprobe /dev/nbd0
# mount partition
sudo mount -o rw,nouser /dev/nbd0p1 "$MOUNT_POINT"
| 1 | #!/bin/bash |
| 2 | # |
| 3 | # This script takes two arguments: |
| 4 | # SYNTAX: mount_vhdx.sh <path/to/vhdx_image.vhdx> </path/to/mountpoint> |
| 5 | # |
| 6 | VHDX_IMG="$1" |
| 7 | MOUNT_POINT="$2" |
| 8 | |
| 9 | # [ubuntu] How do you mount a VHD image |
| 10 | # https://ubuntuforums.org/showthread.php?t=2299701 |
| 11 | # |
| 12 | |
| 13 | # Load the nbd kernel module. |
| 14 | sudo rmmod nbd;sudo modprobe nbd max_part=16 |
| 15 | |
| 16 | # mount block device |
| 17 | sudo qemu-nbd -c /dev/nbd0 "$VHDX_IMG" |
| 18 | |
| 19 | # reload partition table |
| 20 | sudo partprobe /dev/nbd0 |
| 21 | |
| 22 | # mount partition |
| 23 | sudo mount -o rw,nouser /dev/nbd0p1 "$MOUNT_POINT" |
| 24 |
unmount_vhdx.sh
· 300 B · Bash
Eredeti
#!/bin/bash
#
# This script takes one argument, which is the mountpoint where the VHDX image was mounted.
# Note: this is the second argument used when executing mount_vhdx.sh
MOUNT_POINT="$1"
#unmount & remove nbd module
sudo umount "$MOUNT_POINT" && sudo qemu-nbd -d /dev/nbd0 && sudo rmmod nbd
| 1 | #!/bin/bash |
| 2 | # |
| 3 | # This script takes one argument, which is the mountpoint where the VHDX image was mounted. |
| 4 | # Note: this is the second argument used when executing mount_vhdx.sh |
| 5 | |
| 6 | MOUNT_POINT="$1" |
| 7 | |
| 8 | #unmount & remove nbd module |
| 9 | sudo umount "$MOUNT_POINT" && sudo qemu-nbd -d /dev/nbd0 && sudo rmmod nbd |
| 10 | |
| 11 |