Using recovery mode:

  • hold shift key during startup – you will get GRUB startup menu
  • in GRUB menu select “Ubuntu … recovery mode”
    • if not present choose first “Advanced options for Ubuntu” and then “recovery mode” – can be more variants with different Linux kernel versions
  • we get Recovery Menu – usefull options:
    • dpkg – repair broken packages
    • fsck – file systems check
    • grub – update grub bootloader (but if grub would be broken we will not see this menu at all)
    • root – root shell prompt
    • system-summary
  • If we choose “root” we get root prompt but file system is in read-only mode.
  • But we can remount it in read-write mode (mount -o remount,rw /)
  • But if there really is some real problem, then very often recovery mode will not work

Live CD recovery:

 

  • from Ubuntu live CD:
    • Ctrl+Alt+F1 = go from desktop into command prompt
    • whoami – shows ubuntu – this user has no password
    • “sudo su -” gives me directly root
    • we can mount hard drive:
      • mkdir /mnt/hdd
      • mount /dev/sda1 /mnt/hdd
      • chroot /mnt/hdd (changes / to /mnt/hdd)