Sreyan Chakravarty schreef op 07-08-2017 19:18:
Can someone explain to me why in case of a chroot environment why the
following mounts are necessary before running grub-install or update-grub ?

$ mount -t proc none /mnt/ubuntu/proc
$ mount -o bind /dev /mnt/ubuntu/dev
$ mount -o bind /sys /mnt/ubuntu/sys

I don't have a full explanation but these directories are used to access system information and devices, they are in effect a form of system call to the system.

Without these systems mounted in the default trees, these system calls cannot be made, so to speak.

It's a bit silly perhaps that there is no easier way to do it (a lot of manual headaches) (particularly if you want to unmount something after the fact etc. etc.) but this is your way to give your chroot environment and its programs access to these system 'functions'.

Btw, the following is supposed to be equivalent:

mount --bind /proc /target/proc
mount --bind /dev /target/dev
mount --bind /sys /target/sys

Which is what I always use. (/target is where your target system is mounted during installation, it is the same as the /mnt/ubuntu/... you use).

There really should be an option to "chroot" that does this, I think.

But anyway, regards.

Help-grub mailing list

Reply via email to