LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Failed updating Ubu 11.04 with LVM/Raid, grub-env-export not found (https://www.linuxquestions.org/questions/linux-software-2/failed-updating-ubu-11-04-with-lvm-raid-grub-env-export-not-found-4175417478/)

linuxStudent11 07-18-2012 06:49 PM

Failed updating Ubu 11.04 with LVM/Raid, grub-env-export not found
 
I thought the attempt might be truly knuckle-headed.
talk about brain-dead...
HAALLLPPP!!

failed on last step. It told me it was unusable. It sure was correct!
grub rescue: set
prefix=(md0)/boot/grub
root=md0

It refuses to do:
insmode (md0)/boot/grub/normal.mod
some other grub export symbol not found

rescue will only accept:
insmode (md0)/boot/grub/cat.mod
and similar useless.

I can mount this "upgraded" raid set from a similar but older system.
I CAN'T mount it with the Natty try-it-out disk....guessing that's because
that standard install disk isn't the alternate with all the RAID/LVM support.

And <shudder> I have a backup of my /home/self ~ directory. Unfortunately there's
a bunch of encrypted stuff in /home/.encrypted/self that I couldn't back up.
It was too big (and I didn't know about it before yesterday).
Lots of personal gimp artwork in there.

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

=> Grub2 (v1.97-1.98) is installed in the MBR of /dev/sda and looks at sector
1 of the same hard drive for core.img. core.img is at this location and
looks in partition 1 for (,msdos1)/boot/grub.
=> No boot loader is installed in the MBR of /dev/sdb.
=> Windows is installed in the MBR of /dev/sdc.
=> No boot loader is installed in the MBR of /dev/sdd.
=> No boot loader is installed in the MBR of /dev/sde.
=> Grub2 (v1.97-1.98) is installed in the MBR of /dev/sdf and looks at sector
1 of the same hard drive for core.img. core.img is at this location and
looks for (md0)/boot/grub on this drive.


The statement for /dev/sdf looks just GREAT to me. And I can inspect (md0)/ all I want using ls (from inside grub rescue). And the Grub.cfg looks like it should work just fine.

I'm out of ideas.
Should the UUID in the /etc/mdadm/mdadm.conf file match something?

# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default, scan all partitions (/proc/partitions) for MD superblocks.
# alternatively, specify devices to scan, using wildcards if desired.
DEVICE partitions

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# definitions of existing MD arrays
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=cdbb7fe0:9056597b:3077fa42:6d74d3d6
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=e8d64ef2:bc9f185c:b2530707:a3b8bb05

# This file was auto-generated on Sat, 26 Mar 2011 10:36:43 -0400
# by mkconf $Id$

sdd1: __________________________________________________________________________

File system: linux_raid_member
Boot sector type: -
Boot sector info:
sdf1: __________________________________________________________________________

File system: linux_raid_member
Boot sector type: -
Boot sector info:
"blkid" output: ________________________________________________________________

Device UUID TYPE LABEL

/dev/loop0 squashfs
/dev/sda1 1274aa8a-3cda-45c1-aba7-a7198a0c776d ext3
/dev/sda2 8aoDIr-Hjhm-NV8M-W0F8-GH5O-Eaed-y99z42 LVM2_member
/dev/sda3 e8d64ef2-bc9f-185c-b253-0707a3b8bb05 linux_raid_member
/dev/sdb1 561891fb-824d-4e45-8847-60ec2008ecc0 Hitachi
/dev/sdb2 e8d64ef2-bc9f-185c-b253-0707a3b8bb05 linux_raid_member
/dev/sdc1 6e00e5f2-54ea-4d2b-a5f0-4e1085d48561 ext3 snip
/dev/sdd1 cdbb7fe0-9056-597b-3077-fa426d74d3d6 linux_raid_member
/dev/sdd2 382C4B182C4AD094 ntfs
/dev/sde1 6CA7812067232CE1 ntfs PTMvirtuals
/dev/sde2 eb1c82e6-835f-40dd-b6ba-f10c8357d14f ext4 snip1
/dev/sdf1 cdbb7fe0-9056-597b-3077-fa426d74d3d6 linux_raid_member
/dev/sdf2 4de430b4-bf4c-46b5-ae3c-b6b319a83b7b ext4 snip2

================================ Mount points: =================================

Device Mount_Point Type Options

/dev/loop0 /rofs squashfs (ro,noatime)
/dev/sdc1 /media/Hitachi ext3 (rw,nosuid,nodev,uhelper=udisks)
/dev/sdd2 /media/382C4B182C4AD094 fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sde2 /media/snip ext4 (rw,nosuid,nodev,uhelper=udisks)
/dev/sdf2 /media/snip ext4 (rw,nosuid,nodev,uhelper=udisks)
/dev/sr0 /cdrom iso9660 (ro,noatime)

The bootinfo script now shows the grub.cfg from the sda1 partition...which I'm not using. So I add /dev/sdf1 grub.cfg

The grub.cfg UUID matches (md0), the RAID set using /dev/sdf1 and /dev/sdd1

I had to patch this file together from several runs. I THINK the grub.cfg is patch consistent. There seems to be a bug in cut/paste, probably due to this older system I'm using.









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

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
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 recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}

insmod raid
insmod mdraid09
insmod part_msdos
insmod part_msdos
insmod ext2
set root='(md0)'
search --no-floppy --fs-uuid --set=root c0ccac6d-fa94-47a2-a1b2-460cd2c36f61
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod raid
insmod mdraid09
insmod part_msdos
insmod part_msdos
insmod ext2
set root='(md0)'
search --no-floppy --fs-uuid --set=root c0ccac6d-fa94-47a2-a1b2-460cd2c36f61
set locale_dir=($root)/boot/grub/locale
set lang=en_US
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod raid
insmod mdraid09
insmod part_msdos
insmod part_msdos
insmod ext2
set root='(md0)'
search --no-floppy --fs-uuid --set=root c0ccac6d-fa94-47a2-a1b2-460cd2c36f61
insmod jpeg
if background_image /boot/grub/silent-640x480.jpg; then
true
else
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
elseb2-460cd2c36f61 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.38-15-generic
}
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, with Linux 2.6.38-15-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod raid
insmod mdraid09
insmod part_msdos
insmod part_msdos
insmod ext2
set root='(md0)'
search --no-floppy --fs-uuid --set=root c0ccac6d-fa94-47a2-a1b2-460cd2c36f61
linux /boot/vmlinuz-2.6.38-15-generic root=UUID=c0ccac6d-fa94-47a2-a1b2-460cd2c36f61 ro quiet splash vt.handoff=7
initrd /boot/initrd.img-2.6.38-15-generic
}
menuentry 'Ubuntu, with Linux 2.6.38-15-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod raid
insmod mdraid09
insmod part_msdos
insmod part_msdos
insmod ext2
set root='(md0)'
search --no-floppy --fs-uuid --set=root c0ccac6d-fa94-47a2-a1b2-460cd2c36f61
echo 'Loading Linux 2.6.38-15-generic ...'
linux /boot/vmlinuz-2.6.38-15-generic root=UUID=c0ccac6d-fa94-47a2-a1b2-460cd2c36f61 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.38-15-generic
}


<BIG SNIP>

################################################################################
# #
# Current developer: Gert Hulselmans #
# #
# Past developer: Ulrich Meierfrankenfeld (meierfra) (ubuntuforums.org) #
# Past contributor: caljohnsmith (ubuntuforums.org) #
# #
# Hosted at: http://sourceforge.net/projects/bootinfoscript/ #
# #
# The birth of Boot Info Script: #
# http://ubuntuforums.org/showthread.php?t=837791 #
# #
# Tab width: 8 spaces #
# #
################################################################################

reverse link to original help request is:
http://www.linuxquestions.org/questi...nd-4175417478/

This Grub2 borkage has wolfed several days now.
Any ideas, no matter how incomplete, would help.

I tried using http://members.iinet.net/~herman546/p20.html and its nice info...mostly:
grub-setup -v -d /wherever/boot/grub /dev/sdf
sdf is where my original boot MBR was for this raid set.
Out of several combinations that I tried, the above actually finished without an error. The verbose switch shows a complaint about no device map found. But it continues on unperturbed. Could that be part of the problem? It does claim to hook the sdf MBR to the /dev/md0 raidset.

I'm considering using grub-mkimage to build a new core image file.
Another possiblity is to force the boot block into /dev/md0 ... but I'm reluctant to try that since it might make things worse. It doesn't make sense anyway.

If I could get additional info, like, is the grub.cfg being found and failing inside it somewhere? Or is there a problem starting the Raid/LVM stuff and it doesn't even get to the grub.cfg? Could I boot someshere else and script something to start up the RAID/LVM? ...then chroot?

Is there a trace function on the boot process that I could turn on?

ANYTHING you could tell me would be great. :)

linuxStudent11 07-21-2012 04:03 PM

Ok, here's the solution I came up with.

After trying the links below, I gave up and started trying shotgun approaches. The one that (surprisingly) worked was to simply ignore the RAID/LVM aspect of the problem. I used the Ubu11.04 disk rescue utility to "reinstall" Grub2. I told it to use one of the raid component partitions as the root partition (sdf1)...NOT any raid set partition(md0). And I told it to install the GRUB2 MBR on the boot disk containing that raid component (sdf). Nowhere did I tell the rescue system about the other component. BTW: the "Assemble RAID set" choice on the rescue disk built a boot that tried to go to md127 or md126 (?) and failed during boot with "File not found".
Ignorance is bliss...the stupid approach above happily found everything and booted.

Its POSSIBLE that one of my previous (failed) attempts actually helped. I had chrooted into (md0) and told it to rebuild /boot/grub/grub.cfg and reinstall (failed) grub2 with an apt-get. This was the complex chroot involving the mounting of /dev /proc /dev/pts and all the rest. See ~herman546 link below.

Also btw, I had to use the Ubu11.04 disk rescue twice in the above stupid fashion since the first md0 successful boot eventually crashed later ... after I ran a very old game during my initial testing, (possibly using out-of-date graphics calls). Screen froze black with heavy disk activity and it got garbage in the grub files somehow. So the second rescue-boot went into a RAID resync for several hours. I've been happily using the md0 system since.

BTW: None of the best links helped (other than to educate me)...not a bad thing...or even a complaint. I read:
http://ubuntuforums.org/showthread.php?t=1581099 and
http://members.iinet.net/~herman546/... Commands.html was VERY helpful
somewhat useful was https://wiki.archlinux.org/index.php..._command_shell (not Ubuntu)
also some of the pages pointed to by all the above.

also http://bootinfoscript.sourceforge.net was useful though it told me things looked fine...see above...unless I read the output (initial post) wrongly.

If you read this far...my condolences, sympathies, best wishes, and recommendation you have some alcohol somewhere in the house...for your inevitable but intermediate failures.
Good Luck!


All times are GMT -5. The time now is 08:09 PM.