0

1st problem: I have accidentally erased my boot folder. Now I'm stuck with grub in rescue mode, as I am unable to find /boot to satisfy grub.

2d problem: I tried to boot from a live distro (I tried several ones) but all I got is a black screen with a blinking cursor… So impossible to access to a terminal

I don't have any CD/DVD reader on my laptop but I was able to install xubuntu 14 (64bit) from an USB stick in the past (the first time I install xubuntu, before I deleted /boot…). And of course I have no other partition on my laptop, so all I can do is stare at this nice grub rescue mode… (So I have no access to a terminal)

In this day I'm just desperate… If somebody have a clue of what is going on it will save my shitty week!

mkdemoulin
  • 1
  • 1
  • 1
  • 2
  • Probably you should reinstall it all over again. – Ashu Mar 26 '16 at 18:34
  • 2
    Possible duplicate of [How can I repair grub? (How to get Ubuntu back after installing Windows?)](http://askubuntu.com/questions/88384/how-can-i-repair-grub-how-to-get-ubuntu-back-after-installing-windows) – David Foerster Mar 27 '16 at 10:07
  • The difference: I cannot boot from live usb... – mkdemoulin Mar 27 '16 at 12:23
  • from grub recue mode type `ls` then type for example `ls (hd0,msdosX)` and give the output. – GAD3R Mar 27 '16 at 12:43
  • With grub rescue I got: `grub rescue> ls` `(hd0) (hd0,msdos7) (hd0,msdos6) (hd0,msdos5) (hd0,msdos1)` And for each: `(hd0,msdos7): Filesystem is ext2.` `(hd0,msdos6): Filesystem is ext2.` `(hd0,msdos5): Filesystem is ext2.` `(hd0, msdos1): Filesystem is unknown.` – mkdemoulin Mar 27 '16 at 13:13

1 Answers1

2

You should create a new live-usb with Xubuntu 64 bits or some derivative of Debian 64 bits and try this:

Step 1: Boot into Ubuntu Live-Usb

Step 2: Open a terminal,

Press Ctrl+Alt+T

Step 3: Login as user with administrator permissions.

sudo -i

Step 4: Find out how your partition / is called with fdisk.

fdisk -l

Step 5: Suppose it is /dev/sda1, mount the partition in /mnt, previous fsck

umount /dev/sda1
fsck -a /dev/sda1
mount /dev/sda1 /mnt

Step 6: Mount the following paths in the respective locations in the /mnt namely – /dev, /sys, proc, and devpts.

mount -o bind /proc /mnt/proc
mount -o bind /dev /mnt/dev
mount -o bind /sys /mnt/sys
mount -o bind /dev/pts /mnt/dev/pts

Step 7: chroot into the Ubuntu partition

chroot /mnt

Step 8: Create /boot folder an instal linux kernel and Grub2

mkdir /boot
apt-get update
apt-get install --reinstall linux-headers-3.13.0-83 linux-headers-3.13.0-83-generic linux-image-3.13.0-83-generic linux-image-extra-3.13.0-83-generic grub-common grub-pc grub-pc-bin grub2-common
grub2-install --root-directory=/mnt /dev/sda

Step 9: Un-mount the previously mounted directories and reboot.

umount /mnt/proc
umount /mnt/dev/pts
umount /mnt/sys
umount /mnt/dev
umount /mnt
reboot
kyodake
  • 15,052
  • 3
  • 40
  • 48
  • Yes but the thing is I cannot boot from live USB and I don't know why... – mkdemoulin Mar 27 '16 at 12:18
  • You should create a new live-usb with Xubuntu 64 bits or some derivative of Debian as Siduction. http://ftp.uni-stuttgart.de/siduction/iso/paintitblack/xfce/amd64_2016-01-17_12-11/siduction-15.1.0-paintitblack-xfce-amd64-201601171211.iso – kyodake Mar 27 '16 at 13:14
  • No. Plug in your USB-Stick and run sudo dd if=/path/to/ubuntu-or-siduction-*.iso of=/dev/sdX. To find out, what the X in sdX represents in your case, run the sudo fdisk -l command. – kyodake Mar 27 '16 at 13:48
  • When I `chroot /mnt` there is this error: `chroot: failed to run command /bin/bash: no such file or directory` – mkdemoulin Mar 27 '16 at 15:03
  • And I precise that my live distro is the same as the old one (= Xubuntu 14 x64) – mkdemoulin Mar 27 '16 at 17:09