If you have Linux servers in your data center, chances are you're going to want to create images of the disks. These images can be used for restoring the operating system—should something go awry.
This process can be done a few different ways. One of the easiest methods available is with the help of the GNOME Desktop Environment. With DE, you have access to the GNOME Disk tool—a piece of software that makes creating and restoring disk images incredibly easy.
If you're looking to create an image of a Windows machine, this process will work as well—you simply have to boot from a Linux live disk or USB drive, and run the process. Once the image is created, reboot the machine, remove the live disk or USB, and you're back in Windows with an image stored on an external drive.
What you'll need
To pull this off, you'll need your server running the GNOME Desktop Environment, or have booted into a live linux distributions that includes GNOME Disk—such as Ubuntu or Fedora, and an external drive with enough space to hold the image GNOME Disk will create. These images are an exact copy of the entire drive, so if you have a 1TB drive the resulting image will be 1TB. Make sure to mount the external drive so it is accessible to the Desktop. This will happen when you plug the device in. Just make sure to open the File Manager and click on the newly plugged in device so it is accessible.
The process to create the image does take quite a bit of time, so don't think this is something you're going to launch and then watch the progress.
How to create an image
First off, it should be said that GNOME Disk isn't relegated only to GNOME. I run Elementary OS, and Disks can be easily installed from either the built-in app store or a terminal. The command to install GNOME Disk is:
sudo apt install gnome-disk-utility
Once the app is installed, run it by searching for the entry in your desktop menu, or from the terminal with the command:
In the resulting window (Figure A), select the disk you want to image from the left pane. Do note, you cannot create an image of a currently mounted drive. So if you need to make an image of the primary drive on the system (such as /dev/sda), you will have to run this process from a live instance of Linux. If the drive to be imaged doesn't contain the operating system, you can simply unmount the drive, and then run the process. However, chances are you won't be creating an image of a non-OS drive. Instead, you'll simply backup the data contained on the drive.
With your disk selected, click the gear icon and then click Create Disk Image. In the resulting window (Figure B), give the image a name and select the location that will house the newly created image.
Once you've configured the name and location for saving, click Start Creating, enter your sudo password, and the image creation process will begin.
Restoring the image
There is only one option to restore the image: You must boot into a live instance of Linux. The intention of GNOME Disk image creation is to be used for the creation of drives running the operating system. If you're looking to simply backup data on a secondary or external drive, your best bet would be a simple backup tool.
To restore the image, boot into the live instance, open GNOME Disk, click the gear icon, and then click Restore Image. When prompted, navigate to the stored .img file and click Open. The restoration process will begin. Once it finishes (like the creation of the image, this will take a significant amount of time), you can reboot, remove your live media, and boot into your restored drive.
That's all there is to it. You now have the means to create and restore a disk image—with the help of a user-friendly GUI.
- How to monitor your Docker containers with ctop (TechRepublic)
- Apache or NGINX: Which web server is right for you? (TechRepublic Video)
- How to clone VirtualBox Virtual Machines from the command line (TechRepublic)
- How to install and use Tripwire to detect modified files on Ubuntu Server (TechRepublic)
- New AMD EPYC-powered HPE VM server is breaking world records (ZDNet)
Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.