📜 ⬆️ ⬇️

Change Linux partitions, grub recovery

Being the lucky owner of the Asus eee pc 900, I decided to change the partitioning of the partitions, since the initial partition was no longer suitable. For those who do not know, the eee pc has two SSD drives with a capacity of 4 GBy of 16 GB, and the larger one is much slower. Initially, on a 4GB drive, I had a system partition and a swap with a capacity of about 200MB, the second drive was completely given to user directories. In order to enable the Hibernate option, I needed a swap at least the size of RAM, that is, from 1GB. It was decided to change the size of the / home partition, freeing up 1GB for the swap. And the old swap section is fully connected to the root section. To work with partitions, the Ubuntu Live CD / USB includes a fairly convenient and intuitive utility Gparted , which I will not explain the essence of working with. After finishing work with gparted in live cd / usb, I tried to reboot, and then I was disappointed.


Grub has stopped working. To restore it, follow the steps below.

Boot from the Live CD / USB again and open gnome-terminal. In it we execute commands:
')
sudo grub
# “grub>” , .
find /boot/grub/stage1
# "Error 15: File not found" find /grub/stage1
#
root (hdX,Y)
# X Y , find
# Grub
setup (hd0)
# Grub
quit


In principle, this is enough to boot into the installed system, but most likely the swap partition will not be connected. To connect it you need to edit / etc / fstab of the installed system.

sudo gedit /media/disk/etc/fstab
# gnome-terminal
ls -l /dev/disk/by-uuid/


This command will bring us a list of partitions with their UUID, then a new UUID for swap is copied and replaced in an open fstab, then we save and reboot. Everything should work.

Source: https://habr.com/ru/post/54700/


All Articles