Creating backups is one of the essential tasks of a system administrator. Consider how to implement the procedure using the built-in utilities dd and tar on Linux OS families.
Creating a backup
The dd utility is one of the first in its direction. It lacks some of the options that are available on modern analogues, but it is convenient and easy to use. In addition, the original backup file is read by other programs without problems.
Run the utility with the given parameters:
dd if=xxx of=yyy bs=8M conv=sync,noerror
The syntax is the following. XXX is the name of the drive from which the backup is being made, and YYY is the name of the backup file.
The bs operand specifies the size of the hard disk cache. Let’s set it to 8 MB so that copying is faster. The conv option specifies that files are copied bit by bit, skipping read errors.
The tar command is mainly used for creating archives, but it is also used for backups:
tar -cvpzf name1.tar.gz --exclude=name2 --one-file-system folder1
- name1 is an arbitrary name for the new backup;
- exclude=name2 means that all folders and files with the same name are excluded from the archive;
- one file system informs the archiver that we are using only one file system;
- folder1 is the name of the directory that is backed up by the tar command.
How to recover
To restore from a backup, use the following syntax:
dd if=ZZZ of=QQQ bs=8M conv=sync,noerror
The decoding is as follows. ZZZ is the name of the backup, indicating the path to it. For example, /mnt/backup/21082019.img, QQQ is the drive to which the backup is being restored.
The archiver uses a slightly different set of commands:
sudo tar -xvpzf XXX -C YYY --numeric-owner
- XXX is the full name of the archive;
- YYY is the directory where the unzipped information will be moved.
The last key (–numeric-owner) means that users will also be restored, but not by account name, but by numeric value.
Welcome to the world of DomainRooster, where roosters (and hens) rule the roost! We're a one-stop shop for all your entrepreneurial needs, bringing together domain names and website hosting, and all the tools you need to bring your ideas to life. With our help, you'll soar to new heights and hatch great success. Think of us as your trusty sidekick, always there to lend a wing and help you navigate the sometimes-complex world of domain names and web hosting. Our team of roosters are experts in their fields and are always on hand to answer any questions and provide guidance. So why wait? Sign up today and join the ranks of the world's greatest entrepreneurs. With DomainRooster, the sky's the limit! And remember, as the saying goes, "Successful people do what unsuccessful people are not willing to do." So don't be afraid to take that leap of faith - DomainRooster is here to help you reach for the stars. Caw on!