WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: problem booting with grub  (Read 4934 times)

Offline feddozz

  • Newbie
  • *
  • Posts: 27
problem booting with grub
« on: August 08, 2011, 08:22:24 AM »
Hi,

I installed tiny core, tc, in sda1. Ubuntu is present on the system, other partition.
The system was booting straight away to tc.
I booted to Ubuntu and repaired grub, but tc was not automatically detected, maybe that's normal.
Now I can only boot Ubuntu.

I am trying to add tinycore to the grub.cfg, with no success so far.

Here is my grub.cfg The tinycore entry is at the end.
Code: [Select]
#
# 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
set default="0"
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 {
  insmod vbe
  insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 5d6931b2-ae73-4d79-bfe4-4f5673b2b881
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 5d6931b2-ae73-4d79-bfe4-4f5673b2b881
set locale_dir=($root)/boot/grub/locale
set lang=it
insmod gettext
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=10
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 ###
menuentry 'Ubuntu, with Linux 2.6.35-28-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 5d6931b2-ae73-4d79-bfe4-4f5673b2b881
linux /boot/vmlinuz-2.6.35-28-generic root=UUID=5d6931b2-ae73-4d79-bfe4-4f5673b2b881 ro   quiet splash
initrd /boot/initrd.img-2.6.35-28-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-28-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 5d6931b2-ae73-4d79-bfe4-4f5673b2b881
echo 'Loading Linux 2.6.35-28-generic ...'
linux /boot/vmlinuz-2.6.35-28-generic root=UUID=5d6931b2-ae73-4d79-bfe4-4f5673b2b881 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-28-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,msdos6)'
search --no-floppy --fs-uuid --set 5d6931b2-ae73-4d79-bfe4-4f5673b2b881
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set 5d6931b2-ae73-4d79-bfe4-4f5673b2b881
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/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  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

menuentry "TinyCore" {
set root=(hd0,0)
linux /boot/bzImage tce=sda1 home=sda1 opt=sda1
initrd /boot/tinycore.gz
}

When boot TinyCore it says it does not find the partition.

Can you help  me?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11022
Re: problem booting with grub
« Reply #1 on: August 08, 2011, 08:43:54 AM »
grub2 counts from 1, not 0. Perhaps you meant hd(0,1)?
The only barriers that can stop you are the ones you create yourself.

Offline SamK

  • Hero Member
  • *****
  • Posts: 713
Re: problem booting with grub
« Reply #2 on: August 08, 2011, 09:04:10 AM »
I am trying to add tinycore to the grub.cfg, with no success so far.
This looks like a GRUB2 format - if so do heed the warning given at the head of the file.  Installing any updates often regenerates grub.cfg which will remove any entries you create in it.

To create a dual boot PC add entries to /etc/grub.d/40_custom and they will be preserved when grub.cfg is recreated.

You may find this page helpful:
https://help.ubuntu.com/community/Grub2
See the section Custom Menu Entries
   

Offline feddozz

  • Newbie
  • *
  • Posts: 27
Re: problem booting with grub
« Reply #3 on: August 08, 2011, 09:36:37 AM »
I edited /etc/grub.d/40_custom. Also found that in grub 2 partition start with 1 so I changed to set root=(hd0,1) and managed to boot.

I get a strange behaviour tough:
-when I browse my sda1 with fluff i cannot see any files, but if I open fluff typing sudo fluff on terminal then I can see the files in sda1.
-Also  tinycore does not seem to backup anything although the destination folder is correct /mnt/sda1/...

It looks like sda1 is protected from privileges. Is it something i need to specify in the boot codes?
« Last Edit: August 08, 2011, 09:39:37 AM by feddozz »

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: problem booting with grub
« Reply #4 on: August 08, 2011, 05:50:38 PM »
To get a better idea of your situation, would you please share the result of:   head /opt/.tce_dir /opt/.[bt]*

Offline feddozz

  • Newbie
  • *
  • Posts: 27
Re: problem booting with grub
« Reply #5 on: August 09, 2011, 12:37:59 PM »
To get a better idea of your situation, would you please share the result of:   head /opt/.tce_dir /opt/.[bt]*

here it is
Code: [Select]
==> /opt/.tce_dir <==
/mnt/sda1/tce

==> /opt/.backup_device <==
sda1/tce

==> /opt/.tce_dir <==
/mnt/sda1/tce
thank you

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11500
Re: problem booting with grub
« Reply #6 on: August 09, 2011, 12:45:51 PM »
Hi feddozz
Quote
-when I browse my sda1 with fluff i cannot see any files, but if I open fluff typing sudo fluff on terminal then I can see the files in sda1.
To see if it might be a permission problem post the output of
ls -l /mnt
ls -l /mnt/sda1

Offline feddozz

  • Newbie
  • *
  • Posts: 27
Re: problem booting with grub
« Reply #7 on: August 09, 2011, 12:52:35 PM »
ls -l /mnt:
Code: [Select]
total 8
drwxr-xr-x    2 root     root            40 Aug  9 17:46 hda/
drwxr-xr-x    2 root     root            40 Aug  9 17:46 sda1/
drwxrwxrwx   15 root     root          8192 Aug  9 17:47 sda5/
drwxr-xr-x    2 root     root            40 Aug  9 17:46 sda6/

ls -l /mnt/sda1:
Code: [Select]
total 0
Tnx

I am pretty sure it's a permission problem. Bear in mind that grub is installed in ubuntu and the grub.cfg stays in the ubuntu partition. That might be the cause. but i dunno how to solve it.
« Last Edit: August 09, 2011, 12:54:54 PM by feddozz »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11500
Re: problem booting with grub
« Reply #8 on: August 09, 2011, 01:03:37 PM »
Hi feddozz
You don't have write permission. Try
sudo chmod 777 /mnt/sda1
and see if that helps.

Offline feddozz

  • Newbie
  • *
  • Posts: 27
Re: problem booting with grub
« Reply #9 on: August 10, 2011, 08:11:40 AM »
Hi feddozz
You don't have write permission. Try
sudo chmod 777 /mnt/sda1
and see if that helps.


That worked,
Thanks!