bare_metal_linux_backups_with_rdx
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
bare_metal_linux_backups_with_rdx [2019/02/15 16:15] – [Using Dump for Backups] sgriggs | bare_metal_linux_backups_with_rdx [2019/02/15 16:29] – sgriggs | ||
---|---|---|---|
Line 128: | Line 128: | ||
</ | </ | ||
+ | ==== Using Tar for system backups ==== | ||
+ | Tar (and by extension other file archivers like **pax** and **cpio**) can also work for system backups. Here are the pros and cons. | ||
+ | |||
+ | Advantages of using **tar** for backups: | ||
+ | * Tar is fast | ||
+ | * Tar is broadly compatible. You'll be able to dig into the archive with many tools on many OSes. | ||
+ | * Tar doesn' | ||
+ | * It can go direct to a tape or disk device like **dump** but it also to a file. | ||
+ | |||
+ | Drawbacks of using **tar** for system backups: | ||
+ | * Tar doesn' | ||
+ | * Tar isn't as pedantic about weird files like named-pipes or FIFO files. It might not archive them as well as **dump** but most people don't care and don't need that to work anyway as most of those types of files are created dynamically. | ||
+ | * By default, tar won't care if it crosses a filesystem boundry. This can cause problems and I recommend you use the **--mount** | ||
+ | * Tar isn't smart enough to automatically avoid synthetic filesytems like **/proc** or **/sys**, or | ||
+ | |||
+ | === Tar examples === | ||
+ | |||
+ | For doing system backups there are two things I recommend you do that are not tar's default behavior. | ||
+ | | ||
+ | - Do not let it cross file systems. | ||
+ | - Do not let it backup in-memory filesystems like /proc | ||
+ | |||
+ | So, in my example, let's say I have three critical filesystems that are part of my OS build. They are **/**, **/usr**, and **/home**. I want to dump them to an RDX with a filesystem because I don't want to fiddle with any direct-to-device backups. Here goes. | ||
+ | |||
+ | < | ||
+ | ## Double check my filesystems so I know what I'm dumping | ||
+ | $ mount | ||
+ | |||
+ | ## Find my RDX Drive by exploring the drives on the system | ||
+ | fdisk -l | ||
+ | ls / | ||
+ | |||
+ | ## Put a partition on the RDX drive, in this case /dev/sdb | ||
+ | fdisk /dev/sdb | ||
+ | ## If the disk has partitions you want to delete, do so with " | ||
+ | ## Then use " | ||
+ | ## then hit " | ||
+ | |||
+ | ## Put a filesystem on the partition | ||
+ | mkfs /dev/sdb1 | ||
+ | |||
+ | ## Mount the RDX filesystem on the /backup directory | ||
+ | mount /dev/sdb1 /backup | ||
+ | |||
+ | ## Perform the tar backups one FS at a time using GZIP compression | ||
+ | tar -c --one-file-system -vzf / | ||
+ | tar -c --one-file-system -vzf / | ||
+ | tar -c --one-file-system -vzf / | ||
+ | |||
+ | </ |
bare_metal_linux_backups_with_rdx.txt · Last modified: 2019/02/15 16:30 by sgriggs