User Tools

Site Tools


linux:system:disk:clone-system

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:system:disk:clone-system [2023/09/08 12:28] – [Get Source Image] oscarlinux:system:disk:clone-system [2023/09/08 12:33] (current) – [Write Target System] oscar
Line 34: Line 34:
 # tar -zcvf image-sdXY.tgz /tmp/source_sdXY # tar -zcvf image-sdXY.tgz /tmp/source_sdXY
 </code> </code>
-===== Create Targte Disk =====+===== Create Target Disk =====
 Again, first check with lsblk the disk structure, before proceeding: Again, first check with lsblk the disk structure, before proceeding:
 <code> <code>
Line 53: Line 53:
 # gzip -dc efi-image.gz | dd bs=4M of=/dev/sdbX # gzip -dc efi-image.gz | dd bs=4M of=/dev/sdbX
 # sync # sync
-<code>+</code>
 ==== Write Root Partition ==== ==== Write Root Partition ====
 Empty and create a fresh filesystem on the root partition of the target disk: Empty and create a fresh filesystem on the root partition of the target disk:
Line 99: Line 99:
 Run grub-install against the drive you installed to. In my case that’s /dev/sdb, but this may be different on your machine. Next we install grub to our drive, thereby making it bootable. Be careful to install grub to a drive and not to a partition. Run grub-install against the drive you installed to. In my case that’s /dev/sdb, but this may be different on your machine. Next we install grub to our drive, thereby making it bootable. Be careful to install grub to a drive and not to a partition.
  
-  # grub-install /dev/sdb+  # grub-install /dev/sdX 
 +  # grub-install --recheck /dev/sdX 
 +  
   # update-grub   # update-grub
  
Line 148: Line 150:
 </code> </code>
  
-Alternatively, in case of persistent problems, you can purge and reinstall grub2, make new config files: 
-<code> 
-apt-get remove --purge grub-pc grub-common 
-apt-get install grub-pc 
-grub-mkconfig 
-update-grub 
-grub-install /dev/sda 
-</code> 
- 
-Now grub is back, all that is left is to exit the chrooted system and unmount everything: 
-<code> 
-# exit 
-# umount /mnt/sys 
-# umount /mnt/proc 
-# umount /mnt/dev/pt 
-# umount /mnt/dev 
-# umount /mnt 
-</code> 
 Shut down and turn your computer back on, and you will be met with the default Grub2 screen. Shut down and turn your computer back on, and you will be met with the default Grub2 screen.
  
linux/system/disk/clone-system.1694176092.txt.gz · Last modified: by oscar