Backups: Difference between revisions

From regional-training
 
No edit summary
Line 3: Line 3:
* embedded
* embedded
* Linux that is not using [[LVM]].
* Linux that is not using [[LVM]].
The advantages are its a verbatim copy of the machine, but the disadvantages are it is slow and archives can take up more room, unless compressed (which is why I have used lz4). Follow the backup instructions in [[LVM#Backup_and_Restore|Backup and Restore]] for [[LVM]] systems that use Volume Groups and Logical Volumes.
The advantages are its a verbatim copy of the machine, but the disadvantages are it is slow and archives can take up more room, unless compressed (which is why I have used compression such as lz4). Follow the backup instructions in [[LVM#Backup_and_Restore|Backup and Restore]] for [[LVM]] systems that use Volume Groups and Logical Volumes.


Here are the basic disk imaging instructions.  
Here are the basic disk imaging instructions.  
* image backups (dd is in coreutils which will be automatically loaded)
* image backups (dd is in coreutils which will be automatically loaded, dc3dd is used for forensice backups and has to be installed)
  sudo dc3dd if=/home/volumes/repos.v | lz4 > /mnt/sc1/backups/server.arising.com.a/repos.20191127.lz4
  sudo dc3dd if=/home/volumes/repos.v | lz4 > /mnt/sc1/backups/server.arising.com.a/repos.20191127.lz4
* or you can use dd if you do not want to install dc3dd
* ('''or''') you can use dd if you do not want to install dc3dd
  dd if=/dev/sdx bs=10M status=progress| lz4 > sdx.lz4
  dd if=/dev/sdx bs=10M status=progress| lz4 > sdx.lz4
* restore
* restore
  lz4 -d sdx.lz4 | pv [-s <nG>] | dd bs=1M of=/dev/sdx  
  lz4 -d sdx.lz4 | pv [-s <nG>] | dd bs=1M of=/dev/sdx oflag=sync
  lz4 -d sdx.lz4 | dd bs=1M of=/dev/sdx status=progress
  lz4 -d sdx.lz4 | dd bs=1M of=/dev/sdx status=progress oflag=sync
: Don't forget the bs=<buffer> size if you use dd else you will be waiting a while for it to read and write to the target volume, dc3dd is able to default to a more reasonable buffer size if you use dc3dd instead.
: Don't forget the bs=<buffer> size if you use dd else you will be waiting a while for it to read and write to the target volume, dc3dd is able to default to a more reasonable buffer size if you use dc3dd instead.
=source baclkups=
Source backups are an alternative means of copying Linux, bearing in mind that things will be changing while you do this backup
* source backups
* source backups
  rsync -avxHAXW --inplace /mnt/repos $name
  rsync -avxHAXW --inplace / <some-path>
* useful stuff
=useful stuff=
  iostat 60
  iostat 60
  locate (updatedb)
  locate (updatedb)
iostat
* Debian and Kali package names
* Debian and Kali package names
  apt install dc3dd lz4 sysstat mlocate rsync sysstats
  apt install dc3dd lz4 sysstat mlocate rsync sysstats

Revision as of 10:30, 8 December 2025

This is only beneficial on machines such as:

  • Windows
  • embedded
  • Linux that is not using LVM.

The advantages are its a verbatim copy of the machine, but the disadvantages are it is slow and archives can take up more room, unless compressed (which is why I have used compression such as lz4). Follow the backup instructions in Backup and Restore for LVM systems that use Volume Groups and Logical Volumes.

Here are the basic disk imaging instructions.

  • image backups (dd is in coreutils which will be automatically loaded, dc3dd is used for forensice backups and has to be installed)
sudo dc3dd if=/home/volumes/repos.v | lz4 > /mnt/sc1/backups/server.arising.com.a/repos.20191127.lz4
  • (or) you can use dd if you do not want to install dc3dd
dd if=/dev/sdx bs=10M status=progress| lz4 > sdx.lz4
  • restore
lz4 -d sdx.lz4 | pv [-s <nG>] | dd bs=1M of=/dev/sdx oflag=sync
lz4 -d sdx.lz4 | dd bs=1M of=/dev/sdx status=progress oflag=sync
Don't forget the bs=<buffer> size if you use dd else you will be waiting a while for it to read and write to the target volume, dc3dd is able to default to a more reasonable buffer size if you use dc3dd instead.

source baclkups

Source backups are an alternative means of copying Linux, bearing in mind that things will be changing while you do this backup

  • source backups
rsync -avxHAXW --inplace / <some-path>

useful stuff

iostat 60
locate (updatedb)
  • Debian and Kali package names
apt install dc3dd lz4 sysstat mlocate rsync sysstats

categories