dual boot problems
Tod Merley
todbot88 at gmail.com
Wed Sep 13 08:28:00 UTC 2006
On 9/12/06, J Philip <jayphi at gmail.com> wrote:
> Hello,
>
> I am having a problem booting into Ubuntu 6.06 which is installed on my
> second hard drive. My first hard drive is 80 GB and has windows xp
> installed on it, and my second hard drive is 120 GB contains ubuntu. After
> installing Ubuntu, I was able to login and use it. Then I restarted the
> computer and booted into win xp. After that I restarted the computer once
> again to use Ubuntu, but then I recieved an error message after it tried to
> mount the root filesystem: /bin/sh: can't access tty; job control turned
> off. Can someone please help? I tried googling the error but I was not
> able to find a solution.
>
> Jay
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
>
>
Hi Jay!
I am learning this stuff in the process of preparing a presentation
for our local Linux User Groups. I also have done multi-boot
computers and will be doing that operation on the one I am typing on
in a few days.
I am no expert, I guess we will try to sort it out together.
>From the Googleing I have done I would guess that GRUB is unable to
locate a boot device and attempts to drop you to a shell, but, not
enough available to do so.
To sort this out we need to gather some information. What follows is
kind of a guided tour through my computer showing how to grab the
information from your computer:
# First establish sudo ("root") privilege and do an "fdisk -l"
--------------------------------------
tod at tod-desktop:~$ sudo -i
Password:
root at tod-desktop:~# fdisk -l
Disk /dev/hda: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 9800 78718468+ 83 Linux
/dev/hda2 9801 9964 1317330 5 Extended
/dev/hda5 9801 9964 1317298+ 82 Linux swap / Solaris
---------------------------------------
# I then remembered that you have two disks so I plugged in a flash drive
---------------------------------------
root at tod-desktop:~# fdisk -l
Disk /dev/hda: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 9800 78718468+ 83 Linux
/dev/hda2 9801 9964 1317330 5 Extended
/dev/hda5 9801 9964 1317298+ 82 Linux swap / Solaris
Disk /dev/sda: 1007 MB, 1007681536 bytes
16 heads, 32 sectors/track, 3844 cylinders
Units = cylinders of 512 * 512 = 262144 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 3844 984048 e W95 FAT16 (LBA)
------------------------------------
# I suppose it is a bit redundant but I really do like to see how
"parted" also sees things
-----------------------------------
root at tod-desktop:~# parted
GNU Parted 1.6.25.1
Copyright (C) 1998 - 2005 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
Using /dev/hda
(parted) print
Disk geometry for /dev/hda: 0kB - 82GB
Disk label type: msdos
Number Start End Size Type File system Flags
1 32kB 81GB 81GB primary ext3 boot
2 81GB 82GB 1349MB extended
5 81GB 82GB 1349MB logical linux-swap
(parted) select /dev/sda
Using /dev/sda
(parted) print
Disk geometry for /dev/sda: 0kB - 1008MB
Disk label type: msdos
Number Start End Size Type File system Flags
1 16kB 1008MB 1008MB primary fat16 boot, lba
(parted) quit
Information: Don't forget to update /etc/fstab, if necessary.
root at tod-desktop:~#
------------------------------------
# But what we need to understand is how grub sees the disks
------------------------------------
root at tod-desktop:~# grub
Probing devices to guess BIOS drives. This may take a long time.
------------------------------------
# Shown above, the grub command - Below - grub command environment
-----------------------------------
GNU GRUB version 0.97 (640K lower / 3072K upper memory)
[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
-------------------------------------
# added comment - note above TAB information!!
------------------------------------
grub> root (hd
Possible disks are: hd0 hd1
-----------------------------------
# added - above I typed "root (" and then hit "TAB" - note results!
-----------------------------------
grub> root (hd0,
Possible partitions are:
Partition num: 0, Filesystem type is ext2fs, partition type 0x83
Partition num: 4, Filesystem type unknown, partition type 0x82
------------------------------------
# added - above I added "0" to the "(hd" and hit "TAB"
------------------------------------
grub> root (hd1,0)
-----------------------------------
# appended - above I backspaced and made it lood at "hd1" then "TAB.
Now we know what partitions we have and how GRUB sees them. Next we
need to look at /boot/grub/menu.lst. I go through the whole process
of finding and looking at it so you can note the location of some
other things. It is kind of long but scan through and spend some time
in menu.lst which is the grub configuration file:
-----------------------------------------------------
root at tod-desktop:~# cd /boot
root at tod-desktop:/boot# ls
System.map-2.6.15-23-386 config-2.6.15-23-386 initrd.img-2.6.15-26-386
System.map-2.6.15-26-386 config-2.6.15-26-386 memtest86+.bin
abi-2.6.15-23-386 grub vmlinuz-2.6.15-23-386
abi-2.6.15-26-386 initrd.img-2.6.15-23-386 vmlinuz-2.6.15-26-386
root at tod-desktop:/boot# cd grub
root at tod-desktop:/boot/grub# ls
default fat_stage1_5 menu.lst~ stage1
device.map jfs_stage1_5 minix_stage1_5 stage2
e2fs_stage1_5 menu.lst reiserfs_stage1_5 xfs_stage1_5
root at tod-desktop:/boot/grub# cat menu.lst
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu
# Pretty colours
#color cyan/blue white/blue
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#
#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hda1 ro
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)
## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true
## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false
## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all
## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true
## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false
## ## End Default Options ##
title Ubuntu, kernel 2.6.15-26-386
root (hd0,0)
kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.15-26-386
savedefault
boot
title Ubuntu, kernel 2.6.15-26-386 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/hda1 ro single
initrd /boot/initrd.img-2.6.15-26-386
boot
title Ubuntu, kernel 2.6.15-23-386
root (hd0,0)
kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.15-23-386
savedefault
boot
title Ubuntu, kernel 2.6.15-23-386 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hda1 ro single
initrd /boot/initrd.img-2.6.15-23-386
boot
title Ubuntu, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
boot
### END DEBIAN AUTOMAGIC KERNELS LIST
root at tod-desktop:/boot/grub#
-------------------------------------------------------------
# to see what a two disk boot could look like see link (note "hd0,.0" "hd1,4")
http://www.linuxquestions.org/questions/showthread.php?t=297681
I hope this moves you in a positive direction. Remember that there is
only one Master Boot Record. When you use GRUB to form it, you need
to point GRUB to where your disks are in it's understanding of what to
call things.
Most people running Linux / XP come to the happiest place using the XP
boot loader. This is often because machine management, antivirus, or
other XP software checks the Master Boot Record and "fixes" it (kills
GRUB!!) if it is not the XP generated Master Boot Record (the "fixmbr"
command from the XP recovery console).
It would be helpful to us if you do share what you find!
Have fun and good hunting!
Tod
More information about the ubuntu-users
mailing list