Copy files over Telnet/SSH with base64 or uuencode
No SCP or SFTP? Ship the file as text with base64 or uuencode and rebuild it on the other end.
No SCP or SFTP? Ship the file as text with base64 or uuencode and rebuild it on the other end.
Three pieces so a hang costs a minute instead of hours: the watchdog reboots, dropbear in the initramfs lets you type the LUKS passphrase over SSH, and netconsole keeps the kernel’s last messages on another box.
badblocks -b 4096 -sv /dev/sdX. The block counter is 32-bit and with 1 KiB blocks it stops at 4 TiB; with 4 KiB it covers 16 TiB. -w wipes the disk; for a quick check, smartctl -t long.
echo 1 > /sys/class/block/sda/device/rescan; growpart /dev/sda 3; pvresize /dev/sda3; lvextend -r -l +100%FREE /dev/vg/lv. Without LVM: resize2fs or xfs_growfs. All online.
modprobe nbd max_part=16; qemu-nbd -c /dev/nbd0 vm.qcow2; partprobe; mount /dev/nbd0p1. When done, umount and qemu-nbd -d, or the VM will not start because of the lock. VM off, always; -r to only read.
rsync -av –partial –append-verify –inplace source/ host:/dest/ picks up where it stopped. -f’+ */’ -f’- *’ copies only folders. By default rsync compares size and date; –checksum reads everything; –ignore-times copies everything.
No header, no data, passphrase or not: back it up off the disk and back it up again after every key change, because the old backup keeps the old keys.
First pvs/vgs/lvs -a: is a PV missing or did the thin pool fail? vgchange -ay –activationmode degraded for LVM RAID; partial only to copy data read-only; lvconvert –repair for thin pools; vgcfgrestore if the metadata is broken.
–add brings the disk in as a spare; –grow –raid-devices=N starts the reshape (hours). Backup file off the array, touch nothing until /proc/mdstat finishes, then resize2fs or xfs_growfs.
OpenSSH 8.8 turned off RSA/SHA-1 signatures and OpenSSH 10.0 deleted DSA. ssh-rsa takes two options; ssh-dss now only works from an older client.