[prev in list] [next in list] [prev in thread] [next in thread] 

List:       grub-help
Subject:    Installing and configuring grub in chroot
From:       Maciej_Gałkiewicz <maciejgalkiewicz () ragnarson ! com>
Date:       2013-06-24 13:19:28
Message-ID: CAGqxmDMCm01hq+AOHhxWu_iVepvAg-wQRkpWBH-98ZeeExCvJg () mail ! gmail ! com
[Download RAW message or body]

Hi

I would like to configure grub on raw image file. I have managed to
successfully installed it with:
# mount -o loop instance.image-v0.77-1-cc-grub.img tmp/
# losetup -a
/dev/loop0: [fd0d]:1074766219
(/var/lib/nova/instances/grub/instance.image-v0.77-1-cc-grub.img)
# mount -o bind /proc tmp/proc/
# mount -o bind /dev tmp/dev
# mount -o bind /sys tmp/sys
# chroot tmp/
# grub-install --force /dev/loop0
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless
disk or to a partition.  This is a BAD idea..
/usr/sbin/grub-setup: warn: Embedding is not possible.  GRUB can only be
installed in this setup by using blocklists.  However, blocklists are
UNRELIABLE and their use is discouraged..
Installation finished. No error reported.

The problem is that installed kernel is not added to grub.cfg.

# update-grub2
Generating grub.cfg ...
done

# ls /boot/
config-3.8-2-amd64  grub  initrd.img-3.8-2-amd64  System.map-3.8-2-amd64
 vmlinuz-3.8-2-amd64

My grub version 1.99-27+deb7u1, debian wheezy (7.1)

# cat device.map
(hd0)   /dev/vda

# cat /etc/fstab
tmpfs /tmp tmpfs nodev,nosuid,size=35%,mode=1777 0 0
proc /proc proc defaults 0 0
/dev/vda / ext4 defaults 0 1

Device /dev/vda is not present inside chroot. It appears after booting the
image file inside KVM.

regards
Maciej Galkiewicz

[Attachment #3 (text/html)]

<div dir="ltr">Hi<div><br></div><div>I would like to configure grub on raw image \
file. I have managed to successfully installed it with:</div><div><div># mount -o \
loop instance.image-v0.77-1-cc-grub.img tmp/</div><div># losetup -a</div> \
<div>/dev/loop0: [fd0d]:1074766219 \
(/var/lib/nova/instances/grub/instance.image-v0.77-1-cc-grub.img)</div><div># mount \
-o bind /proc tmp/proc/</div><div># mount -o bind /dev tmp/dev</div><div># mount -o \
bind /sys tmp/sys</div> <div># chroot tmp/</div><div># grub-install --force \
/dev/loop0</div><div>/usr/sbin/grub-setup: warn: Attempting to install GRUB to a \
partitionless disk or to a partition.  This is a BAD \
idea..</div><div>/usr/sbin/grub-setup: warn: Embedding is not possible.  GRUB can \
only be installed in this setup by using blocklists.  However, blocklists are \
UNRELIABLE and their use is discouraged..</div> <div>Installation finished. No error \
reported.</div><div><br></div><div>The problem is that installed kernel is not added \
to grub.cfg.</div><div><br></div><div># update-grub2</div><div>Generating grub.cfg \
...</div><div>done</div> </div><div><br></div><div><div># ls \
/boot/</div><div>config-3.8-2-amd64  grub  initrd.img-3.8-2-amd64  \
System.map-3.8-2-amd64  vmlinuz-3.8-2-amd64</div></div><div><br></div><div>My grub \
version 1.99-27+deb7u1, debian wheezy (7.1)</div> <div><br></div><div># cat \
device.map</div><div>(hd0)   /dev/vda<br></div><div><br></div><div><div># cat \
/etc/fstab</div><div>tmpfs /tmp tmpfs nodev,nosuid,size=35%,mode=1777 0 \
0</div><div>proc /proc proc defaults 0 0</div> <div>/dev/vda / ext4 defaults 0 \
1</div></div><div><br></div><div>Device /dev/vda is not present inside chroot. It \
appears after booting the image file inside \
KVM.</div><div><br></div><div>regards<br>Maciej Galkiewicz<br></div> </div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic