This application provides a
system restore method, apparatus, and electronic device. The method includes: in a temporary
operating system environment, modifying the partition information of a non-boot drive to first partition information; transferring file data from each partition of the boot drive to the corresponding partition of the non-boot drive;
copying the partition boot code and partition boot flag from the
master boot record (MBR) of the boot drive to the corresponding partition area of the non-boot drive; modifying the partition information of the boot drive to second partition information and clearing the
master boot record of the boot drive; installing a
system boot manager on the non-boot drive; and swapping the identification information of the boot drive and the non-boot drive. The technical solution provided by this application can migrate the
system and important data to an existing non-boot drive in an electronic device after the boot drive is damaged, realizing the role swapping of the boot drive and the non-boot drive and reducing the hardware cost of system restore.