Minhbach's Weblog

August 12, 2012

grub-install reinstall

Filed under: IT — minhbach @ 1:32 pm

grub-install does not see block device while being in chroot user environment

Situation

Running grub-install block device while being chrooted after booting into the rescue mode causes the error:

block device: Not found or not a block device.

While in chroot mode issuing lsscsi reports:

error: Unable to open /proc/mounts for reading Unable to locate sysfsroot. If kernel>= 2.6.0 Try something like ‘mount -t sysfs none /sys’.

Resolution

Before changing environment to root the following commands needs to be issued:

mount –bind /proc /CurrentMountPointofRootPartition/proc
mount –bind /dev /CurrentMountPointofRootPartition/dev
mount –bind /sys /CurrentMountPointofRootPartition/sys

chroot /CurrentMountPointofRootPartition

grub-install /dev/sda

After that the command chroot /CurrentMountPointofRootPartition can be issued and the virtual proc, sys and dev filesystems will be available from within the chroot environment so that commands like grub-install can function.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: