0

I have (had) a dual boot Ubuntu and Win10 machine. Windows was hosed and I fixed it using using unetbootin. Ubuntu disappeared i.e. the boot menu that had Ubuntu and Win went. Now I only have Win10.

I've tried to repair Ubuntu using both unetbootin and a live Ubuntu disk but it did nothing (although I did not try the advanced option just the default).

I don't really understand partitions but I am thinking my Ubuntu one has been overwritten by Windows/unetbootin. Any way I can get Ubuntu back?

Testdisks shows my partitions look like this

and sda looks like this

TIA!

user1773592
  • 119
  • 2
  • 12

1 Answers1

0

It looks at first glance like Windows 10 did not rewrite the partition table of your drive, so the Master Boot Record was all that was changed. What you need to do is restore the MBR which I believe can be done with a Linux tool called "gparted". You may have to download this tool. http://gparted.org/download.php Heed all warnings it gives you. Back up all data and back up the present (bad) MBR. You can run gparted from a USB, once you boot in a USB running ubuntu, or boot from the live CD or USB made with the ISO available on the site. This means making a live ISO image on a CD or USB and booting from the USB in order to run gparted. There is also a free tool to restore MBR's which runs on windows, but I doubt that you will be able to restore the old MBR from windows. Always work with a backed up MBR. Windows installations have a mind of their own. What worked for me was downloading an ISO of ubuntu which was bootable by selecting the USB and then using a loaded copy of gparted on that USB. You cannot change a mounted drive with a partition manager, so unmount the drive in order to repartition or change the MBR to one booting Linux and windows. Since your partiation table seems to be still intact, I would advise just making a new MBR which is dual boot.

"The best way to access all of the features of the GParted application is by using the GParted Live bootable image. GParted Live enables you to use GParted on GNU/Linux as well as other operating systems, such as Windows or Mac OS X. "

Fixing Operating System Boot Problems

"Your computer might fail to boot an operating system when you perform one of the following actions:

Delete a partition.

Move a partition.

***Install another operating system and overwrite the Master Boot Record (MBR).*** 

Fortunately the failure to boot can be often be fixed.

If your computer uses the GRUB boot loader, see the section called “Fixing GRUB boot problem” to restore the ability to boot.

If your computer does not use GRUB then you are advised to consult documentation for your boot loader to learn how to fix the problem. You might consult the GParted FAQ, or the GParted forum. You might also search the Internet to learn how other people have solved similar problems"

Fixing GRUB boot problem

The Grand Unified Boot loader (GRUB) is used by many GNU/Linux distributions. To fix GRUB boot problems you start by determining which major version of GRUB was used.

There are two major versions of GRUB:

GRUB, also known as GRUB 2, covers versions 1.98 and higher. GRUB 2 works with both GUID partition tables (GPT) and msdos partition tables.

GRUB Legacy, traditionally known as GRUB, covers versions 0.9x and earlier. GRUB Legacy works with msdos partition tables only. 

GRUB 2 is used as the default boot loader in the following GNU/Linux distributions:

CentOS 7 and higher

Debian 6 (Squeeze) and higher

Fedora 16 (Verne) and higher

openSUSE 12.2 and higher

Ubuntu 9.10 (Karmic Koala) and higher 

If you are unsure whether your computer uses GRUB 2 or GRUB Legacy, you might try searching for the answer on the Internet.

Restoring GRUB 2 Boot Loader

Use the following steps to restore the GRUB 2 boot loader:

Boot from Live media such as GParted Live or your GNU/Linux distribution image. Open a terminal window.

Determine which partition contains the / file system for your GNU/Linux distribution.

Use GParted to list the partitions on your disk device. Look for a partition that contains your GNU/Linux / file system. This Linux partition will likely use a file system such as ext2, ext3, ext4, or btrfs.

Note

If the / partition is on LVM then the Logical Volume Manager must be active. LVM can be started with the command:

vgchange -a y

With LVM, the equivalent of a disk partition is a Logical Volume. Logical Volumes can be listed with the command:

lvscan

 Create a mount point directory by entering (as root):

# mkdir /tmp/mydir

Mount the / partition on the mount point directory. For example assume the / file system is contained in the /dev/sda5 partition. Enter (as root):

# mount /dev/sda5 /tmp/mydir

If you have a separate /boot partition, for example at /dev/sda3, then an extra step is required. Mount the /boot partition at /tmp/mydir/boot by entering (as root):

# mount /dev/sda3 /tmp/mydir/boot

Note

If you do not know whether you have a separate boot partition then you probably do not and can ignore this step.

Prepare to change the root environment by entering (as root):

# mount --bind /dev /tmp/mydir/dev

# mount --bind /proc /tmp/mydir/proc

# mount --bind /sys /tmp/mydir/sys

Change the root environment by entering (as root):

# chroot /tmp/mydir

Reinstall GRUB 2 on the boot device. Note that the device name is used and not the partition name. For example, if the / partition is /dev/sda5 then the device is /dev/sda.

For Debian, Ubuntu, and other offshoot GNU/Linux distributions, enter the command (as root):

# grub-install /dev/sda

For CentOS, Fedora, openSUSE and other offshoot GNU/Linux distributions, enter the command (as root):

# grub2-install /dev/sda

Exit the chroot environment by entering (as root):

# exit

Reboot your computer. 

Restoring GRUB Legacy Boot Loader

Use the following steps to restore the GRUB Legacy boot loader:

Boot from Live media such as your GNU/Linux distribution image. Open a terminal window.
Note

The Live media must contain the GRUB Legacy boot loader. If your GNU/Linux distribution uses GRUB Legacy, then the distribution Live media will also contain GRUB Legacy.

Start the grub application from the command line (as root).

# grub

Find where grub stage1 is located by using one of the following:

If the /boot folder is stored in the / partition, use the command:

grub> find /boot/grub/stage1

If the /boot folder is stored in a partition different than the / partition, use the command:

grub> find /grub/stage1

The output from the find command might look like the following:

 (hd0,0)

If more than one line is listed in the command output, you will need to decide which device you use for grub.

Set the grub root device by specifying the device returned by the find command.

grub> root (hd0,0)

Reinstall grub by specifying the device returned by the find command.

grub> setup (hd0,0)

Exit grub.

grub> quit

Reboot your computer. 

*************************************************8

***strong text***RTFM!!