-1

My Acer laptop - where I have Lubuntu 16.04 64-bit installed - froze earlier today and I had to do a hard reset (holding the power button for several seconds). After that when I try to boot I end up with a GRUB> command prompt

What can I do to boot to my OS and get back so I can access my files? Is it possible to reinstall Lubuntu - without removing my files, only overwriting system files - and that way access my own files?

Grateful for help!

3
  • You could manually delete all folders without the HOME folder and set the user to the same username and password. And I think you'll get a warning about not formatting you root system but you shouldn't format if you want to keep your personal files.
    – userDepth
    Jan 7, 2018 at 3:03
  • Often hard shutdown corrupts file systems which has to be repaired. But that may not explain the full lock up originally. First try this on your partition. askubuntu.com/questions/642504/… And do not force shutdown. askubuntu.com/questions/926461/… and if reinstalling, this still will reset to default all the changes you made. Be sure to untick Format of /. help.ubuntu.com/community/UbuntuReinstallation
    – oldfred
    Jan 7, 2018 at 3:51
  • This is not directly related to Ubuntu. Perhaps this question is better suited for the Unix and Linux stackexchange site?
    – NerdOfCode
    Jan 7, 2018 at 5:06

1 Answer 1

0

You can try to boot from grub command line, assuming your file system is intact. You need to give 4 key parameters to boot:

  1. $root: the partition where the root system is located
  2. $prefix: the path where the grub system is located
  3. $linux$: the path/filename of the linux kernel
  4. $initrd: the path/filename of the init image

By ubuntu default, the command lines should like this:

GRUB> set root=(hdx,y)
GRUB> set prefix=(hdx,y)/boot/grub
GRUB> linux /vmlinuz root=/dev/sdax ro
GRUB> initrd /initrd.img

where x,y is the device id and partition id. You can first list all the partitions and check the the files to find out which is which, for example:

GRUB> ls 
GRUB> ls (hdx,y)/
GRUB> ls (hdx,y)/boot/
GRUB> ls (hdx,y)/boot/grub/

If there is a separate /boot partation, remember to replace $prefix with "(hdx,y')/boot/grub" where y' is the /boot partition, and replace $vmlinuz and $initrd with "/boot/vmlinuz" and "/boot/initrd.img".

In some cases the device id and partition id start with different letters. Use the same name as listed by the GRUB> ls command.

If the grub commands fail to bring the system up, you have to further check if the file system is intact, especially if the key files of vmlinuz, initrd and the grub files are still there.

3
  • Thank you for taking the time to write this, i followed your procedure and ended using boot to start. Unfortunately the boot could not complete, so I'm guessing that there is some problem with the file system that happened when i did a "hard reset"
    – sunyata
    Jan 8, 2018 at 18:54
  • The booting process consists of multiple stages. Roughly it's dominated by the grub, the initrd and the systemd respectively. You can tell from the logs printed in the screen that at which stage it goes wrong. What's the last error message it gives?
    – funicorn
    Jan 8, 2018 at 23:59
  • Unfortunately i started having problems with my other computer as well and needed to fix this computer asap so i don't have access to that info anymore. Some day i'd like to learn more about the boot process, it's a gap in my knowledge of computers
    – sunyata
    Jan 9, 2018 at 1:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .