PDA

View Full Version : [xubuntu] Trying to restore GRUB2 on LVM drive



glenncvance
March 12th, 2010, 04:27 PM
Hi all. I've been working on this problem for a day now with no resolution in site. Maybe someone with LVM knowledge can help. Short story -

- I have 2 hard drives. One with Xubuntu Karmic running LVM.
- I needed to reinstall XP for a project. I attempted to install it on the second drive (not Xubuntu) and the installation failed, so I removed the failed XP drive completely from the computer.
- Now when I boot I get "Error loading operating system".
- I created this forum thread (link) (http://ubuntuforums.org/showthread.php?p=8952172) and got some help, but I wasn't able to (as they suggested) reinstall GRUB from a Live CD. The LVM kept getting in the way.
- A user suggested that I try method 3 -Chroot from the reinstalling GRUB documentation (link) (https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD). I *think* I mounted the drive, but am unsure as I don't see any of my files from the Xubuntu drive.

This is my fdisk -l :


root@ubuntu:/home/ubuntu# fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x5b0c361d

Device Boot Start End Blocks Id System
/dev/sda1 * 1 38882 312319633+ 8e Linux LVM
/dev/sda2 38883 38913 249007+ 5 Extended
/dev/sda5 38883 38913 248976 83 Linux

root@ubuntu:/home/ubuntu# sudo -i
root@ubuntu:~# mount /dev/sda1 /mnt
mount: unknown filesystem type 'LVM2_member'

And I also ran the boot info script. Here's the output of that:


Boot Info Script 0.55 dated February 15th, 2010

============================= Boot Info Summary: ==============================

=> Windows is installed in the MBR of /dev/sda

sda1: __________________________________________________ _______________________

File system: LVM2_member
Boot sector type: -
Boot sector info:

sda2: __________________________________________________ _______________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ _______________________

File system: ext2
Boot sector type: Unknown
Boot sector info:
Operating System:
Boot files/dirs: /grub/grub.cfg /grub/core.img

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x5b0c361d

Partition Boot Start End Size Id System

/dev/sda1 * 63 624,639,329 624,639,267 8e Linux LVM
/dev/sda2 624,639,330 625,137,344 498,015 5 Extended
/dev/sda5 624,639,393 625,137,344 497,952 83 Linux


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/loop0 squashfs
/dev/ramzswap0 swap
/dev/sda1 O2WLp1-xs1W-WZRJ-fxgg-npdZ-8HJZ-7QrfK0 LVM2_member
/dev/sda5 ff0531d6-a841-4204-82a8-176bfb9869ee ext2

============================ "mount | grep ^/dev output: ===========================

Device Mount_Point Type Options

aufs / aufs (rw)
/dev/sr0 /cdrom iso9660 (rw)
/dev/loop0 /rofs squashfs (rw)


============================= sda5/grub/grub.cfg: =============================

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod lvm
insmod ext2
set root=(charles-nickel-root)
search --no-floppy --fs-uuid --set 2d349134-4ca0-4779-97a5-492b016b42ab
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
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/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-20-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set ff0531d6-a841-4204-82a8-176bfb9869ee
linux /vmlinuz-2.6.31-20-generic root=/dev/mapper/charles--nickel-root ro quiet splash
initrd /initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-20-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set ff0531d6-a841-4204-82a8-176bfb9869ee
linux /vmlinuz-2.6.31-20-generic root=/dev/mapper/charles--nickel-root ro single
initrd /initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-19-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set ff0531d6-a841-4204-82a8-176bfb9869ee
linux /vmlinuz-2.6.31-19-generic root=/dev/mapper/charles--nickel-root ro quiet splash
initrd /initrd.img-2.6.31-19-generic
}
menuentry "Ubuntu, Linux 2.6.31-19-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set ff0531d6-a841-4204-82a8-176bfb9869ee
linux /vmlinuz-2.6.31-19-generic root=/dev/mapper/charles--nickel-root ro single
initrd /initrd.img-2.6.31-19-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set ff0531d6-a841-4204-82a8-176bfb9869ee
linux /vmlinuz-2.6.31-14-generic root=/dev/mapper/charles--nickel-root ro quiet splash
initrd /initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set ff0531d6-a841-4204-82a8-176bfb9869ee
linux /vmlinuz-2.6.31-14-generic root=/dev/mapper/charles--nickel-root ro single
initrd /initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ ${timeout} != -1 ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### 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 ###

=================== sda5: Location of files loaded by Grub: ===================


319.8GB: grub/core.img
319.8GB: grub/grub.cfg
319.8GB: initrd.img-2.6.31-14-generic
319.8GB: initrd.img-2.6.31-19-generic
319.8GB: initrd.img-2.6.31-20-generic
319.8GB: vmlinuz-2.6.31-14-generic
319.8GB: vmlinuz-2.6.31-19-generic
319.8GB: vmlinuz-2.6.31-20-generic
=========================== Unknown MBRs/Boot Sectors/etc =======================

Unknown BootLoader on sda5

00000000 3e 90 ef 79 d2 ad 13 b2 3e 44 ed 78 7a 25 69 f5 |>..y....>D.xz%i.|
00000010 eb fc 24 57 4f b6 36 f7 36 aa 1a ee 89 cd 27 b0 |..$WO.6.6.....'.|
00000020 7c ec 3b 09 53 57 fd b6 98 19 51 99 a2 36 b3 3f ||.;.SW....Q..6.?|
00000030 4c c6 ee 57 ab 51 a2 df 58 c6 99 10 eb 30 f4 f3 |L..W.Q..X....0..|
00000040 23 07 b8 28 bf fb e3 a3 81 98 f2 f8 99 ee 04 33 |#..(...........3|
00000050 db 32 ce 97 ca 49 07 99 65 19 d5 5b 3e 72 4e a6 |.2...I..e..[>rN.|
00000060 73 93 53 e3 ad 38 64 e9 18 70 d3 f1 20 48 ff 63 |s.S..8d..p.. H.c|
00000070 3a 7e d9 87 f7 a0 c7 46 a8 96 cd 44 78 ff da 1a |:~.....F...Dx...|
00000080 2d 4f 6f 78 85 1f 74 64 2a 52 c2 01 83 d1 ef a2 |-Oox..td*R......|
00000090 c7 a2 cf bd cb 9d e7 db 3b d2 15 d3 e0 a4 7f af |........;.......|
000000a0 7e 01 48 e4 79 ce 6c f4 f1 0f 45 a0 6a e8 19 51 |~.H.y.l...E.j..Q|
000000b0 c8 b8 8b ac 83 93 b0 32 b4 ea 3a 1a b9 c4 49 cd |.......2..:...I.|
000000c0 c2 4f ee b5 cf 42 9b dc 59 e4 67 69 73 ee 32 a9 |.O...B..Y.gis.2.|
000000d0 a7 b9 b6 6f 49 6e d3 bd 1a a9 19 f3 c8 9d ef b3 |...oIn..........|
000000e0 69 a2 3e aa 98 17 e7 0b 48 6a 9e b5 9d bd 17 13 |i.>.....Hj......|
000000f0 14 fd 71 23 8f 14 fd 5b 86 a4 7a 5f 61 62 c2 c5 |..q#...[..z_ab..|
00000100 7f 11 b8 13 3b f3 ec 56 9a 3e 43 74 57 38 dc 18 |....;..V.>CtW8..|
00000110 ce 1b a9 cc 11 e6 7e f5 2d ca 62 29 f3 2f f4 57 |......~.-.b)./.W|
00000120 e4 e8 9c 0a 65 7a 3e 5c a4 5f ad 5a c1 cf d9 13 |....ez>\._.Z....|
00000130 bf 92 b2 e7 11 ea bc e4 56 a0 fa be 19 f2 85 1f |........V.......|
00000140 a4 a4 09 f9 ba a1 66 c8 6b 04 d6 01 9d 62 42 06 |......f.k....bB.|
00000150 89 c6 2e fa 1d 32 cf 4d 3d 1c 62 b7 0c d4 71 df |.....2.M=.b...q.|
00000160 89 77 58 3a 42 e5 d0 d2 7b 4c 9e 6f 7a 8a f7 a1 |.wX:B...{L.oz...|
00000170 e7 0f bc 95 2a b3 df f9 b6 95 cf 20 53 f8 32 d7 |....*...... S.2.|
00000180 2b 16 9e 7b 92 3e bc 33 7a ed 1c a7 95 c0 2d e4 |+..{.>.3z.....-.|
00000190 3d 1b 37 9f f3 23 5a f3 ad 39 84 96 71 c4 ac 15 |=.7..#Z..9..q...|
000001a0 cf b5 9d 42 22 a9 8c 2b c6 19 72 9f 34 a5 c2 f1 |...B"..+..r.4...|
000001b0 1f eb 38 6f d1 e7 0b 99 a4 ce 4a 99 01 83 e9 e9 |..8o......J.....|
000001c0 4c 4b d6 9c 37 e1 1b 6c 9b 47 ba 78 82 4f 92 a6 |LK..7..l.G.x.O..|
000001d0 e3 fd c9 65 69 08 d2 d4 63 28 ff 65 64 d8 29 be |...ei...c(.ed.).|
000001e0 9d c6 4d 58 19 d8 b3 fe 32 78 53 6f fb 5f be f5 |..MX....2xSo._..|
000001f0 37 73 4c dc 8e 84 17 a4 e0 a5 fd 78 63 e6 6f 1b |7sL........xc.o.|
00000200

And so I'm lost at this point on how to make it work. I can't just nuke the drive as there are files on there I need. If someone understands how to get LVM to play nice I'd appreciate any help. Thank you in advance.

glenncvance
March 13th, 2010, 04:59 PM
Bump. Anybody? Anybody at all?