I would like to revisit this thread as I have an idea I would like to implement in a script file.
I wish to use Grub to locate some Grub files on all partitions in a system.
The advantage is that Grub will report the partition number that holds the specified file, whether that partition is presently mounted or not.
The idea is that rather than mounting each and every one of the partitions and then checking for the presence of the file, Grub could be used to do the search, not needing all the partitions to be mounted.
With Grub launched, passing the find command to it as below
grub> find /boot/grub/stage1
returns the location of all the partitions with the specified path/file present. In the case above (hd2,n) are not mounted.
I then wish to be able to use those locations for other purposes in the script ..... so it would be great if the answer to the find command could be assigned to a variable.
None of the rest of the Grub output is of interest.
I have been playing about with different ideas but have no concrete results.
Any help appreciated. Thanks.
I have used the idea posted by barjac to tee the output to a log file, successfully.
I would of course much prefer if only the required info was logged.
Also there appears to be something odd about the format of the file.
Below is what the file contains ......
[?1049h[1;50r(B[m[4l[?7h[?1h=[H[2J[2;5HGNU GRUB version 0.97 (640K lower / 3072K upper memory)
[4d [ Minimal BASH-like line editing is supported. For the first word, TAB[5;4Hlists possible command completions. Anywhere else TAB lists the possible[6;4Hcompletions of a device/filename. ]
[8dgrub> find /boot/grub/stage1