Originally Posted by
D3ath
For anyone that reads this:
Use this to find Grub!
Code:
find /boot/grub/stage1
Then use the root command:
Then setup MBR HHD1:
Quit:
Then reboot. Three Lines works every time. Even with other distros. Just so everyone knows.
These three lines did not work for me. As Nicholas pointed out earlier in this thread, if you have a separate /boot partition, you need to use
since that is where the file is in that partition.
Here's what worked for me on a 8.10 AMD_64 indstall following migration to a new hard drive:
Boot live CD and mount the normal root partition at /mnt and the boot partition at /mnt/boot. This puts them in the same relation to each other as they will be in the running system:
Code:
root@ubuntu:~# df|grep sda
/dev/sda6 30241928 4594572 24111144 17% /mnt
/dev/sda5 1004024 94044 858976 10% /mnt/boot
root@ubuntu:~#
Execute Grub - (Commands I typed are bolded)
Code:
root@ubuntu:~# grub
Probing devices to guess BIOS drives. This may take a long time.
[ 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. ]
grub> find /grub/menu.lst
find /grub/menu.lst
(hd0,4)
(hd1,4)
grub> root (hd0,4)
root (hd0,4)
grub> setup (hd0)
setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd0) (hd0)1+16 p (hd0,4)/grub/stage2 /grub/menu.lst"... succeeded
Done.
grub>
(Note that I had my old drive attached via an external USB enclosure and that's where the "(hd1,4)" entry came from.
This left me able to boot. On the first boot the system locked up with a white screen. <ctrl><alt><delete> eventually took me back to the boot menu and when I tried booting Vista (which had always worked) It got to the progress bar stage and remained there for a long time (with the progress bar still active.) After power cycling the machine, It booted Vista normally, so the machine must have gotten into a bad state that a reboot would not clear.
Following this, when I tried to boot Linux, it started and then dumped me into a command shell when 'fsck' was unable to check two drives. That was because the UUIDs for the drives in /etc/fstab did not match the new drive. I obtained the correct UUIDs using 'blkid', edited them into /etc/fstab and am not happily off and running.
For reference, here is some other information that may help others who are struggling with this:
Disk partitions:
Code:
ubuntu@ubuntu:~$ sudo fdisk -lu
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x6f80c932
Device Boot Start End Blocks Id System
/dev/sda1 2048 3074047 1536000 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 3084480 103677839 50296680 7 HPFS/NTFS
/dev/sda3 103677840 124150319 10236240 7 HPFS/NTFS
/dev/sda4 124150320 976768064 426308872+ 5 Extended
/dev/sda5 124150383 126190574 1020096 83 Linux
/dev/sda6 * 126190638 187639199 30724281 83 Linux
/dev/sda7 187639263 195639569 4000153+ 82 Linux swap / Solaris
/dev/sda8 195639633 976768064 390564216 83 Linux
Disk /dev/sdb: 4063 MB, 4063232000 bytes
5 heads, 32 sectors/track, 49600 cylinders, total 7936000 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 * 8064 7935999 3963968 c W95 FAT32 (LBA)
ubuntu@ubuntu:~$
Mount points in running system:
Code:
hbarta@cypress:~$ df|grep sda
/dev/sda6 30241928 4594780 24110936 17% /
/dev/sda5 1004024 94044 858976 10% /boot
/dev/sda8 384435636 45509056 319398372 13% /home
hbarta@cypress:~$
UUIDs:
Code:
ubuntu@ubuntu:~$ sudo blkid
/dev/sda1: UUID="5C0CDB8F0CDB6296" LABEL="SERVICEV003" TYPE="ntfs"
/dev/sda2: UUID="C4F8DDE6F8DDD730" LABEL="SW_Preload" TYPE="ntfs"
/dev/sda3: UUID="DE62E0C562E0A38D" LABEL="Lenovo" TYPE="ntfs"
/dev/sda5: UUID="9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2" TYPE="ext3"
/dev/sda6: UUID="7f69072f-cea2-4ec3-bde9-81dd16744034" TYPE="ext3"
/dev/sda7: TYPE="swap" UUID="a8b4289b-34b4-4c92-a7b9-c0bd7f253cff"
/dev/sda8: UUID="e186fa4e-a98c-49b9-b491-2205628c1f75" SEC_TYPE="ext2" TYPE="ext3"
/dev/loop0: TYPE="squashfs"
/dev/sdb1: UUID="5C0CDB8F0CDB6296" LABEL="SERVICEV003" TYPE="ntfs"
/dev/sdb2: UUID="C4F8DDE6F8DDD730" LABEL="SW_Preload" TYPE="ntfs"
/dev/sdb3: UUID="DE62E0C562E0A38D" LABEL="Lenovo" TYPE="ntfs"
/dev/sdb5: UUID="bd5c658d-b65c-45ee-8f7f-a36f02cc3a52" TYPE="ext3"
/dev/sdb6: UUID="417bafd4-d886-4968-856e-bca45bb5445d" TYPE="ext3"
/dev/sdb7: UUID="9ae3498f-964f-2097-4349-68cb88a66c33" TYPE="swap"
/dev/sdb8: UUID="996c0b0f-d773-4b50-9497-c2f2ddd13fe3" TYPE="ext3"
/dev/sdc1: LABEL="KINGSTON" UUID="5C3F-FC72" TYPE="vfat"
Menu.lst:
Code:
# 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 use 'savedefault' 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=7f69072f-cea2-4ec3-bde9-81dd16744034 ro
## default grub root device
## e.g. groot=(hd0,0)
# groot=9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
## 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
## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false
## ## End Default Options ##
title Ubuntu 8.10, kernel 2.6.27-14-generic
uuid 9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
kernel /vmlinuz-2.6.27-14-generic root=UUID=7f69072f-cea2-4ec3-bde9-81dd16744034 ro quiet splash
initrd /initrd.img-2.6.27-14-generic
quiet
title Ubuntu 8.10, kernel 2.6.27-14-generic (recovery mode)
uuid 9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
kernel /vmlinuz-2.6.27-14-generic root=UUID=7f69072f-cea2-4ec3-bde9-81dd16744034 ro single
initrd /initrd.img-2.6.27-14-generic
title Ubuntu 8.10, kernel 2.6.27-13-generic
uuid 9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
kernel /vmlinuz-2.6.27-13-generic root=UUID=7f69072f-cea2-4ec3-bde9-81dd16744034 ro quiet splash
initrd /initrd.img-2.6.27-13-generic
quiet
title Ubuntu 8.10, kernel 2.6.27-13-generic (recovery mode)
uuid 9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
kernel /vmlinuz-2.6.27-13-generic root=UUID=7f69072f-cea2-4ec3-bde9-81dd16744034 ro single
initrd /initrd.img-2.6.27-13-generic
title Ubuntu 8.10, kernel 2.6.27-12-generic
uuid 9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
kernel /vmlinuz-2.6.27-12-generic root=UUID=7f69072f-cea2-4ec3-bde9-81dd16744034 ro quiet splash
initrd /initrd.img-2.6.27-12-generic
quiet
title Ubuntu 8.10, kernel 2.6.27-12-generic (recovery mode)
uuid 9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
kernel /vmlinuz-2.6.27-12-generic root=UUID=7f69072f-cea2-4ec3-bde9-81dd16744034 ro single
initrd /initrd.img-2.6.27-12-generic
title Ubuntu 8.10, kernel 2.6.27-11-generic
uuid 9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
kernel /vmlinuz-2.6.27-11-generic root=UUID=7f69072f-cea2-4ec3-bde9-81dd16744034 ro quiet splash
initrd /initrd.img-2.6.27-11-generic
quiet
title Ubuntu 8.10, kernel 2.6.27-11-generic (recovery mode)
uuid 9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
kernel /vmlinuz-2.6.27-11-generic root=UUID=7f69072f-cea2-4ec3-bde9-81dd16744034 ro single
initrd /initrd.img-2.6.27-11-generic
title Ubuntu 8.10, kernel 2.6.27-10-generic
uuid 9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
kernel /vmlinuz-2.6.27-10-generic root=UUID=7f69072f-cea2-4ec3-bde9-81dd16744034 ro quiet splash
initrd /initrd.img-2.6.27-10-generic
quiet
title Ubuntu 8.10, kernel 2.6.27-10-generic (recovery mode)
uuid 9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
kernel /vmlinuz-2.6.27-10-generic root=UUID=7f69072f-cea2-4ec3-bde9-81dd16744034 ro single
initrd /initrd.img-2.6.27-10-generic
title Ubuntu 8.10, kernel 2.6.27-7-generic
uuid 9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
kernel /vmlinuz-2.6.27-7-generic root=UUID=7f69072f-cea2-4ec3-bde9-81dd16744034 ro quiet splash
initrd /initrd.img-2.6.27-7-generic
quiet
title Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
uuid 9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
kernel /vmlinuz-2.6.27-7-generic root=UUID=7f69072f-cea2-4ec3-bde9-81dd16744034 ro single
initrd /initrd.img-2.6.27-7-generic
title Ubuntu 8.10, memtest86+
uuid 9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
kernel /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
Thanks again to all who offered suggestions.
Bookmarks