mirror of
https://github.com/kneutron/ansitest.git
synced 2025-01-30 05:02:54 +08:00
Add files via upload
This commit is contained in:
parent
7411a56621
commit
b4d616a445
6
proxmox/nvme-check-namespace-relative-performance.sh
Normal file
6
proxmox/nvme-check-namespace-relative-performance.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
for d in $(ls -1 /dev/nvme?n1); do
|
||||
echo $d
|
||||
nvme id-ns -H $d |grep -i relative
|
||||
done
|
37
proxmox/proxmox-backup-veeam-agent-setup.sh
Normal file
37
proxmox/proxmox-backup-veeam-agent-setup.sh
Normal file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Install veeam agent for linux for bare-metal backup/restore of root FS + LVM
|
||||
# 2024.May kneutron
|
||||
|
||||
# NOTE you will also need to download the "veeam Linux Recovery Media" ISO to be able to Restore!
|
||||
# https://www.veeam.com/download_add_packs/backup-agent-linux-free/recovery-64
|
||||
|
||||
# HOWTO video:
|
||||
# REF: https://www.youtube.com/watch?v=g9J-mmoCLTs
|
||||
|
||||
# NOTE - WARNING - veeam only restores rootfs ext4 + LVM structure, does **NOT** restore LVM-thin!
|
||||
# You still need to backup your VMs!
|
||||
|
||||
# Install veeam agent for linux
|
||||
apt update
|
||||
|
||||
apt install pve-headers-$(uname -r) squashfs-tools libisoburn1 xorriso
|
||||
apt-get install linux-headers-$(uname -r)
|
||||
|
||||
# Needs to be already downloaded and in current dir
|
||||
# https://www.veeam.com/linux-backup-free-download.html?sec=linux-backup-free-download.html&subsec=&part=&item=
|
||||
dpkg -i veeam-release*deb
|
||||
|
||||
apt update
|
||||
apt install -y veeam
|
||||
|
||||
# run the backup setup program TUI
|
||||
veeam
|
||||
|
||||
exit;
|
||||
|
||||
# to start backup job out of schedule:
|
||||
# veeamconfig job start --name "BackupJob1"
|
||||
|
||||
NOTE veeam does NOT allow restore to a smaller disk - fsarchiver does!
|
||||
e.g. if you backed up a 256GB boot disk, you cannot restore your root + LVM with veeam to a 128GB disk!
|
32
proxmox/proxmox-bkp-host-to-pbs.sh
Normal file
32
proxmox/proxmox-bkp-host-to-pbs.sh
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# REF: https://www.reddit.com/r/Proxmox/comments/tfbhp1/newbie_here_what_are_the_benefits_of_proxmox/
|
||||
# REF: https://pbs.proxmox.com/docs/backup-client.html
|
||||
# REF: https://linuxconfig.org/how-to-create-a-backup-with-proxmox-backup-client
|
||||
|
||||
export PBS_REPOSITORY=10.9.1.23:zpbs1
|
||||
|
||||
date
|
||||
time proxmox-backup-client backup \
|
||||
--include-dev /boot/efi \
|
||||
--include-dev /etc/pve \
|
||||
root-$(hostname).pxar:/ \
|
||||
--repository 10.9.1.23:zpbs1 # <pbs-ip-addr>:<pbs-datastore>
|
||||
|
||||
date
|
||||
|
||||
exit;
|
||||
|
||||
# root.pxar is name of bkp, / is root dir
|
||||
|
||||
# REF: https://pbs.proxmox.com/docs/backup-client.html
|
||||
|
||||
RESTORE:
|
||||
Live-restore: This feature can allow you to start a VM when the restore job is started, rather than waiting for it to finish.
|
||||
|
||||
## proxmox-backup-client snapshot list
|
||||
|
||||
# proxmox-backup-client snapshot list --repository 10.9.1.23:zpbs1
|
||||
|
||||
# proxmox-backup-client restore host/elsa/2019-12-03T09:35:01Z root.pxar /target/path/
|
||||
# proxmox-backup-client restore --repository 192.168.122.72:datastore0 host/doc-standardpcq35ich92009/2024-01-11T11:01:49Z etc.pxar /etc
|
29
proxmox/proxmox-grub-rescue-fix.sh
Normal file
29
proxmox/proxmox-grub-rescue-fix.sh
Normal file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
# REF: https://pve.proxmox.com/wiki/Recover_From_Grub_Failure
|
||||
|
||||
# TODO EDITME before running if disk devices are different (nvme, etc)
|
||||
vgscan
|
||||
vgchange -a y
|
||||
|
||||
#Mount all the filesystems that are already there so we can upgrade/install grub. Your paths may vary depending on your drive configuration.
|
||||
|
||||
mkdir /media/RESCUE
|
||||
mount /dev/pve/root /media/RESCUE/
|
||||
|
||||
# EDITME
|
||||
mount /dev/sda1 /media/RESCUE/boot
|
||||
|
||||
mount -t proc proc /media/RESCUE/proc
|
||||
mount -t sysfs sys /media/RESCUE/sys
|
||||
mount -o bind /dev /media/RESCUE/dev
|
||||
mount -o bind /run /media/RESCUE/run
|
||||
|
||||
# Chroot into your proxmox install.
|
||||
|
||||
chroot /media/RESCUE
|
||||
#Then update grub and install it.
|
||||
|
||||
update-grub
|
||||
grub-install /dev/sda
|
||||
# ^ EDITME
|
25
proxmox/proxmox-mount-lxc-ctr-root-on-host.sh
Normal file
25
proxmox/proxmox-mount-lxc-ctr-root-on-host.sh
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
pct mount $1 # number of LXC CTR
|
||||
|
||||
exit;
|
||||
|
||||
First, mount the LXC filesystems on the Proxmox host (LXC does not need to
|
||||
be running, but can be). Use `pct mount xxx` for each LXC. It will tell
|
||||
you the mount point, but it will be /var/lib/lxc/xxx/rootfs. Now you can
|
||||
manipulate the files in the LXC from the Proxmox host. This includes all
|
||||
mount points of the LXC overlaid properly.
|
||||
|
||||
Next, use `rsync` to copy the files from one LXC to another using the full
|
||||
path to both rootfs`s.
|
||||
|
||||
Finally, recursively chown the files with a uid/gid offset of 100000 (the
|
||||
offset used by unprivilaged LXCs). Root in the container (uid 0) is uid
|
||||
100000 on host. I would just `chown -R 100000:100000` the entire directory
|
||||
you just copied, so it`s accessible as root in the container, and then go
|
||||
into the container and fix permissions within the container as container
|
||||
root (using `chown -R user:group`)
|
||||
|
||||
When you are done, `pct unmount xxx`.
|
||||
|
||||
# REF: https://www.reddit.com/r/Proxmox/comments/1ch6555/most_efficient_way_to_copy_data_from_privileged/
|
@ -1,5 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# running from cron, we need this
|
||||
PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/games:/usr/games:/root/bin:/root/bin/boojum:/usr/X11R6/bin:/usr/NX/bin:
|
||||
|
||||
pveam update
|
||||
pveam list local # storage name
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
# Verbosely list the contents of various storage defined in the Proxmox GUI
|
||||
# 2024.May kneutron
|
||||
# Could be handy to grep the output for e.g. vm-112 or an ISO name to see which storage has it
|
||||
# Also handy to find backups of a VM on different storage
|
||||
|
||||
# running from cron, we need this
|
||||
PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/games:/usr/games:/root/bin:/root/bin/boojum:/usr/X11R6/bin:/usr/NX/bin:
|
||||
|
Loading…
x
Reference in New Issue
Block a user