How To Restore Linux

Table of contents:

How To Restore Linux
How To Restore Linux

Video: How To Restore Linux

Video: How To Restore Linux
Video: How to Backup and Restore the Linux File System - Timeshift Tutorial 2024, May
Anonim

The Linux operating system is gaining more and more fans every year. Its undoubted advantages include the lack of licensing and high reliability of work. Nevertheless, for a novice Linux user, the system can fail quite often, which leads to the need to restore it.

How to restore Linux
How to restore Linux

Instructions

Step 1

One of the fundamental differences between Linux and Windows is that when working with it, a "crashed" system is usually repaired, not reinstalled. In order for the recovery to be quick and painless, you should take care of this even during the installation of the operating system.

Step 2

Before installing Linux, whatever distribution you are using, you must partition the disk correctly. Make the following partitions: / boot - about 130 MB in size, ext2 filesystem. / SWAP - swap partition, its size is equal to twice the size of RAM, but not more than 4 GB. / - root partition, about 50 GB in size, ext3 or reiserfs./home - the rest of the disk space, ext 3 or reiserfs. Correct disk partitioning will help you preserve user data during almost any failure.

Step 3

In the event that the file system is damaged, you will need a LiveCD with the fsck recovery utility to recover Linux. Boot from the LiveCD, log into the console with administrator rights. If you do not know the path to your filesystem, find it out with the fdisk –l command.

Step 4

You have found a filesystem - let's say its path is / dev / sda1. Now start the procedure for restoring it with the fsck -fy -t ext4 / dev / sda1 command. Pay attention to the specified file system type - it must be the same as yours. The –f switch sets the automatic check, the –t switch sets the file system type, -y automatically answers yes to all questions during the check.

Step 5

To repair the bootloader (usually using Grub2), you need to boot from the LiveCD. If / boot is on a separate partition, first create the appropriate folder: sudo mkdir / mnt / boot. Then mount the Linux partition by entering the command in the terminal: sudo mount / dev / sda1 / mnt / boot. Note that the example uses the sda1 section already mentioned above. You may have it different. If you did not move / boot into a separate partition, immediately mount the Linux partition with the command: sudo mount / dev / sda1 / mnt.

Step 6

Now run the Grub2 installation: sudo grub-install --root-directory = / mnt / boot / dev / sda. Note that the boot loader is installed on the hard disk (sda), not on its partition. After finishing the installation, reboot the system, then update Grub2 with the sudo update-grub command.

Step 7

Considering that there are many Linux distributions, before restoring the system, search the net for information on restoring your specific OS. The examples above are for widely used Ubuntu and Kubuntu distributions.

Recommended: