Clone a block device to another

Use GNU ddrescue. (Do not confuse with dd_rescue.)

ddrescue -n -f input output mapfile

With mapfile, you can interrupt the copy anytime and resume it later.

Create EFI partition

  1. Create a primary partition with fat32 file syste and set esp flag.
  2. Format the partition
    mkfs.fat -F 32 /dev/sdxY
    
  3. Mount the partition on /efi or /boot/efi
    • /efi is a replacement for the historical and now discouraged ESP mountpoint /boot/efi.
    • The /efi directory is not available by default, you will need to first create it before mounting the ESP to it.
  4. Install grub (without partition number)
    grub-install /dev/sdx
    
  5. Generate initramfs image
    update-initramfs -u -k all
    
  6. Generate grub config file
    update-grub
    
  7. Reboot

Check S.M.A.R.T

Use smartmontools

smartctl --all /dev/sda