mirror of
https://github.com/Qubes-Community/Contents.git
synced 2025-01-09 06:18:06 -05:00
Merge pull request #64 from neowutran/patch-2
Create mount_lvm_image.sh
This commit is contained in:
commit
096853f92f
22
code/OS-administration/mount_lvm_image.sh
Normal file
22
code/OS-administration/mount_lvm_image.sh
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
########################################################
|
||||
# Make a LVM image appear in qvm-block
|
||||
# Create a disposable VM
|
||||
# Attach the image to the newly created disposable VM
|
||||
# Wait until the disposable VM is destroyed
|
||||
# Remove the LVM image from the qvm-block list
|
||||
######################################################
|
||||
|
||||
image=${1?Image file is required, example "/dev/qubes_dom0/vm-debian-9-tmp-root"}
|
||||
dvm=${2?DVM template name is required, example: "fedora-29-dvm"}
|
||||
dev=$(basename $(readlink "$image"))
|
||||
qubesdb-write /qubes-block-devices/$dev/desc "$image"
|
||||
list_before=$(qvm-ls | cut -d " " -f1 | sort)
|
||||
qvm-run -v --dispvm=$dvm --service qubes.StartApp+xterm &
|
||||
sleep 5
|
||||
list_after=$(qvm-ls | cut -d " " -f1 | sort)
|
||||
diff=$(comm -3 <(echo "$list_before") <(echo "$list_after"))
|
||||
qvm-block attach $diff dom0:$dev
|
||||
wait
|
||||
qubesdb-rm /qubes-block-devices/$dev/
|
@ -6,6 +6,7 @@
|
||||
- R4-universal-update-script.sh: bash script to automate VM updates
|
||||
- ![](/_res/l.png) [findpref](https://github.com/tasket/Qubes-scripts/blob/master/findpref): find all VMs that match a pref value and optionally set new values for them ([readme](https://github.com/tasket/Qubes-scripts#findpref))
|
||||
- ![](/_res/l.png) [qvm-portfwd-iptables](https://gist.github.com/Joeviocoe/6c4dc0c283f6d6c5b1a3f5af8793292b): port forwarding to allow external connections, see usage notes at bottom
|
||||
- ![](/_res/l.png) [mount_lvm_image.sh](https://github.com/Qubes-Community/Contents/blob/master/code/OS-administration/mount_lvm_image.sh): mount lvm image to a newly created disp VM
|
||||
|
||||
**`monitoring`**
|
||||
- ls-qubes.sh: outputs the nb. of running qubes + total memory used; the output can be fed into a panel text applet (see comments in the script).
|
||||
|
Loading…
Reference in New Issue
Block a user