LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-25-2012, 11:41 PM   #1
superolmo
LQ Newbie
 
Registered: Mar 2011
Location: Houston, TX
Posts: 2

Rep: Reputation: 0
grub-install cannot find device VolGroup on a ext4 partition


I have a VMwave image with CentOS 5.7 installed. The first partition (/dev/sda1) was /boot and the second was a logical volume (/dev/sda2). I have decided to remove the logical volume and combine the 2 partitions.
I setup a new VMware hard drive and formatted as a single partition (/dev/sdb1). Next I booted Ubuntu live CD and mounted the new partition and the partitions with the logical volume and then the boot partition inside as follows:
Code:
mount /dev/sda2 /media/hd1
mount /dev/sda1 /media/hd1/boot
mount /dev/sdb1 /media/hd2
I copied all files from hd1 to hd2 using:
Code:
cp -avf /media/hd1/* /media/hd2
Next I connected the dev and proc directories to the new partition:
Code:
mount --bind /dev /media/hd2/dev
mount --bind /proc /media/hd2/proc
I run
Code:
grub-install --recheck /dev/sdb
but it gives me an error.

At this point I thought it should be almost done, I just need to reinstall grub, but grub-install tells me that
Code:
could not find device for /dev/mapper/VolGroup00-LogVol00
could not find device for /dev/mapper/VolGroup00-LogVol00
could not find device for /dev/mapper/VolGroup00-LogVol00
/dev/mapper/VolGroup00-LogVol00: Not found or not a block device.
What am I doing wrong?

I changed Ubuntu Live CD to CentOS 5.7 dvd in rescue mode, but it is doing the same thing.

The reason for removing the logical volume in the VMware is to reduce the virtual disk space and remove the more complicated to manage (for me) logical volume.
 
Old 01-26-2012, 09:31 PM   #2
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Jessie
Posts: 592

Rep: Reputation: 119Reputation: 119
Try running grub-install from a chroot environment.
Code:
chroot /media/hd2 grub-install --recheck /dev/sda
If you still get the error, edit /media/hd2/boot/grub/device.map:
Code:
hd0  /dev/sda
and run grub-install from the chroot environment:
Code:
chroot /media/hd2 grub-install /dev/sda
Hope it helps.
 
Old 01-27-2012, 08:11 PM   #3
superolmo
LQ Newbie
 
Registered: Mar 2011
Location: Houston, TX
Posts: 2

Original Poster
Rep: Reputation: 0
Yes, I forgot to mention that I did use
Code:
chroot /media/hd2
I checked the device.map and I made sure that it contains the entry
Code:
hd0  /dev/sda
but still I get the same error.

I think I got little further by binding also the sys directory
Code:
mount --bind /sys /media/hd2/sys
I rebuild the mtab file using
Code:
grep -v rootfs /proc/mounts > /etc/mtab
Now, grub-install gives me:
Code:
df: cannot read table of mounted file systems
Thanks though, I am going to restart from scratch since I have the original VMware drive.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
move VolGroup-lv-home to VolGroup-lv-root dmb2002man Linux - Newbie 11 08-19-2011 08:22 AM
[SOLVED] cannot install grub (grub-probe says 'unknown fs' with ext4 and md raid) cusco Linux - Software 3 03-15-2011 01:58 AM
[SOLVED] Grub can't find grub.cfg when booting - error: no such device Breagha Linux - Software 8 03-14-2010 12:40 PM
RHEL 5 LSI megasr SAS RAID does not find VolGroup after install thetawave84 Linux - Newbie 1 01-17-2008 03:12 AM
UL 1.0 GRUB: could not find device for /boot: not found or not a block device cma Linux - General 4 12-12-2005 03:35 AM


All times are GMT -5. The time now is 07:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration