1. System Cleanup and Snapshot Backup

  1. Install Timeshift
    Before cleaning and backing up the system, we need to install Timeshift, a powerful system snapshot management tool. It allows you to regularly back up your system and restore it in case of a crash.

    Open the terminal and run the following command to install Timeshift:

    sudo apt install timeshift -y
    
  2. Create a System Snapshot
    Once Timeshift is installed, we can create a system backup snapshot. Run the following command to open Timeshift and create a snapshot:

    sudo timeshift --create --comments "Fresh Install Backup"
    

    Or you can use the GUI:

    sudo timeshift-gtk
    

    You will see the Timeshift graphical interface, select the disk (usually the system disk), and click Create to create the snapshot.

  3. Set up Automatic Backups (Optional)
    If you want to create backups automatically on a regular basis, you can set up scheduled backups in the Timeshift settings. You can choose daily, weekly, or monthly backups.


2. Restoring the System Using GRUB

If your system crashes and cannot boot normally, you can use GRUB recovery mode to boot the system and restore the backup.

  1. Boot into GRUB Recovery Mode

    • Restart your computer and hold the Shift key during boot to bring up the GRUB menu.

    • In the GRUB menu, select Advanced options for Parrot.

    • Then select the recovery mode you want to enter (e.g., Recovery mode).

  2. Restore the Snapshot from Recovery Mode

    • After entering recovery mode, select Root to enter the command-line interface with administrative privileges.

    • Then, use the following command to restore the snapshot you previously created:

      sudo timeshift --restore
      
    • The system will list all available backup snapshots. Choose the snapshot you want to restore and follow the on-screen instructions.

  3. Reboot the System After Restoration
    Once the restoration is complete, reboot the system by running:

    sudo reboot
    

3. Fixing GRUB Bootloader (No USB Drive Required)

If your system fails to boot and GRUB itself is broken, you can follow these steps to repair GRUB:

  1. Boot into GRUB Recovery Mode

    • Restart your computer, press and hold the Shift key until the GRUB menu appears.

    • In the GRUB menu, select Advanced options for Parrot, then choose Recovery Mode.

  2. Repair GRUB
    Once in recovery mode, select Root to enter the command-line interface. Then, run the following commands to fix GRUB:

    sudo grub-install /dev/sda
    sudo update-grub
    
  3. Reboot the System
    After completing the steps, reboot the system by running:

    sudo reboot