LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-01-2015, 02:11 PM   #16
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249

OK, mount it an try again. I think I misread the post I was using so do this:

Code:
sudo mount /dev/sda1 /media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a
Then run the next command below. I noticed there was a typo in my previous post, 2 // forward slashes and there should only be one as below:

Code:
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a$i; done
After that, do the chroot as below:

Code:
sudo chroot /media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a
The prompt should change so then run:

Code:
sudo update-grub
Watching the output, you should see a new entry for sda1 and a new grub.cfg file should be created on sda1. If there are any warning messages or if it does not show success, make a note of the warnings and post here. Reboot to sda6 and from sda6, run: sudo update-grub again and you should see a new entry for sda1. Reboot and try the entry on sda1. After booting run: df -h to verify that you are on sda1. If you are, run: sudo grub-install /dev/sda
This will put Grub on the mbr but now it will be pointing to the Grub installed on sda1.

Last edited by yancek; 02-01-2015 at 02:28 PM.
 
Old 02-01-2015, 02:46 PM   #17
brokenhat
LQ Newbie
 
Registered: Jan 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
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
kek@kek-G41M-ES2L:~$ sudo chroot /media/kek/90f4d874-9e8d-44f1-92a1-1db889e0476a
root@kek-G41M-ES2L:/# sudo update-grub
sudo: nie udało się rozwiązać nazwy hosta kek-G41M-ES2L
Generating grub configuration file ...
Uwaga: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
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
gotowe
root@kek-G41M-ES2L:/#
There is some warning

Last edited by brokenhat; 02-01-2015 at 02:51 PM.
 
Old 02-01-2015, 03:35 PM   #18
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
Quote:
kek@kek-G41M-ES2L:~$
What is the prompt above from? Are you running these commands while booted to Xubuntu on sda6? It can't resolve that host name. Have you tried rebooting it to see if sda1 is available? Can you take a look at the grub.cfg file on sda1 while you are in the chroot to see what the menuentries show?

cat /boot/grub/grub.cfg
 
Old 02-01-2015, 04:03 PM   #19
brokenhat
LQ Newbie
 
Registered: Jan 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
I said that it doesn`t matter which Xubuntu i choose, both are loading to the same profile on sda6
Code:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  90f4d874-9e8d-44f1-92a1-1db889e0476a
else
  search --no-floppy --fs-uuid --set=root 90f4d874-9e8d-44f1-92a1-1db889e0476a
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=pl_PL
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=-1
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=hidden
    set timeout=0
  # Fallback hidden-timeout code in case the timeout_style feature is
  # unavailable.
  elif sleep --interruptible 0 ; then
    set timeout=0
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
	set gfxpayload="${1}"
	if [ "${1}" = "keep" ]; then
		set vt_handoff=vt.handoff=7
	else
		set vt_handoff=
	fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-90f4d874-9e8d-44f1-92a1-1db889e0476a' {
	recordfail
	load_video
	gfxmode $linux_gfx_mode
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  90f4d874-9e8d-44f1-92a1-1db889e0476a
	else
	  search --no-floppy --fs-uuid --set=root 90f4d874-9e8d-44f1-92a1-1db889e0476a
	fi
	linux	/boot/vmlinuz-3.13.0-32-generic root=UUID=90f4d874-9e8d-44f1-92a1-1db889e0476a ro  quiet splash $vt_handoff
	initrd	/boot/initrd.img-3.13.0-32-generic
}
submenu 'Opcje zaawansowane dla systemu Ubuntu' $menuentry_id_option 'gnulinux-advanced-90f4d874-9e8d-44f1-92a1-1db889e0476a' {
	menuentry 'Ubuntu, za pomocą systemu Linux 3.13.0-32-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-32-generic-advanced-90f4d874-9e8d-44f1-92a1-1db889e0476a' {
		recordfail
		load_video
		gfxmode $linux_gfx_mode
		insmod gzio
		insmod part_msdos
		insmod ext2
		set root='hd0,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  90f4d874-9e8d-44f1-92a1-1db889e0476a
		else
		  search --no-floppy --fs-uuid --set=root 90f4d874-9e8d-44f1-92a1-1db889e0476a
		fi
		echo	'Wczytywanie systemu Linux 3.13.0-32-generic...'
		linux	/boot/vmlinuz-3.13.0-32-generic root=UUID=90f4d874-9e8d-44f1-92a1-1db889e0476a ro  quiet splash $vt_handoff
		echo	'Wczytywanie początkowego dysku RAM...'
		initrd	/boot/initrd.img-3.13.0-32-generic
	}
	menuentry 'Ubuntu, with Linux 3.13.0-32-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-32-generic-recovery-90f4d874-9e8d-44f1-92a1-1db889e0476a' {
		recordfail
		load_video
		insmod gzio
		insmod part_msdos
		insmod ext2
		set root='hd0,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  90f4d874-9e8d-44f1-92a1-1db889e0476a
		else
		  search --no-floppy --fs-uuid --set=root 90f4d874-9e8d-44f1-92a1-1db889e0476a
		fi
		echo	'Wczytywanie systemu Linux 3.13.0-32-generic...'
		linux	/boot/vmlinuz-3.13.0-32-generic root=UUID=90f4d874-9e8d-44f1-92a1-1db889e0476a ro recovery nomodeset 
		echo	'Wczytywanie początkowego dysku RAM...'
		initrd	/boot/initrd.img-3.13.0-32-generic
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry 'Memory test (memtest86+)' {
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  90f4d874-9e8d-44f1-92a1-1db889e0476a
	else
	  search --no-floppy --fs-uuid --set=root 90f4d874-9e8d-44f1-92a1-1db889e0476a
	fi
	knetbsd	/boot/memtest86+.elf
}
menuentry 'Memory test (memtest86+, serial console 115200)' {
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  90f4d874-9e8d-44f1-92a1-1db889e0476a
	else
	  search --no-floppy --fs-uuid --set=root 90f4d874-9e8d-44f1-92a1-1db889e0476a
	fi
	linux16	/boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
(this is from sda1)
 
Old 02-01-2015, 04:24 PM   #20
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
So to make sure I understand what you have done, after doing the chroot to sda1, you ran sudo-update grub to create a new configuration file on that partition. You then rebooted into the Xubuntu on sda6 and also ran: sudo update-grub there. After doing that you reboot and select the option for sda1 and still get sda6, is that correct? That doesn't make any sense. You can clearly see the grub.cfg file you posted pointing to sda1.

If you run the command: sudo blkid to you see the UUID below for sda1?

Quote:
90f4d874-9e8d-44f1-92a1-1db889e0476a
When you select to boot to sda1, run: df -h Which partition shows as / ? It should be sda1, if you boot sda6, it should show sda6

Since the entries look right for the sda1 grub.cfg (if the UUID is correct) try putting the entry below in the grub.cfg file on sda6 to test it and then select the CHAINLOAD sda1 entry on boot.

Code:
menuentry 'CHAINLOAD sda1' {
insmod ext2
set root=(hd0,1)
chainloader +1
}
 
Old 02-01-2015, 05:16 PM   #21
brokenhat
LQ Newbie
 
Registered: Jan 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
Code:
kek@kek-G41M-ES2L:~$ sudo blkid
[sudo] password for kek: 
/dev/sda1: UUID="90f4d874-9e8d-44f1-92a1-1db889e0476a" TYPE="ext4" 
/dev/sda5: UUID="f5af1511-98ba-4f4f-a86a-8ef90d25ffc0" TYPE="swap" 
/dev/sda6: UUID="26e7f44b-7305-4b8d-8d04-b9d2614cf7f7" TYPE="ext4" 
/dev/sdf1: LABEL="FILMY" UUID="2A2C-25F6" TYPE="vfat"
That`s what i`m talking about /dev/sda1 mounts on /media/kek(...)
and sda6 mount on `/`
So it looks strange to me, like sda1 is inside sda6 (kek is sda6)
I want to make sda1 mounting point on `/` as you say and change sda6 to boot somewhere else (since i`m going to delete this partition later because it was only created to install GRUB) but i don`t know how to do this when sda6 has `/` and i`m currently running system on it
 
Old 02-01-2015, 08:17 PM   #22
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
Quote:
That`s what i`m talking about /dev/sda1 mounts on /media/kek(...)
Yes, of course it does. Any partitions on the Ubuntu derivatives will be accessible with mount points under /media/user, in your case:

/media/kek

sda1 is not inside sda6, that is the mount point for it to access it from sda6. The same would be true booting sda1, you would see sda6 available at a mount point: /media/kek/26e7f44b-7305-4b8d-8d04-b9d2614cf7f7 if the user on sda1 were also kek.

Quote:
I want to make sda1 mounting point on `/`
It is mounted on '/', when you boot to sda1. I have 10 different Linux operating systems on my personal computer. No matter which one I boot, it will show that specific partition mounted on /. Each operating installation has its own / partition. You have to boot that system first. The fact that you see sda1 available under /media is irrelevant to booting. You need to boot the sda1 install, run df -h and you should then see sda1 mounted on /

The grub.cfg file menuentry for sda1 is correct and should boot if selected. Did you run sudo update-grub on sda6 also after doing it with chroot on sda1? You need to do that. What happened when you put the chainload entry I suggested in my last post in the grub.cfg file on sda6 and selected it from the boot menu?

Do you have the different partitions labelled in grub.cfg so you know which is which?
Is this the first time you have used Linux/Xubuntu?

Last edited by yancek; 02-01-2015 at 08:27 PM.
 
Old 02-02-2015, 02:18 PM   #23
brokenhat
LQ Newbie
 
Registered: Jan 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
What happened when you put the chainload entry I suggested in my last post in the grub.cfg file on sda6 and selected it from the boot menu?
Code:
error: invalid signature
I was using Xubuntu for about 2 or maybe 3 years and that happened first time.
I dont wan`t to waste Your and my time any longer so i try to backup all important files from sda1 tommorow and then install new distribution, can i do something to avoid this problem in future?
I heard you can place special partition for GRUB.

I`m very thankful for your help

Last edited by brokenhat; 02-02-2015 at 02:22 PM.
 
Old 02-02-2015, 04:08 PM   #24
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
The invalid signature is a strange error. Usually it is indicating a Linux filesystem in the menu and trying to boot an ntfs, or vice versa. There may be other reasons also.

I'm not totally sure about this but if I remember correctly, this all started for you when the 'normal.mod' file disappeared and it failed to boot and you got a message to that effect. I don't have Xubuntu installed but I do have an Ubuntu 14.04 installation and on it there is a boot directory with a grub sub-directory in it and a sub-directory inside grub name i386-pc. This last directory contains a large number of small files including 'normal.mod'. If you run into that situation again, I would just copy that file to /boot/grub/i386-pc and give it a shot. All of these .mod files are also on the system under /usr/lib/grub/i386-pc which I guess is where they come from when installing Grub. There was no reason for you to use the 'apt-get' command to download and install Grub as it is already on the machine.

It's hard to know how to avoid the problem without knowing what caused it. The normal.mod and other files don't usually disappear but weird things do happen with computers.

Generally, if you have multiple operating system and you can boot one which has grub2 and you can't boot the other, you would boot the running system and do the commands below consecutively, watching the output. It's strange this did not work when you re-booted and selected the sda1 entry because the output you posted from os-prober in post 13 above, distinctly shows an entry for sda1. That should have shown when you scrolled down the boot menu:

Code:
sudo os-prober
sudo update-grub
The first command should find other operating systems and the second will create a new grub.cfg file. If you are still unable to boot the second system, you need to do the chroot method I described earlier. That way you will be running inside the unbootable partition, installing Grub and creating a new grub.cfg. Your output after doing this showed a correct grub.cfg file, right menuentries so I don't know why it didn't work with the chainload.

A method I use which is similar to the one I described earlier is below but this chroots to the partition, installs grub to the partition and creates a new grub.cfg file. The mount points and partitions would all need to be changed if it is not sda1 and if it is not mounted at /mnt/sda1:

Code:
sudo mkdir /mnt/sda1 
sudo mount -t ext4 -o rw /dev/sda1 /mnt/sda1
sudo mount -t proc none /mnt/sda1/proc
sudo mount -o bind /dev /mnt/sda1/dev
sudo mount -o bind /sys /mnt/sda1/sys
sudo mount -t devpts devpts /mnt/sda1/dev/pts
sudo chroot /mnt/sda1
sudo grub-install --force --root-directory=/mnt/sda1 /dev/sda1
sudo update-grub
When you finish your install and have time, take a look at the site below which is very detailed and has a number of methods you can use for re-installing Grub. Be a good idea to bookmark it. Good luck.

https://help.ubuntu.com/community/Gr...talling_GRUB_2

Last edited by yancek; 02-02-2015 at 04:14 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Xubuntu 8.04 - edit grub meridius10 Ubuntu 13 04-26-2013 06:29 AM
GRUB Xubuntu Boot Problems Wolfcube Linux - Newbie 12 07-17-2010 07:37 PM
[SOLVED] xubuntu grub problem Josh000 Ubuntu 7 05-29-2010 09:01 AM
Xubuntu install from a partition Amdx2_x64 Linux - Newbie 3 08-21-2008 02:42 PM
Why won't my Xubuntu partition load? LMD1990 Linux - Newbie 2 06-16-2008 02:56 AM


All times are GMT -5. The time now is 08:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration