LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-17-2012, 06:02 AM   #1
newbie0101
Member
 
Registered: Nov 2011
Posts: 47

Rep: Reputation: Disabled
Debian disappeared after CentOS installation


hello, i have installed windows 7 and debian on my HDD.
today i installed centos along them.
when it comes to boot menu i see only centos and other.
when i choose other it starts booting windows so don't know how to get into debian.
here is my centos grub.conf:
Code:
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,7)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-220.2.1.el6.i686)
	root (hd0,7)
	kernel /boot/vmlinuz-2.6.32-220.2.1.el6.i686 ro root=UUID=b1115e42-0dde-4d09-9112-cf28fbdae89d rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 printk.time=1  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM crashkernel=auto
	initrd /boot/initramfs-2.6.32-220.2.1.el6.i686.img
title CentOS (2.6.32-220.el6.i686)
	root (hd0,7)
	kernel /boot/vmlinuz-2.6.32-220.el6.i686 ro root=UUID=b1115e42-0dde-4d09-9112-cf28fbdae89d rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 printk.time=1  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
	initrd /boot/initramfs-2.6.32-220.el6.i686.img
title Other
	rootnoverify (hd0,1)
i tried to add this lines to that conf:
Code:
title Debian 
        root (hd0,7)
        kernel /boot/vmlinuz-2.6.32-5-amd64 root=UUID=d966a81e-611f-45c4-9006-c6a3c01eac6e ro printk.time=1 
        initrd /boot/initrd.img-2.6.32-5-amd64
btw this lines i copied from debian grub.conf
when it comes to boot menu and i choose Debian it shows some error 5.
i see that centos is also at hd0,7.

yet, i'll put my debian grub.conf:
Code:
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  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 load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set d966a81e-611f-45c4-9006-c6a3c01eac6e
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,msdos7)'
search --no-floppy --fs-uuid --set d966a81e-611f-45c4-9006-c6a3c01eac6e
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set d966a81e-611f-45c4-9006-c6a3c01eac6e
insmod png
if background_image /usr/share/images/desktop-base/spacefun-grub.png; then
  set color_normal=light-gray/black
  set color_highlight=white/black
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos7)'
	search --no-floppy --fs-uuid --set d966a81e-611f-45c4-9006-c6a3c01eac6e
	echo	'Loading Linux 2.6.32-5-amd64 ...'
	linux	/boot/vmlinuz-2.6.32-5-amd64 root=UUID=d966a81e-611f-45c4-9006-c6a3c01eac6e ro  printk.time=1
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-2.6.32-5-amd64
}
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos7)'
	search --no-floppy --fs-uuid --set d966a81e-611f-45c4-9006-c6a3c01eac6e
	echo	'Loading Linux 2.6.32-5-amd64 ...'
	linux	/boot/vmlinuz-2.6.32-5-amd64 root=UUID=d966a81e-611f-45c4-9006-c6a3c01eac6e ro single 
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-2.6.32-5-amd64
}
### END /etc/grub.d/10_linux ###

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

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
	insmod part_msdos
	insmod ntfs
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set a27868a4786878c5
	chainloader +1
}
menuentry "Windows 7 (loader) (on /dev/sda2)" {
	insmod part_msdos
	insmod ntfs
	set root='(hd0,msdos2)'
	search --no-floppy --fs-uuid --set bc1e8f171e8eca3a
	chainloader +1
}
menuentry "Windows Recovery Environment (loader) (on /dev/sda4)" {
	insmod part_msdos
	insmod ntfs
	set root='(hd0,msdos4)'
	search --no-floppy --fs-uuid --set 66501bd0501ba5b9
	drivemap -s (hd0) ${root}
	chainloader +1
}
### 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 ###
can you give me some advice how to boot debian please ?
or there is only one way to reinstall debian ?
thanks
 
Old 01-17-2012, 06:59 AM   #2
sab0403
LQ Newbie
 
Registered: Jan 2012
Posts: 6

Rep: Reputation: Disabled
Both Debian and CentOS can't be at the same partition.

Try an fdisk -l, see what it spits out. I'm thinking your Debian partition is either somewhere else (say, partition 5) or you installed *over* it, in which case, of course, there is no triple booting.
 
Old 01-17-2012, 07:19 AM   #3
newbie0101
Member
 
Registered: Nov 2011
Posts: 47

Original Poster
Rep: Reputation: Disabled
debian is installed on sda7 and centos i installed on sda8 as you can see:
Code:
df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda8              97G  4.4G   91G   5% /
tmpfs                 1.9G  600K  1.9G   1% /dev/shm
/dev/sda9             138G  188M  131G   1% /media/storage <- this is just a storage partition
here is output of fdisk -l:
Code:
Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x351e0e27

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         192     1536000   27  Unknown
Partition 1 does not end on cylinder boundary.
/dev/sda2             192        6566    51200000    7  HPFS/NTFS
/dev/sda3            6566       75916   557056001    f  W95 Ext'd (LBA)
/dev/sda4           75916       77826    15337472   17  Hidden HPFS/NTFS
/dev/sda5            6566       32063   204800000    7  HPFS/NTFS
/dev/sda6           75222       75916     5575680   82  Linux swap / Solaris
/dev/sda7           32063       44220    97654784   83  Linux
/dev/sda8           44220       56968   102400000   83  Linux
/dev/sda9           56969       75221   146616320   83  Linux

Partition table entries are not in disk order
i wonder why is in grub.conf hd0,7, i'd say it should be hd0,8 instead but it was default
 
Old 01-17-2012, 07:22 AM   #4
sab0403
LQ Newbie
 
Registered: Jan 2012
Posts: 6

Rep: Reputation: Disabled
Well, if Debian is on sda7, then you should find it on hd0,6.

Try that change, it should work.

Quote:
Originally Posted by newbie0101 View Post
debian is installed on sda7 and centos i installed on sda8 as you can see:
Code:
df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda8              97G  4.4G   91G   5% /
tmpfs                 1.9G  600K  1.9G   1% /dev/shm
/dev/sda9             138G  188M  131G   1% /media/storage <- this is just a storage partition
here is output of fdisk -l:
Code:
Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x351e0e27

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         192     1536000   27  Unknown
Partition 1 does not end on cylinder boundary.
/dev/sda2             192        6566    51200000    7  HPFS/NTFS
/dev/sda3            6566       75916   557056001    f  W95 Ext'd (LBA)
/dev/sda4           75916       77826    15337472   17  Hidden HPFS/NTFS
/dev/sda5            6566       32063   204800000    7  HPFS/NTFS
/dev/sda6           75222       75916     5575680   82  Linux swap / Solaris
/dev/sda7           32063       44220    97654784   83  Linux
/dev/sda8           44220       56968   102400000   83  Linux
/dev/sda9           56969       75221   146616320   83  Linux

Partition table entries are not in disk order
i wonder why is in grub.conf hd0,7, i'd say it should be hd0,8 instead but it was default
 
Old 01-17-2012, 07:33 AM   #5
newbie0101
Member
 
Registered: Nov 2011
Posts: 47

Original Poster
Rep: Reputation: Disabled
thank you it works after i changed it
btw so if some OS is on partition let's say sda7 then it's still hd0,6 ?
 
Old 01-17-2012, 07:41 AM   #6
sab0403
LQ Newbie
 
Registered: Jan 2012
Posts: 6

Rep: Reputation: Disabled
Quote:
Originally Posted by newbie0101 View Post
thank you it works after i changed it
btw so if some OS is on partition let's say sda7 then it's still hd0,6 ?
Yes. When fdisk or df or some other command like that lists partitions, they start from one. So the first partition would be sda1 (or hda1, in older computers), then you'd have sda2, etc. As you can see, the disks start from the letter 'a' and onward (a second disk, for instance, would be sdb).

However, grub starts from 0, so the first partition is hd0,0, then hd0,1, and so on. Same thing applies to disks (third partition on second disk would be hd1,2).

So if you want to edit grub, substract one to the partition number, and you'll have it right. What was happening to your conf is that you were trying to boot CentOS with the Debian configuration (and probably a kernel image that doesn't exist in that partition too).
 
  


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
After Ubuntu installation a HDD disappeared blacksimos Linux - Newbie 3 12-16-2007 01:58 AM
debian disappeared my ubuntu! aquaboot Ubuntu 2 12-23-2006 01:21 AM
'Debian' Submenu Disappeared rickh Debian 2 02-26-2006 08:59 PM
Eth0 and Eth1 disappeared in Debian 3.1 Sarge... JoeneB Linux - Networking 1 11-01-2005 07:52 AM
Problem: SCSi CD drive disappeared during installation RickWortelboer Debian 3 05-27-2005 04:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:03 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
Open Source Consulting | Domain Registration