1. A method of updating an electronic device, the method comprising: detecting, by a controller of the electronic device, an operating system upgrade initiation; determining, by the controller, whether the operating system upgrade initiation is an upgrade of a general operating system of the electronic device to a secure operating system or an installation of the secure operating system; responsive to the operating system upgrade initiation being the installation of the secure operating system, performing, by the controller, a factory reset for labeling user data; and responsive to the operating system upgrade initiation being the upgrade of the general operating system to the secure operation system, generating, by the controller, labeling information on each piece of the user data, wherein generating the labeling information comprises: extracting plain text from a file of the user data, wherein the file is a piece of user data; identifying the user data of the file based on the extracted plain text from the file; generating the labeling information for the file based on the identified user data of the file; and storing the labeling information on each piece of user data in a file type; and relabeling the piece of the user data based on the labeling information.