On 25/11/15 06:40, don fisher wrote:
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
What Andrei is saying is correct: execute the commands he shows above -- the only thing is that only *root* can execute them. All the parameters necessary for grub2 are already known and will be automatically taken care of when you execute. "grub-install.....". However, I think that there is another step missing -- but I am not sure because I have not been following this thread and so the missing step may have been already mentioned. The missing step is creating the /grub.cfg itself to meet the new situation: the command of, "grub2-mkconfig -o /mnt/sdb1/boot/grub2/grub.cfg". It may help if you first have a look at this .pdf to see what is being attempted and why: http://www.linuxidentity.com/us/down/articles/LSK_multi_distro_install_US.pd... The one thing to keep in mind is that the .pdf file has been written with Ubuntu in mind and references to "grub" are to legacy grub and not grub2 so that in some of the commands one has to substitute "grub2" for "grub". If this is making it sound like a lot of mind boggling crap, it is :-( . Why cannot people leave name of programs as they are instead of not only changing them but also using the different names (grub, grub2) within the same program! For example, Andrei shows the command to install grub2 (above) as "*grub*-install --boot-directory=/mnt /dev/sda" -- after which the commands become "*grub2*-mkconfig......" if the operating system is using grub2. But, then, that's what make Linux interesting, right? :-) . BC -- Using openSUSE 13.2, KDE 4.14.9 & kernel 4.3.0-17 on a system with- AMD FX 8-core 3.6/4.2GHz processor 16GB PC14900/1866MHz Quad Channel RAM Gigabyte AMD3+ m/board; Gigabyte nVidia GTX660 GPU -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org