Ubuntu system hard

  

statement

The author recently discovered that many articles of the author's personal website http://tiankonguse.com/were reprinted by other websites, but the source of the article was not stated or referenced. Http://tiankonguse.com/website, therefore, I add this statement.

Solemnly declare: This record "The Difficulties of Ubuntu System" is reproduced from http://tiankonguse.com/: http://tiankonguse.com/record/record.php?id=677

Foreword

I remembered that sentence again. Since I chose to do this, I am prepared to bear all the costs of doing it.

An incorrect memory and operation caused the entire boot partition to be deleted.

An unintentional undo operation that makes the system dependent on errors.

Text

Background

Let me talk about the background.

My computer has three systems installed: ubuntu12.04, ubuntu14.04 and centOS.

Where ubuntu12.04 is the system I have been using, and it took at least a year to install the system last time.

ubuntu14.04 This system is used when I remove windows and use this system to overwrite it.

The centOS installation has been around for half a year.

Now my ubuntu12.04 system is out of disk, so I want to delete the other two systems.

So I made a U disk version of GParted software.

View partition status

sda1 is the primary partition (formerly windows7, the reality is ubuntu14.04). Sda3 is my D drive, ntfs format. Sda4 is an ext4 format partition (boot partition). Sda5 is a swap partition. Sda6 is an ext4 format partition (ubuntu 12.04 partition) sda7 is an ext4 format partition (Home partition). Sda8 is a swap partition. Sda9 is an ext4 format partition (centOS system). Sda10 is a swap partition 

first misoperation

Seeing these partitions, I think of one thing, when installing ubuntu14.04, for system security, I put boot, home and root Separated, divided into three partitions.

So I decisively deleted sda8 and sda4, and later I wanted to exchange partitions, which was not useful, so I deleted the three swap partitions. For the home partition, I want to see if it is, after all, there may be important files inside.

Then shut down and restart, then there is a long-lost grub rescue error.

New grub error

The first line has an error

/grub/i386pc/normal.mod not found.

Fortunately, I have encountered this before. The error was many times, so I found the record http://tiankonguse.com/record/record.php?id=194.

But when you execute insmod /boot/grub/normal.mod you are prompted to find normal.mod.

Fortunately, I tried using insmod normal and it was successful. The original system was changed to /boot/grub/i386-pc/normal.mod.

Then I am happily executing the normal command.

But after execution, the prompt

error symbol 'grub_term_highlight_color' not found. 

How can this be? So use 360 ​​to search. Find this forum (http://forum.ubuntu.org.cn/viewtopic.php?t=458570). It is a bug in the system, you need to use the live system to reinstall grub2. I made a U disk for ubuntu system. Then copy the boot from the USB flash drive to my ubuntu 12.04 system. After booting, still grub rescue, and then use the above method to go into the U disk system. It turns out that grub has not been updated yet. Then update the following error:

ubuntu@ubuntu:~$ sudo update-grub/usr/sbin/grub-probe: error: failed to get canonical path of /cow.ubuntu@ubuntu:~$ Sudo grub-install /dev/sdaPath `/boot/grub' is not readable by GRUB on boot. Installation is impossible. Aborting. Then I found a method on a forum in ubuntu (http://askubuntu.com/questions/197833/recovering-from-grub-rescue-crash) core command 
sudo mount /dev/sdXY /mntsudo grub-install --root-directory=/mnt /dev/sdXWhere /dev/sdX is the disk where Ubuntu Is installed, and /dev/sdXY is the partition on the disk where Ubuntu is installed. In other words, /dev/sdXY contains /boot and so on.Use fdisk -l to verify the Ubuntu installation location. But when I execute , prompt 
ubuntu@ubuntu:~$ sudo mount /dev/sda /mntmount: /dev/sda already mounted or /mnt busy See various solutions in the bug forum, you can go and see (https://Bugs.launchpad.net/ubuntu/+source/grub2/+bug/1289977). 
sudo fdisk -lAnd find your Ubuntu partition (should be /dev/sda1 if it is the first partition) sudo mount /dev/sda1 /mntsudo mount --bind /sys /mnt/syssudo mount --bind /proc /Mnt/procsudo mount --bind /dev /mnt/devsudo chroot /mntNow reinstall Grub2sudo apt-get install --reinstall grub2blkid View the UUID of each partition 

At this point I suddenly realized a problem, I am a U disk, not The live system, the files inside are naturally incomplete.

So I tried to fix another system first, and the result was fine.

Then enter that system and copy all the boot directories.

Restarting the system, you are entering a new system.

Setting up partitions manually

At this point I realized a problem. My old system has three partitions: the root partition, the boot partition, and the home partition.

There must be a place to store these three partitions for storage there, and I found it.

Execute this command

tiankonguse@tiankonguse:~$ sudo vi /etc/fstab can see the mount point of the partition

The following is what I fixed
< Pre># /etc/fstab: static file system information.## Use 'blkid' to print the universally unique identifier for a# device; this may be used with UUID= as a more robust way to name devices# that works even if disks See added and removed. See fstab(5).## <file system> <mount point> <type> <options> <dump> <pass># /was on /dev/sda1 during installationUUID= a f errors dev dev dev dev dev dev Dev/sda6 during installation#UUID=99d228d4-f996-4970-ba48-f6950e3a0b69 none swap sw 0 0# /home was on /dev/sda7 during installationUUID=aef790b3-32e8-4060-8542-bafeedcbac98 /h Ome ext4 defaults 0 2

About UUID You can use the above mentioned blkid to query

tiankonguse@tiankonguse:~$ sudo blkid/dev/sda1: UUID="65a7fc16-a481-4f77-97b6- 59731143f930" TYPE="ext4" /dev/sda5: LABEL="E" UUID="3816A47016A43134" TYPE="ntfs" /dev/sda6: UUID="aef790b3-32e8-4060-8542-bafeedcbac98" TYPE="ext4"

Configured for your own needs, the old system's home directory is attached to the new system.

Copyright © Windows knowledge All Rights Reserved