LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GRUB can`t see my second Xubuntu partition (https://www.linuxquestions.org/questions/linux-newbie-8/grub-can%60t-see-my-second-xubuntu-partition-4175532602/)

brokenhat 01-31-2015 09:46 AM

GRUB can`t see my second Xubuntu partition
 
Hello, i hope i created this thread in good place

I have 2 linux Xubuntu 14.04 partitions
GRUB shows only one partition, i cannot switch user to the second partition too, but file manager sees it right.

In GParted it looks like this:
 http://s23.postimg.org/igpp2j1jf/Scr...5_19_08_53.png

the bigger dev/sda/1 partition is my old one which i want to boot with GRUB and use it

and /dev/sda/6 is new which i need to remove

But i cannot do this because GRUB doesn`t see /dev/sda/1, so what can i do?

My GRUB version is 2.02~beta2-9ubuntu1, i tried to update it with sudo update-grub but no effects.

Thanks for your effort

yancek 01-31-2015 02:35 PM

Try running: sudo os-prober and watch the output for an entry for sda1 then run sudo update-grub. If that doesn't work, google bootinfoscript and go to the site and download and run it then post the output, a results.txt file here.

brokenhat 01-31-2015 05:37 PM

http://ubuntu.pl/forum/viewtopic.php?f=127&t=177301
this is the same thread on other forum, please take look on the codes because the rest is in another language

Now my goal is to login to bigger partition and re-install there grub since it`s installed using terminal in new partition
but i cannot do this because it can`t connect to the internet by sda1 in terminal

colorpurple21859 01-31-2015 06:19 PM

have you tried chroot from the second install to fix the first install?

brokenhat 01-31-2015 06:38 PM

first install is ok, the problem is that i want to login to first install (dev/sda1) using terminal and re-install GRUB but cannot do this because internet does not work when i use terminal and login within.

Code:

root@kek-G41M-ES2L:/# apt-get install --reinstall grub-pc
Czytanie list pakietów... Gotowe
Budowanie drzewa zależności     
Odczyt informacji o stanie... Gotowe
0 aktualizowanych, 0 nowo instalowanych, 1 ponownie instalowanych, 0 usuwanych i 75 nieaktualizowanych.
Konieczne pobranie 173 kB archiwów.
Po tej operacji zostanie dodatkowo użyte 0 B miejsca na dysku.
Błąd  http://pl.archive.ubuntu.com/ubuntu/ trusty-updates/main grub-pc amd64 2.02~beta2-9ubuntu1
  Nie udało się przetłumaczyć nazwy "pl.archive.ubuntu.com"
E: Nie udało się pobrać http://pl.archive.ubuntu.com/ubuntu/pool/main/g/grub2/grub-pc_2.02~beta2-9ubuntu1_amd64.deb  Nie udało się przetłumaczyć nazwy "pl.archive.ubuntu.com"

E: Nie udało się pobrać niektórych archiwów, proszę spróbować uruchomić apt-get update lub użyć opcji --fix-missing.

All code is on site that i linked, i`m stuck

yancek 01-31-2015 09:05 PM

You are able to boot the Xubuntu on sda6 but cannot boot the Xubuntu on sda1, correct? The reason you can't boot the system on sda1 is because you don't have any Grub files on that partition. Since both systems are Xubuntu 14.04, you can simplify the process by simply copying all the files from sda6 /boot/ to the /boot directory on sda1.

Once you have done that and while still booted into sda6, run: sudo update-grub and/or sudo os-prober
If you see output for sda1, reboot and you should see an option to boot sda1, select that and if it boots, open a terminal and run: sudo update-grub then since you want to use sda1, run: sudo grub-install /dev/sda while booted into the system on sda1.

This should work but it is not a standard method and would only work since you are running two identical systems.

brokenhat 01-31-2015 09:51 PM

Thanks, now i know what`s going on

http://s23.postimg.org/igpp2j1jf/Scr...5_19_08_53.png

So it llooks like this:

I copied boot files and now GRUB shows two options

one is Xubuntu
and one is Xubuntu /dev/sda1

But both are starting the same profile so i guess i need to change /dev/sda1 mounting point since now it doesn`t has one and do something with `/` mounting point in /dev/sda6.

But how can i do it safely?

yancek 01-31-2015 10:11 PM

The first thing I would do, assuming you are able to boot the Xubuntu on sda6 and what you actually want is to use sda1, is to boot to sda6 which you can do, then create a mount point for sda1 then mount sda1:

Code:

sudo mkdir /mnt/sda1
Code:

sudo mount /dev/sda1 /mnt/sda1
Then just copy the files. I haven't tried this method and am not sure it will work but I can't see why not. Nothing to lose since you can't boot it. Your previous bootinfo output showed no grub files on sda1. When you mount sda1, verify this by checking the /boot and /boot/grub directories. Also, check to see if you have a kernel (vmlinuz) file and an initrd file in /boot on sda1. If they aren't there, you will need to copy the entire /boot directory from sda6 to sda1. Make sure you copy and don't use the move command.


Quote:

When i installed new partition it forced to boot on /
and moved old partition files to the /media/
I'm not sure what you are asking but when you installed Xubuntu to sda6 and you boot to sda6, it is shown as / (root). If you were to boot to sda1, it would show itself as / (root). You can see the xubuntu files on sda1 under /media/user while booted to sda6 but if you were able to boot xubuntu on sda1, the xubuntu files on sda6 would show under /media/user. So the files on sda1 are not "moved" to /media/user but are simply available there from sda6.

brokenhat 01-31-2015 10:16 PM

i`m very sorry i edited post while you was answering

Now when i did sudo mkdir and sudo mount

sda1 has mounting point in
Code:

/media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a, /mnt/sda1

yancek 02-01-2015 08:29 AM

After booting the Xubuntu on sda6, you copied the /boot/grub files to sda1. Is that correct? Did you verify that there was a kernel (vmlinuz file) on sda1 as well as an initrd file there in the boot directory?

Quote:

I copied boot files and now GRUB shows two options
Did you run the sudo update-grub from sda6? So you now have two entries and one of them is for sda6 and the other is for sda1, is that correct?
When you select the entry for sda1, can you boot it?

Quote:

/media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a, /mnt/sda1
I'm not sure why you are doing that. Those are both mount points. You can access sda1 under the /media directory as shown above OR you could mount it as /mnt/sda1, don't do both. If you want to manually mount you would need the device name as below:

Code:

sudo mount /dev/sda1 /mnt/sda1
Did your Xubuntu on sda1 ever work after installing? If not, you might find it simpler to reinstall it and leave the default to install the bootloader to the master boot record; /dev/sda.

You could also simply reinstall Grub to sda1 but if you do not have a kernel and initrd, that won't help.
The Grub files are also in /usr/lib/grub/i386-pc on Xubuntu on either install and you could probably use the chroot method suggested above to install Grub on sda1 and then run sudo update-grub. Using the chroot method is a little more complicated and is explained at the link below:

https://help.ubuntu.com/community/Gr...ing#via_ChRoot

I guess the important question now is, can you boot sda1?

brokenhat 02-01-2015 09:42 AM

Yes files in /dev/sda1 boot folder are the same like in /dev/sda6 and i did update GRUB.
I have two options in GRUB but whatever i choose it loads ``kek`` profile which is /dev/sda6

now when i did
Code:

sudo mkdir /mnt/sda1
and
Code:

sudo mount /dev/sda1 /mnt/sda1
as you said it simply loaded on
Code:

/media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a, /mnt/sda1
so it looks like this http://s1.postimg.org/3qyso48sf/Scre...5_16_25_36.png .

And this is what i get when i click on these two devices in file manager:
http://postimg.org/gallery/36q458sw/

This is the full story:
/dev/sda1 was my only system partition which i used at usually and everything was working fine
next day i turned on my computer and GRUB doesn`t loaded, it was showing
Code:

/boot/grub/i386-pc/normal. mod not found
So i putted pendrive with Xubuntu distribution and in UNetbootin there wasn`t option to install only GRUB so i decided to divide one big partition and create small as possible for second Xubuntu because i needed to install GRUB with it.
And after it i was only able to boot new /dev/sda6 partition and it looks like it simply changed mounting point as seen in GParted.

Would changing /dev/sda1 to mounting point `/` and /dev/sda6 to another solve problem?

yancek 02-01-2015 10:19 AM

Open the file manager and go to: /media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a

Look in the /boot directory and verify that you have a grub directory. Also check to see if the other grub files are there. You show the links to the vmlinux and initrd files in the root of sda1 so verify that these files are under the /boot directory here. Also, verify that the normal.mod file is there, probably under /boot/grub/i386-pc directory.

If the files are there run from your bootable Xubuntu on sda6: sudo os-prober - watch the output then run: sudo update-grub - again, watch the output. You should see an entry for sda1 if all the correct files have been verified to be on sda1. After doing this, re-boot the computer and look for an entry for sda1. If the update-grub added an sda1 entry, it should be there and boot.

I don't know what happened to your normal.mod file but it won't boot without it.

Quote:

Would changing /dev/sda1 to mounting point `/` and /dev/sda6 to another solve problem?
No.

brokenhat 02-01-2015 11:03 AM

I already did that and checked files before and one GRUB option is Xubuntu, second is Xubuntu /dev/sda/1.
Both are loading the same (new) profile
Code:

kek@kek-G41M-ES2L:~$ sudo os-prober
[sudo] password for kek:
/dev/sda1:Ubuntu 14.04.1 LTS (14.04):Ubuntu:linux
kek@kek-G41M-ES2L:~$ sudo update-grub
Generating grub configuration file ...
Znaleziono obraz Linuksa: /boot/vmlinuz-3.13.0-32-generic
Znaleziono obraz initrd: /boot/initrd.img-3.13.0-32-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Znaleziono Ubuntu 14.04.1 LTS (14.04) na /dev/sda1
gotowe

so that`s why i was thinking about changing mount point

yancek 02-01-2015 11:31 AM

The os-prober output in your last post shows an entry for sda1 is detected. What happens when you move the arrow key down to that entry on the boot menu to select and hit Enter? Does it boot? So you have checked sda1 and you have the /boot/grub and i386-pc directories with the vmlinuz and initrd files, correct. Is there a normal.mod file in i386-pc?

Quote:

Both are loading the same (new) profile
Does that mean when you select sda1 you are still on sda6? Then boot sda6 and go to the /boot/grub directory of sda1;
/media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a and delete the grub.cfg file there then do chroot as shown below. F
first from a terminal run: df -h to see if /media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a is mounted. If it is, unmount it and run:

Code:

for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i //media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a$i; done
Hit the Enter key and then run:
Code:

sudo chroot /media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a
Hit the Enter key and Make sure you have deleted the grub.cfg file then run: sudo update-grub

The standard method of reinstalling grub, specifically for your partition is below. This installs Grub to the master boot record pointing to the Grub files on sda1. If you are missing a vmlinuz or initrd file it won't work. The problem with this is that if it fails, your machine is un-bootable. If you still have the installation medium you can re-install to sda6 with a similar command by replacing the UUID below for sda with the correct UUID for sda6:

Quote:

sudo grub-install --boot-directory=/media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a/boot /dev/sda

brokenhat 02-01-2015 12:04 PM

Yes as i said i already checked these files and normal.mod is there.

Grub.cfg is in
Code:

/media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a/boot/grub/
and i deleted it

Code:

kek@kek-G41M-ES2L:~$ df -h
System plików  rozm. użyte dost. %uż. zamont. na
/dev/sda6        26G  7,5G  17G  32% /
none            4,0K    0  4,0K  0% /sys/fs/cgroup
udev            2,0G  4,0K  2,0G  1% /dev
tmpfs          396M  1,3M  394M  1% /run
none            5,0M    0  5,0M  0% /run/lock
none            2,0G  316K  2,0G  1% /run/shm
none            100M  32K  100M  1% /run/user
/dev/sda1      430G  35G  373G  9% /media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a
/dev/sdf1      3,8G  3,7G  110M  98% /media/kek/FILMY

so i unmounted it with GParted and did
Code:

kek@kek-G41M-ES2L:~$ for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i //media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a$i; done
[sudo] password for kek:
mount: punkt montowania //media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a/dev nie istnieje
mount: punkt montowania //media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a/dev/pts nie istnieje
mount: punkt montowania //media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a/proc nie istnieje
mount: punkt montowania //media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a/sys nie istnieje
mount: punkt montowania //media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a/run nie istnieje

``nie istnieje`` means ``doesn`t exist``
so i dont know if im ready to do next steps


All times are GMT -5. The time now is 07:18 AM.