User Tools

Site Tools


linux:clone-linux-drive

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:clone-linux-drive [2025/08/10 21:48] Wulf Rajeklinux:clone-linux-drive [2025/09/03 01:50] (current) Wulf Rajek
Line 1: Line 1:
-====== Clone Linux Drive ======+====== Clone Linux Drive/System ======
  
  
Line 121: Line 121:
   - Confirm that the mount points have applied, this may require a restart.   - Confirm that the mount points have applied, this may require a restart.
  
 +
 +
 +====== Live remote cloning ======
 +
 +Target system:
 +<code>
 +sudo apt-get install openssh-server
 +sudo sed -i 's/#PermitRootLogin/PermitRootLogin/' /etc/ssh/sshd_config
 +sudo service ssh restart
 +</code>
 +
 +On source system:
 +<code>
 +sudo su -
 +apt-get install sshfs rsync
 +mkdir /mnt/newsystem
 +mount -t fuse.sshfs root@IP:/ /mnt/newsystem
 +cp /mnt/newsystem/etc/fstab /root/newfstab
 +rsync -ahPHAXx --delete --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found} / /mnt/newsystem
 +
 +#or for overall bandwidth stats and brief output:
 +rsync -ahPHAXx --info=progress2 --info=name0 --delete --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found} / /mnt/newsystem
 +
 +</code>
 +
 +Adjust /mnt/newsystem/etc/fstab file accordingly
 +
 +reset GRUB:
 +<code>
 +for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt/newsystem$i; done
 +sudo chroot /mnt/newsystem
 +sudo grub-install --recheck /dev/sdX
 +sudo update-grub
 +</code>
  
linux/clone-linux-drive.1754858892.txt.gz · Last modified: by Wulf Rajek