On 11/07/2015 11:07 PM, Andrei Borzenkov wrote:
08.11.2015 00:22, don fisher пишет:
On 11/07/2015 01:16 PM, Andrei Borzenkov wrote:
07.11.2015 22:43, don fisher пишет:
I have a USB system disk that currently will not boot. I currently have the USB disk loaded on my main system and would like to run grub2 to update the boot block on the USB device. I have looked at the USB grub.cfg file and it appears to match the one on my system except for the UUID. How does one execute grub2 with a target other than my system disk. Also, what is the best way to get the UUID for the partition. I scanned the output of hwinfo and the UUID on the USB drive appears to be correct, but there must be an easier way.
It is not quite clear, but assuming you want to install grub2 that looks for /grub2 on USB for its configuration, it is
mount /dev/sdXN /mnt grub2-install --boot-directory=/boot /dev/sdX
This was --boot-directory=/mnt of course; sorry!
where /dev/sdXN is device for partition on your USB disk.
It will copy grub2 files to /grub2 and bootstrap code in MBR. This code will look for /grub2 on partition N for its files, e.g. /grub2/grub.cfg.
It will *not* create or update grub.cfg - you will need to write it yourself. Thanks. I believe I have the grub2 files in /boot/grub2. The drive tries to boot, then gives me a ioerror 2 message and hangs. There is something
I do not understand it. Please take a photo when it hangs.
it is looking for that is not there or incorrect. I guess I will have to do a system install on the USB drive again and start from scratch. I was hoping there was a way to trick grub2 into executing on one drive while it was updating another.
I am not sure I understand it either. --boot-directory defines where grub is located - that is, where GRUB binaries, support files (themes etc) and grub.cfg are located. This directory need not be present on the same device as where grub bootstrap code is installed (last argument in grub-install). So
mount /dev/sdb1 /mnt grub-install --boot-directory=/mnt /dev/sda
is perfectly valid. It will install bootstrap code on /dev/sda and this code will look on /grub directory on /dev/sdb1 for grub.cfg and other files.
Please explain what you intend to do.
How do you get the UUID?
Why do you need it? grub-install does everything for you. What you want to do with UUID?
I have a USB hard drive that I boot and use to keep all of my systems identical. When I did my last update, the USB drive became unbootable so I wanted to determine what was broken. The UUID appears in the grub.cfg command line as the device identifier. I now fear that the kernel modules may be out of sync with the other files in /boot/grub2. I have not had time to pursue further. Thanks -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org