Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Categories
Random page
Top Contributors
Recent changes
Contribute
Create a page
How to help
Wiki policy
Adapt videos to articles
Articles in need of work
Help
Frequently asked questions
Join the discord!
Help about MediaWiki
Consumer_Action_Taskforce
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Futotemporarywikipage
(section)
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
Purge cache
General
What links here
Related changes
Special pages
Page information
Cargo data
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Basic Restore === By “basic restore” I mean what to do when you messed up a program configuration or deleted files inside a virtual machine or corrupted something accidentally. You want to go back to the image of the virtual machine you had before, on the same happycloud host computer. <span id="before-you-start"></span> ==== 8.1 Before You Start ==== I’m assuming the following is true: - Your virtual machine is already defined in Virtual Machine Manager(you see it when you run virtual machine manager GUI) - Your backups are in <code>/mediapool/vmbackups</code> - The backups were created using the qemu-img backup script I provided above - You just need to restore the virtual machine’s disk because you messed up some files or programs <span id="find-your-backup"></span> ==== 8.2 Find Your Backup ==== # List available backups for your virtual machine: <pre>ls -l /mediapool/vmbackups/name-of-your-virtual-machine-*.qcow2</pre> You’ll see files named like this: - <code>name-of-your-virtual-machine-20240101.qcow2</code> - <code>name-of-your-virtual-machine-20240108.qcow2</code> These are the disk image files that have all of the data/programs/databases/operating system. Each backup will have an XML file to go with it: - <code>name-of-your-virtual-machine-20240101.xml</code> - <code>name-of-your-virtual-machine-20240108.xml</code> These are the files that tell virtual machine manager all of the details about your virtual machine(RAM/CPU, hardware setup, etc.) Pick the most recent backup before you screwed something up. <span id="fast-restore"></span> ==== Fast Restore: ==== # Turn off the virtual machine <pre># Shut down the virtual machine gracefully virsh shutdown name-of-your-virtual-machine # Wait until it's actually off. Check status with: virsh list --all</pre> <ol start="2" style="list-style-type: decimal;"> <li>Backup Current Disk (just in case)</li></ol> <pre># Move the current (messed up/broken) disk with date mv /var/lib/libvirt/images/name-of-your-virtual-machine.qcow2 /var/lib/libvirt/images/name-of-your-virtual-machine.qcow2.broken-$(date +%Y%m%d)</pre> <ol start="3" style="list-style-type: decimal;"> <li>Restore Backup</li></ol> <pre># a cool command to put the virtual machine back where it was qemu-img convert -p -f qcow2 -O qcow2 /mediapool/vmbackups/name-of-your-virtual-machine-20240101.qcow2 /var/lib/libvirt/images/name-of-your-virtual-machine.qcow2 # set permissions so that our virtual machine management stuff can use it. chown libvirt-qemu:kvm /var/lib/libvirt/images/name-of-your-virtual-machine.qcow2 chmod 644 /var/lib/libvirt/images/name-of-your-virtual-machine.qcow2</pre> <ol start="4" style="list-style-type: decimal;"> <li>Start the Virtual Machine</li></ol> <pre>virsh start name-of-your-virtual-machine</pre> <span id="check-the-restore"></span> ==== Check the Restore ==== # Watch the virtual machine console in Virtual Machine Manager to make sure it boots # Try logging in when it’s up # Check that services(mailcow, immich, syncthing) actually work <span id="complicated-restore"></span>
Summary:
Please note that all contributions to Consumer_Action_Taskforce are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 International (see
Consumer Action Taskforce:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:
Cancel
Editing help
(opens in new window)