I knew almost nothing about file systems and that caused the large story for me.
There were many questions on this topic and nothing could help me. Sequence of the story is next:
1) I had on my machine Windows 10, Windows 7 and Ubuntu 14.04 installed (in the same order). More or less they were working together during some time. Before I failed. When I firstly installed Ubuntu on my machine, I created the separate partition of free space using windows disk manager and called it UBUNTU, however I did not know that during installation of Ubuntu it will not ask me, where to install it. Finally this partition left unused (at least as I thought). Yesterday I saw that this volume is empty and decided to delete it using Windows disk manager. Till the morning it was ok. And after I realized that it was stupid.
2) This morning, however, I turned off Linux and found GRUB2 could not be loaded (it came to the rescue mode). After some painful search I figured out why it did not run (error message: no such partition). The parameters in configuration (rescue mode code) were next:
prefix=(hd0,msdos9)/boot/grub
root=hd0,msdos9
While in reality there were not 9 partitions - so it is logical that it could not find number 9.
3) Using next code I mamaged to run the GRUB:
set prefix=(hd0,msdos1)/grub
set root=hd0,msdos1
insmod normal
normal
As I figured out that there is a folder called grub in the partition msdos1. I did it using the next bash code for every msdosN:
ls (hd0,msdosN)/
4) But the problems have not finished: clicking Windows loader (from > /dev/sda3 as it was written in GRUB), I was perfectly redirected to Windows loader where I have to choose 7 or 10 to boot. While Ubuntu, that is more important for me, could not be loaded. Moreover, to run GRUB i had to repeat the stuff every time.
5) I opened Windows and installed ext2 volume manager for Windows. With it I managed to mount and open only one partition from 3 Ubuntu ones. I mounted ext4 partition sda1 and saw that grub is installed there as I expected while doing the code for step 3)
6) I restarted computer than and tried to look for /boot directory for linux using: ls (hd0,msdosN)/boot But there were no partition in which i could find any boot directory.
7) I ran the Ubuntu from External disk in Try Mode and did next: - Installed boot-repair
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
I ran it in recommended mode and hopefully restarted the machine. GRUB stopped to appear at all, while I came directly to Windows loader. Not good.
8) I ran the Ubuntu from external one more time and tried next:
How can I repair grub? (How to get Ubuntu back after installing Windows?)
I changed all the names as it must be but finally i managed to mount only dev/sda1 where the grub was as you remember. I obtained the message that another volumes cannot be mount (error: mountpoint does not exist). and nothing of next was not working.
sudo chroot /mnt
update-grub
grub-install /dev/sda
9) Totally frustrated I understood that there are next problems:
I have no idea where is /boot folder on Ubuntu as I even cannot run it (I cannot just reinstall Ubuntu either, as there are not backed-up configurations and data). And even if I know where is boot, what should I do after?
I do not know how to let GRUB work after all - it has totally disappeared after using boot-repair (and I cannot normally install it from External-Ubuntu as I told in step 8).
I do not understand the system - rescue mode of GRUB means that It could not find its configuration file but where is the way to this file stipulated and in which file had I changed the next default for msdos9 to msdos1?:
prefix=(hd0,msdos9)/boot/grub root=hd0,msdos9
Does these default values mean that some boot folder must contain the grub folder ad both have to be situated on Ubuntu partition? Will Windows appear in multi-booting then?
Generally I would be very grateful if you explained me all that system: 1) Which files must exist and in which exact place (in my concrete situation and in general).
3) Which code to use on Windows or on external Ubuntu to resolve the GRUB and Ubuntu booting problem simultaneously?
2) Is there a way to back-up files from Ubuntu (including configurations and data) without having access to it? (in case if first two variants are impossible)
I know that maybe it is to late and i spoiled my system but I still hope. Thanks!
I write that as I tried to use ext2explore now but it gave no result
– Maksym Bondarenko May 23 '16 at 20:44