Home  >  Q&A  >  body text

备份恢复 - linux系统用什么做备份比较好?

windows可以用ghost,那么linux用什么好呢?

怪我咯怪我咯2764 days ago462

reply all(7)I'll reply

  • 怪我咯

    怪我咯2017-04-17 16:16:55

    rsync+btrfs+dm-crypt Backup the entire system - Evian's Blog.

    In fact, it is recommended to use a file system that supports snapshots, such as zfs or btrfs (you can also use solutions such as LVM), otherwise there may still be consistency problems with online backup (for example, the PostgreSQL document clearly states that if you do not use snapshots way, it does not guarantee that your backup will be available).

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 16:16:55

    Directly rsync the corresponding directory

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 16:16:55

    You can try to make a mirror

    reply
    0
  • PHPz

    PHPz2017-04-17 16:16:55

    For industrial-grade backup, please write your own program to achieve at least the following functions:

    1. Data replication, supports local replication and network replication.

    2. Data verification.

    Many people think that backup is just copying without verification, which leads to various problems in the end.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 16:16:55

    ddTo file; finished...

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 16:16:55

    Backup/Restore Linux with tar

    备份系统(可以在运行时备份):
    sudo su
    cd /
    tar pczf bak.tgz \
    --exclude=/bak.tgz \
    --exclude=/cdrom \
    --exclude=/dev \
    --exclude=/lost+found \
    --exclude=/media \
    --exclude=/mnt \
    --exclude=/proc \
    --exclude=/run \
    --exclude=/sys \
    --exclude=/tmp \
    /
    其中--exclude的作用是排除.
    
    还原系统(建议在启动U盘(LiveCD)下还原):
    sudo su
    tar pxzf bak.tgz -C /
    mkdir cdrom dev lost+found media mnt proc run sys tmp
    参数p表明保留原文件的属性(属性不会依据使用者而变)

    Backup/Restore MBR with dd

    备份MBR:
    dd if=/dev/sda of=/tmp/mbr bs=512 count=1
    恢复MBR:
    dd if=/tmp/mbr of=/dev/sda bs=512 count=1

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 16:16:55

    rsync -aAXv /* /path/to/save/backup --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/path/to/backup/*}

    reply
    0
  • Cancelreply