version-11-08 serveur-11-08 administrateur backup restauration sauvegarde
Situation: votre serveur a été volé, ou est mort (incendie) ou … autre, vous avez un disque de sauvegarde entre les mains et un nouveau serveur … comment faire ?
# /etc/fstab: static file system information. # # Use 'blkid -o value -s UUID' to print the universally unique identifier # for a device; this may be used with UUID= as a more robust way to name # devices that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc nodev,noexec,nosuid 0 0 # / was on /dev/sda1 during installation UUID=a4d6fbc9-1bd7-4e6c-a7f5-7889c86064eb / ext4 errors=remount-ro 0 1 # /backup was on /dev/sda2 during installation UUID=abbb0f64-232f-449d-a374-bcba40eca378 /backup ext4 defaults 0 2 # /home was on /dev/sda11 during installation UUID=03b857c9-4cfc-4292-b775-093323f5cf11 /home ext4 defaults,user_xattr,acl 0 2 # /opt was on /dev/sda7 during installation UUID=c8d0c81c-29b6-4f28-8a4a-da34ef978e2e /opt ext4 defaults 0 2 # /tmp was on /dev/sda10 during installation UUID=4e3428d5-7a11-48f7-a99c-4bd6cdef79e0 /tmp ext4 defaults 0 2 # /usr was on /dev/sda6 during installation UUID=93ac1c92-75e8-4800-837c-0352affdbf55 /usr ext4 defaults 0 2 # /var was on /dev/sda8 during installation UUID=93ed1133-3c5c-436b-bc05-f18e5e519a22 /var ext4 defaults 0 2 # /var/log was on /dev/sda9 during installation UUID=c15ba33d-7822-4e3a-8865-385fd9433d3d /var/log ext4 defaults 0 2 # swap was on /dev/sda5 during installation UUID=b1ca40b9-fb13-403e-b9ae-e2fb56944f66 none swap sw 0 0
mkfs.ext4 -U <code UUID du fichier fstab> /dev/sda1 mkfs.ext4 -U <code UUID du fichier fstab> /dev/sda2 mkfs.ext4 -U <code UUID du fichier fstab> /dev/sda6 mkfs.ext4 -U <code UUID du fichier fstab> /dev/sda7 mkfs.ext4 -U <code UUID du fichier fstab> /dev/sda8 mkfs.ext4 -U <code UUID du fichier fstab> /dev/sda9 mkfs.ext4 -U <code UUID du fichier fstab> /dev/sda10 mkfs.ext4 -U <code UUID du fichier fstab> /dev/sda11
mount /dev/sda1 /mnt mkdir /mnt/backup mount /dev/sda2 /mnt/backup mkdir /mnt/usr mount /dev/sda6 /mnt/usr mkdir /mnt/opt mount /dev/sda7 /mnt/ont mkdir /mnt/var mount /dev/sda8 /mnt/var mkdir /mnt/var/log mount /dev/sda9 /mnt/var/log mkdir /mnt/tmp mount /dev/sda10 /mnt/tmp mkdir /mnt/home mount /dev/sda11 /mnt/home
rsync -avP /media/<chemin acces/abuleduprobackup/ /mnt/
mount /dev /mnt/dev --bind mount /sys /mnt/sys --bind mount /proc /mnt/proc --bind chroot /mnt grub-install /dev/sda update-grub
nano /etc/udev/rules.d/70-persistent-net.rules