Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I had windows xp,vista and ubuntu in my system.So when i used to boot my computer then first grub comes.It had option to boot into vista.then vista boot loader had xp boot loader in it. Due to some prob I deleted windows vista drive.Now when I boot computer then grub loads and says error 17.what should I do.I want xp and ubuntu both.........help!!!!!!!!!
Probably the easiest thing to do is boot off of a live/recovery CD, manipulate the partitions, and re-run grub-install to reinstall the bootloader. Depoending on how you're doing it, you may need to use the --root-directory flag to grub-install to tell it where it should puyt its second stage loader (usually this is /boot/grub and you may also need to edit the menu.lst to make sure both XP and Ubuntu are bootable.
Probably you screwed up the partition numbers by deleting the Vista partition.
When i run this grub-install /dev/sda depending command I get this error:
could not find device for /boot:not found or not a block device
also I dont have /boot/grub/menu.lst present in my grub folder
and my fdisk command gives output like this
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 1305 10482381 c W95 FAT32 (LBA)
/dev/sda2 1306 19456 145797907+ f W95 Ext'd (LBA)
/dev/sda5 1306 6404 40957686 7 HPFS/NTFS
/dev/sda6 6405 11503 40957686 7 HPFS/NTFS
/dev/sda7 11504 12721 9783553+ 7 HPFS/NTFS
/dev/sda8 * 12722 13994 10225341 83 Linux
/dev/sda9 13995 14053 473886 82 Linux swap / Solaris
/dev/sda10 14054 16602 20474811 7 HPFS/NTFS
/dev/sda11 16603 19456 22924723+ 7 HPFS/NTFS
it is easy to recover grub.
i think you have all OS cd. set of Ubuntu
just insert first cd in sys. and reboot sys.
now when you get first boot screen, which we are getting at the time of
installation,
on that screen give following command
linux rescue
and press enter.
it will ask you few things and will tell you few things,
give proper answer regarding your network and as per your environment.
then you will get single user prompt. on that shell environment check that
whether your grub.conf file is there or it get currepted.
cat /boot/grub/grub.conf
if you can see this file then it is good.
then its meanding that you need to reconfigure MBR. but as you had told
that you had install xp again, it iwill not there.
so just use follow commands to generate your grub.conf file.
grub-install-/dev/hda or whatever your boot device is there.
after giving this comman you will get message that Done.
simple reboot sys. and check that did u get grub boot loader or not.
But sir where do I type these commands....i mean that whenever i boot into live cd of ubuntu then their is no option to type any command they have their own options like start or install ubuntu
mem test
and etc
tell me where I should I type them
The rescue mode is provided by some but not all Linux.
The standard method is to boot up any Linux Live CD (in this case just use Ubuntu CD) make a temp directory in /mnt, then mount the Linux partition and then change root into it. This is the standard technique of booting up the kernel of a Live CD but using the Bash shell of the unbootable Linux.
The rescue mode in any installation CD is doing exactly the same thing except it makes the tempoarary directory and mounts the partition for for automatically. The steps are simple Linux commands so learn it once and kiss good bye to all your booting problems because it is the same method to rescue a Lilo.
Thus using Ubuntu CD in the OP case would involve
(1) Boot up the Ubuntu CD
(2) click terminal, make a temp directory in /mnt/sda8, mount the device sda8 on it, chroot into the unbootable Ubuntu in sda8, fire up grub-install command and exit back to the LIve CD Linux
Code:
sudo mkdir /mnt/sda8
sudo mount /dev/sda8 /mnt/sda8
sudo chroot /mnt/sda8
after this point the user is actually inside the unbootable Ubuntu of sda8 and so the grub-install will repair the Grub there by
Code:
grub-install /dev/sda
exit
sudo reboot
One must exit first from the unbootable Ubuntu in sda8 first back to the Live CD.
Since the user enters into unbootable Ubuntu of sda8 as the root user the red commands are privileged and will be accepted without preceding with "Sudo".
If the above does not yield expected result using a Grub shell should do the trick as a Grub shell is more robust than "grub-install" inside a Bash shell.
The Grub shell method needs no change root but the Live CD must have Grub. Since Ubuntu CD has it so the commands on booting it up are
There needs to be a shell to run in the chroot environment. Since you (should be) chrooting into your Linux / partition /bin/bash should work fine. Can you do an "ls /mnt/sda8/bin/bash" before trying the chroot to make sure it is there and a valid executable file. If not, please go through saikee's commands again, note any errors you get trying to set up and mount /dev/sda8, and post them here.
At last I recovered my grub!!!but no I am trapped in one more prob....When I try to load the linux it says
error 17:cannot mount the selected partition
Now whats that!!!!!
Here is 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 10
## 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=UUID=c9da3458-9d9f-480f-90b2-47226115b63c ro
## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,9)
## 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
## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false
## Xen hypervisor options to use with the default Xen boot option
# xenhopt=
## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) 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
title Ubuntu, kernel 2.6.17-10-generic (recovery mode)
root (hd0,9)
kernel /boot/vmlinuz-2.6.17-10-generic root=UUID=c9da3458-9d9f-480f-90b2-47226115b63c ro single
initrd /boot/initrd.img-2.6.17-10-generic
title Ubuntu, memtest86+
root (hd0,9)
kernel /boot/memtest86+.bin
quiet
### END DEBIAN AUTOMAGIC KERNELS LIST
# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Windows Vista/Longhorn (loader)
root (hd0,0)
savedefault
makeactive
chainloader +1
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.