grub-install on unmounted partitions
Hello there!
grub-install man page doesn't mention whether the device needs to be mounted or not. Any ideas?
Thank you!
Teresa e Junior
Quoted 2 lines · Teresa e Junior
grub-install man page doesn't mention whether the device needs to be mounted or not. Any ideas?
With EFI firmware, it does, but otherwise (including in the common case of PC BIOS systems) it doesn't matter.
Signature · 1 line
Colin Watson [[email protected]]
Quoted 7 lines · On Wed, 15 Sep 2010 06:01:06 +0100 Colin Watson <[email protected]> wrote:
Quoted 2 lines · Teresa e Junior
grub-install man page doesn't mention whether the device needs to be mounted or not. Any ideas?
With EFI firmware, it does, but otherwise (including in the common case of PC BIOS systems) it doesn't matter.
Hello, Colin!
I didn't even know there was a replacement for BIOS..! I'll include an error handler in my scripts then, if an error occurs, the user should mount the device.
Thanks!
Teresa e Junior
If you are talking about grub2 (not legacy)
Yes, usually disk must be mounted because grub-install copies grub files to --root-directory
for example grub-install --root-directory=/mnt /dev/sdb will copy grub files to /mnt/boot/grub and install grub to /dev/sdb (if /dev/sdb1 is mounted on /mnt)
You can also not use grub-install and use grub-mkimage to create core.img and then use grub-setup to write boot sector and then manually copy files to prefix dir.
If you are talking abount grub-legacy, then i never used grub-install and manualy copied files and:
grub> root (hd0,1)
grub> setup (hd0)
grub> quit
I assume you can do this (and grub-install) on mounted partition too.
Quoted 3 lines · Дмитрий Ильин
If you are talking about grub2 (not legacy)
Yes, usually disk must be mounted because grub-install copies grub files to --root-directory
Teresa asked specifically about "the device", presumably the device that you pass to grub-install. That's different from --root-directory, and (on BIOS systems) is only passed to grub-setup. It makes no difference to grub-setup whether the device is mounted anywhere or not.
Signature · 1 line
Colin Watson [[email protected]]