2

From my Ubuntu, I want to create a bootable Debian USB. I tried to install Debian with debootstrap. A brief list of commands is

mount /dev/sdb1 /mnt
debootstrap sid /mnt http://ftp.debian.org/debian
chroot /mnt
apt-get install linux-headers-3.2.0-4-686-pae linux-image-3.2.0-4-686-pae
apt-get install grub2
grub-install --recheck /dev/sdb

I have edited the /mnt/etc/fstab to include the USB drive with its UUID. But my problem is installing grub from within chroot, I get the following error

/usr/sbin/grub-probe: error: cannot find a device for /boot/grub (is /dev mounted?).

I do not want to touch the grub of my ubuntu machine, I want to install the grub on my USB to be bootable on other machines.

What step/command I have missed?

2

You can bind mount pseudo filesystems such as /dev/ inside the chroot:

mount -o bind /dev /mnt/dev
mount -o bind /sys /mnt/sys
mount -t proc /proc /mnt/proc

Another option is to run grub-install from outside of the chroot, using --root-directory:

grub-install --root-directory=/mnt /dev/sdb
  • concise, informative, and complete! – Googlebot Jan 16 '13 at 18:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.