Finally, after 20 years, my old idea of "assign and return the old value" has been implemented in C++14 in the exchange function incarnation!
Nice!
Nice!
My own thoughts on various things. I may be totally wrong, feel free to discuss.
lsblk /dev/sdX # see what's there swapon -s | grep sdX # check for active swap swapoff /dev/sdXN # deactivate swap if found mount | grep sdX # check for mounted FS umount /dev/sdXN # umount them if found pvs | grep sdX # check for PVs pvdisplay -m /dev/sdXN # find LVs if a PV found umount /dev/mapper/VG-LV # umount LVs if found lvchange -an /dev/mapper/VG-LV # deactivate LVs if any
vgchange -an VG
echo 1 > /sys/block/sdX/device/delete
echo - - - > /sys/class/scsi_host/hostX/scan
lvconvert --repair /dev/mapper/VG-LVraid1 lvremove /dev/mapper/VG-LVpartial vgreduce --removemissing VG
a_conf=/etc/squid/squid.confThen redirect new connections to the new port (i.e. 13128 by default) using iptables NAT.
b_conf=/etc/squid/squid-b.conf
b_pid=/var/run/squid-b.pid
sed -e 's/^http_port \([0-9]\+\)/http_port 1\1/' \
-e '/^cache_dir/d' < $a_conf > $b_conf
echo "pid_filename $b_pid" >> $b_conf
squid -f $b_conf