I want to backup my current CentOS-7.2 system to another drive. Is it safe to copy the system while it is running? Eg by mount /dev/sdb5 /mnt rsync -HPaxvz /. /mnt/ I've found contradictory advice on the web. -- Timothy Murphy gayleard /at/ eircom.net School of Mathematics, Trinity College, Dublin
Timothy Murphy wrote:> I want to backup my current CentOS-7.2 system to another drive. > Is it safe to copy the system while it is running? > Eg by > mount /dev/sdb5 /mnt > rsync -HPaxvz /. /mnt/ > I've found contradictory advice on the web.Yes. When we're cloning a system, such as a compute node in a cluster, or rsync upgrading, we rsync -HPavxz /. newmachine:/new/. rsync -HPavxz /boot/. newmachine:/boot//new/. As long as you're not copying /sys or /proc.... mark
Am 03.05.2016 um 15:55 schrieb Timothy Murphy <gayleard at eircom.net>:> I want to backup my current CentOS-7.2 system to another drive. > Is it safe to copy the system while it is running? > Eg by > mount /dev/sdb5 /mnt > rsync -HPaxvz /. /mnt/ > I've found contradictory advice on the web.It depends, the running services should answer ... for a mysqld running system: Delete the -x option above and add --exclude /proc --exclude /sys --exclude /mnt --exclude /var/lib/mysql and then mysqldump --add-drop-table -c --create-options -x -u root -p -A > mysqldump-$(date +%s).sql for example ... -- LF
Timothy Murphy wrote:> I want to backup my current CentOS-7.2 system to another drive. > Is it safe to copy the system while it is running? > Eg by > mount /dev/sdb5 /mnt > rsync -HPaxvz /. /mnt/ > I've found contradictory advice on the web.Oh, I hit <send> before I added several more things: First, correct the MAC address in /etc/udev/rules.d/70-persistant-net.rules (or it might be 60), and in /etc/sysconfig/network-scripts for ifcfg-<whatever> Second, you'll need a new /etc/ssh/sshd-host-* If you're getting your name & IP (and IPv6) from DHCP, don't forget to update the DHPCD server. Finally, this works if the system is identical hardware. If not, before you try to boot, boot from linux rescue, then you need to chroot /mnt/sysimage cd /lib/modules VER=$(ls -rt1 | tail -1) echo $VER mkinitrd X $VER mv X /boot/initrd-$VER.img At that point, you should be good to go. mark
m.roth at 5-cent.us wrote:>> I want to backup my current CentOS-7.2 system to another drive. >> Is it safe to copy the system while it is running? >> Eg by >> mount /dev/sdb5 /mnt >> rsync -HPaxvz /. /mnt/ >> I've found contradictory advice on the web. > > Yes. When we're cloning a system, such as a compute node in a cluster, or > rsync upgrading, we > rsync -HPavxz /. newmachine:/new/. > rsync -HPavxz /boot/. newmachine:/boot//new/.Thanks very much to you, and all who responded to my query. -- Timothy Murphy gayleard /at/ eircom.net School of Mathematics, Trinity College, Dublin