Skip to content

Commit

Permalink
Merge branch 'philclifford-zfs'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisallenlane committed Nov 22, 2022
2 parents 767f1b2 + a2ddbf6 commit d7f367e
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 26 deletions.
47 changes: 47 additions & 0 deletions quickemu
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
tags: [ virtualization ]
---
# Run a specific vm:
quickemu --vm <path/to/vm.conf>

# Run a specific vm with a spice display:
quickemu --vm <path/to/vm.conf> --display spice

# Run a specific vm with a braille terminal display - Version > 3.11 and working brltty required:
quickemu --vm <path/to/vm.conf> --accessible braille --display sdl
# or:
quickemu --vm <path/to/vm.conf> --acc brl --display sdl

## All the optional parameters:


--braille : Enable braille support. Requires SDL.
--delete-disk : Delete the disk image and EFI variables
--delete-vm : Delete the entire VM and it's configuration
--display : Select display backend. 'sdl' (default), 'gtk', 'none', 'spice' or 'spice-app'
--fullscreen : Starts VM in full screen mode (Ctl+Alt+f to exit)
--ignore-msrs-always : Configure KVM to always ignore unhandled machine-specific registers
--screen <screen> : Use specified screen to determine the window size.
--shortcut : Create a desktop shortcut
--snapshot apply <tag> : Apply/restore a snapshot.
--snapshot create <tag> : Create a snapshot.
--snapshot delete <tag> : Delete a snapshot.
--snapshot info : Show disk/snapshot info.
--status-quo : Do not commit any changes to disk/snapshot.
--viewer <viewer> : Choose an alternative viewer. @Options: 'spicy' (default), 'remote-viewer', 'none'
--ssh-port <port> : Set ssh-port manually
--spice-port <port> : Set spice-port manually
--public-dir <path> : expose share directory. @Options: '' (default: xdg-user-dir PUBLICSHARE), '<directory>', 'none'
--monitor <type> : Set monitor connection type. @Options: 'socket' (default), 'telnet', 'none'
--monitor-telnet-host <ip/host> : Set telnet host for monitor. (default: 'localhost')
--monitor-telnet-port <port> : Set telnet port for monitor. (default: '4440')
--monitor-cmd <cmd> : Send command to monitor if available. (Example: system_powerdown)
--serial <type> : Set serial connection type. @Options: 'socket' (default), 'telnet', 'none'
--serial-telnet-host <ip/host> : Set telnet host for serial. (default: 'localhost')
--serial-telnet-port <port> : Set telnet port for serial. (default: '6660')
--keyboard <type> : Set keyboard. @Options: 'usb' (default), 'ps2', 'virtio'
--keyboard_layout <layout> : Set keyboard layout.
--mouse <type> : Set mouse. @Options: 'tablet' (default), 'ps2', 'usb', 'virtio'
--usb-controller <type> : Set usb-controller. @Options: 'ehci' (default), 'xhci', 'none'
--extra_args <arguments> : Pass additional arguments to qemu
--version : Print version
14 changes: 14 additions & 0 deletions quickget
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
tags: [ virtualization ]
---
# Download a release image and prepare a Qemu vm config:
quickget <OS> <Release> [<Edition>|<Type>|<DM Option>|<Windows Language>]

# Print list of supported Releases and Editions for <OS>:
quickget <OS>

# Download an OS Release image and prepare a Qemu vm config - if Edition is not specified the default will be used:
quickget <OS> <Release>

# Print a csv list of all supported OS variants
quickget list
56 changes: 30 additions & 26 deletions zfs
Original file line number Diff line number Diff line change
Expand Up @@ -18,60 +18,60 @@
# Recommended: use entire devices rather than partitions
zpool create ${pool} raidz1 ${device} ${device} ${device} [...]

# Add 2nd-level "RAID-1" (mirror) ZFS Intent Log (ZIL; synchronous write cache)
# Add 2nd-level "RAID-1" (mirror) ZFS Intent Log (ZIL; synchronous write cache):
# Recommended: use separate, fast, low-latency devices (e.g. NVMe)
zpool add ${pool} log mirror ${part} ${part}

# Add 2nd-level "RAID-0" Adaptive Replacement Cache (ARC; read cache)
# Add 2nd-level "RAID-0" Adaptive Replacement Cache (ARC; read cache):
# Recommended: use separate, fast, low-latency devices (e.g. NVMe)
zpool add ${pool} cache ${part} ${part} [...]

# Remove log or cache components
# Remove log or cache components:
zpool remove zfs ${part} [...]

# Import (enable) existing pool from newly connected devices
# Import (enable) existing pool from newly connected devices:
# Note: this will create the /etc/zfs/zpool.cache devices cache
zpool import -d /dev/disk/by-id -aN

# Import (enable) existing pool using the devices cache
# Import (enable) existing pool using the devices cache:
zpool import -c /etc/zfs/zpool.cache -aN

# Export (disable) pool (e.g. before shutdown)
# Export (disable) pool (e.g. before shutdown):
zpool export -a

# List all (imported) pools
# List all (imported) pools:
zpool list

# See pool status
# See pool status:
zpool status ${pool}

# See detailed pool I/O statistics
# See detailed pool I/O statistics:
zpool iostat ${pool} -v

# Verify pool integrity (data checksums)
# Verify pool integrity (data checksums):
# (watch progress with 'zpool status')
zpool scrub ${pool}

# Remove a failing device from a pool
# Remove a failing device from a pool:
# Note: redundant pools (mirror, raidz) will continue working in degraded state
zpool detach ${pool} ${device}

# Replace a failed device in a pool
# Replace a failed device in a pool:
# Note: new device will be "resilvered" automatically (parity reconstruction)
# (watch progress with 'zpool status')
zpool replace ${pool} ${failed-device} ${new-device}

# Erase zpool labels ("superblock") from a device/partition
# Erase zpool labels ("superblock") from a device/partition:
# WARNING: MUST do before reusing a device/partition for other purposes
zpool labelclear ${device}

# Query pool configuration (properties)
# Query pool configuration (properties):
zpool get all ${pool}

# Change pool configuration (property)
# Change pool configuration (property):
zpool set <property>=<value> ${pool}

# Dump the entire pool (commands) history
# Dump the entire pool (commands) history:
zpool history ${pool}

# More...
Expand All @@ -80,45 +80,49 @@ man zpool

## File systems / Volumes

# Create a new file system
# Create a new file system:
zfs create ${pool}/${fs_vol}

# Create a new volume ("block device")
# Create a new volume ("block device"):
# Note: look for it in /dev/zvol/${pool}/${fs_vol}
zfs create -V <size> ${pool}/${fs_vol}

# List all file systems / volumes
# List all file systems / volumes:
zfs list

# Mount all file systems
# Mount all file systems:
# Note: see 'zfs get mountpoint ${pool}' for mountpoint root path
zfs mount -a

# Create a snapshot
# Create a snapshot:
zfs snapshot ${pool}/${fs_vol}@${snapshot}

# Delete a snapshot
# Delete a snapshot:
zfs destroy ${pool}/${fs_vol}@${snapshot}

# Full backup
# Delete a range of snapshots:
zfs destroy ${pool}/${fs_vol}@${first-snapshot}%${last-snapshot}


# Full backup:
# Note: pipe (|) source to destination through netcat, SSH, etc.
# ... on source:
zfs send -p -R ${pool}/${fs_vol}@${snapshot}
# ... on destination:
zfs receive -F ${pool}/${fs_vol}

# Incremental backup
# Incremental backup:
# Note: pipe (|) source to destination through netcat, SSH, etc.
# ... on source:
zfs send -p -R -i ${pool}/${fs_vol}@${snapshot-previous} ${pool}/${fs_vol}@${snapshot}
# ... on destination:
zfs receive -F ${pool}/${fs_vol}

# Query file system / volume configuration (properties)
# Query file system / volume configuration (properties):
zfs get all ${pool}
zfs get all ${pool}/${fs_vol}

# Change file system / volume configuration (property)
# Change file system / volume configuration (property):
zfs set <property>=<value> ${pool}/${fs_vol}

# More...
Expand Down

0 comments on commit d7f367e

Please sign in to comment.