Saturday, December 5, 2020

Move linux to new disk commands

  • Move linux to new disk with rsync:
    • rsync -avxHAXW --progress  /<old disk mount point>  /<new disk mount point> --exclude=/<old disk mount point>/dev  --exclude=/<old disk mount point>/sys --exclude=/<old disk mount point>/proc --exclude=/<old disk mount point>/run
  • or with cp:
    • cp -afv /home/ /mnt/home/
  • Update /etc/fstab with new uuid by:
    • ls -l /dev/disk/by-uuid/
  • Restore grub:
    • grub-install /dev/xxx
    • update-grub2