I'm really new in unix and Linux and just tried to learn something. My question is how can I make full system image/backup with dd include symlinks? Is dd good or I should use another approach? Can this be made with cronjob?

Is this enough to create full system backup include symlinks or no?

dd if=/dev/sda of=/dev/sdb

system is runing on Debian

  • dd will include the symlinks; however, if they point to a file that isn't also on /dev/sda, the targets don't get backed up this way. – stolenmoment May 19 '16 at 13:08

dd in your example does full system image backup, byte to byte mirroring /dev/sda to /dev/sdb. However you must be sure that /dev/sdb if equal or larger size disk. Modern systems do not permit plain copying like that because they embed some other unique identity information like UUIDs into volumes; there maybe issues with LVM setups, on-disk cryptography etc. And backing up from live system is not usually good idea. So it depends.

In general, such type of backups are of course valuable if you want to:

  • mirror system without rebuilding it's structure again (and backing up with tar for example is a second rebuild of structure on new place)
  • save something that classic Unix tools do not save (for example, ext2 file attributes or xattrs, or file creation times (ctime) are important for you)
  • or you do not care about size of backup or you really have many same type disks or large quantities of data space available

When dealing with symlinks it's important to know that there can be systems or tools which do not permit changing symlink owner, and if it's important, then do a full system mirror image. Otherwise plain tar may be more efficient and sufficient.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.