Path `/tmp/antos/boot/grub' is not readable by GRUB on boot.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
boxcounter
Posts: 13
Joined: Fri Oct 04, 2013 4:02 am

Path `/tmp/antos/boot/grub' is not readable by GRUB on boot.

Post by boxcounter »

Hi, guys. I am developing a 32 bit os and plan to port it to x86-64. Grub2 works very good as bootloader for my 32-bit os. Last week I tried to install grub2 to a harddisk image file created with dd and fdisk on x64 ubuntu 12.04.2, but failed like this:

Code: Select all

root@x64:~# grub-install --no-floppy --modules="biosdisk part_msdos ext2 configfile normal multiboot" --root-directory=/tmp/antos /dev/loop0
Path `/tmp/antos/boot/grub' is not readable by GRUB on boot. Installation is impossible. Aborting.
I added the "--debug" option to grub-install, and got this:

Code: Select all

+ /usr/local/sbin/grub-probe -t fs /tmp/antos/boot/grub
+ return 1
+ gettext_printf Path `%s' is not readable by GRUB on boot. Installation is impossible. Aborting.\n /tmp/antos/boot/grub
"/tmp/antos" was the mount point of the first partition:

Code: Select all

kpartx -av ./antos.img
mke2fs -b1024 /dev/mapper/loop0p1
mount -text2 /dev/mapper/loop0p1 /tmp/antos
Then I tried grub-probe like above:

Code: Select all

root@ubuntu:~# /usr/local/sbin/grub-probe -t fs /tmp/antos/boot/grub
/usr/local/sbin/grub-probe: error: disk `lvm/loop0p1' not found.
I have read more than 10 pages of google search result, and tried a lot, spent about 20 hours. But still failed.
I need some help or hint, thanks in advance!

Here is the information of my harddisk image:

Code: Select all

root@ubuntu:~# fdisk -l
...

Disk /dev/mapper/loop0p1: 19 MB, 19595264 bytes
255 heads, 63 sectors/track, 2 cylinders, total 38272 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/loop0p1 doesn't contain a valid partition table

Code: Select all

root@ubuntu:~# parted -l
...

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/loop0p1: 19.6MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  19.6MB  19.6MB  ext2
The information of my x64 ubuntu:

Code: Select all

root@ubuntu:~# ll /dev/mapper/
total 0
drwxr-xr-x  2 root root      80 Nov 11 08:50 ./
drwxr-xr-x 15 root root    4120 Nov 11 08:50 ../
crw-------  1 root root 10, 236 Nov  1 08:58 control
lrwxrwxrwx  1 root root       7 Nov 12 09:23 loop0p1 -> ../dm-0

root@ubuntu:~# uname -a
Linux ubuntu 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
The grub2 was built from source code from ftp.gnu.org:

Code: Select all

root@ubuntu:~# grub-install --version
grub-install (GRUB) 2.00
I have also tried the trunk source code, it reports the same error message.

Thanks!
brighteningeyes
Member
Member
Posts: 45
Joined: Sat Sep 07, 2013 8:26 am
Contact:

Re: Path `/tmp/antos/boot/grub' is not readable by GRUB on b

Post by brighteningeyes »

copy the grub2 (from /usr/lib/grub) to your temp directory and install it!
testing the operating system is very hard when your eyes can't see well
like me and many others
boxcounter
Posts: 13
Joined: Fri Oct 04, 2013 4:02 am

Re: Path `/tmp/antos/boot/grub' is not readable by GRUB on b

Post by boxcounter »

brighteningeyes wrote:copy the grub2 (from /usr/lib/grub) to your temp directory and install it!
Hi, brighteningeyes, thanks for your reply.
I tried as you suggested( copy the whole /usr/lib/grub/ directory to /tmp/antos/), it didn't work either.

Code: Select all

.root@ubuntu:/tmp/antos# ./grub/i386-pc/grub-install  --no-floppy --modules="biosdisk part_msdos ext2 configfile normal multiboot" --root-directory=/tmp/antos /dev/loop0 --recheck
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/mapper/loop0p1.  Check your device.map.
Auto-detection of a filesystem of /dev/mapper/loop0p1 failed.
Try with --recheck.
If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/tmp/antos/boot/grub/device.map" --target=fs -v /tmp/antos/boot/grub" to <[email protected]>
And the grub-install in /usr/lib/grub is v1.99:

Code: Select all

root@ubuntu:/tmp/antos# ./grub/i386-pc/grub-install --version
grub-install (GRUB) 1.99-21ubuntu3.11
brighteningeyes
Member
Member
Posts: 45
Joined: Sat Sep 07, 2013 8:26 am
Contact:

Re: Path `/tmp/antos/boot/grub' is not readable by GRUB on b

Post by brighteningeyes »

the problem is you trying to write --no-floppy with the grub-install and then you give a floppy drive
because of this, device.map give's error in the /dev/loop0
don't specify --no-floppy or don't give a flloppy drive (instead, give a directory)
testing the operating system is very hard when your eyes can't see well
like me and many others
boxcounter
Posts: 13
Joined: Fri Oct 04, 2013 4:02 am

Re: Path `/tmp/antos/boot/grub' is not readable by GRUB on b

Post by boxcounter »

brighteningeyes wrote:the problem is you trying to write --no-floppy with the grub-install and then you give a floppy drive
because of this, device.map give's error in the /dev/loop0
don't specify --no-floppy or don't give a flloppy drive (instead, give a directory)
Thansk, brighteningeyes.
I removed --no-floppy, but still got the same error msg.

"or don't give a flloppy drive (instead, give a directory)"
Could you please give a example? I used kpartx to load my harddisk image file not a floppy disk.

Code: Select all

root@ubuntu:/tmp/antos# losetup -a
/dev/loop0: [0801]:5770459 (./antos.img)

root@ubuntu:/tmp/antos#  file /root/antos.img
/root/antos.img: x86 boot sector; partition 1: ID=0x83, active, starthead 0, startsector 2048, 38272 sectors, code offset 0x0
Thanks very much!
User avatar
mnovotny
Member
Member
Posts: 27
Joined: Mon Aug 10, 2009 2:54 am
Location: Slovakia

Re: Path `/tmp/antos/boot/grub' is not readable by GRUB on b

Post by mnovotny »

Try this guide: http://roscopeco.com/2013/08/12/creatin ... ith-grub2/
It worked for me at least.
Keep the world with all its sin
It's not fit for livin' in
brighteningeyes
Member
Member
Posts: 45
Joined: Sat Sep 07, 2013 8:26 am
Contact:

Re: Path `/tmp/antos/boot/grub' is not readable by GRUB on b

Post by brighteningeyes »

i sed on a directory:
for example,
/home/antos
testing the operating system is very hard when your eyes can't see well
like me and many others
boxcounter
Posts: 13
Joined: Fri Oct 04, 2013 4:02 am

Re: Path `/tmp/antos/boot/grub' is not readable by GRUB on b

Post by boxcounter »

mnovotny wrote:Try this guide: http://roscopeco.com/2013/08/12/creatin ... ith-grub2/
It worked for me at least.
Thanks, mnovotny. It worked for me too, but only on 32-bit not on x64.
boxcounter
Posts: 13
Joined: Fri Oct 04, 2013 4:02 am

Re: Path `/tmp/antos/boot/grub' is not readable by GRUB on b

Post by boxcounter »

brighteningeyes wrote:i sed on a directory:
for example,
/home/antos
I'm sorry, brighteningeyes. I'm confused. Some command would be very nice, thanks!
boxcounter
Posts: 13
Joined: Fri Oct 04, 2013 4:02 am

Re: Path `/tmp/antos/boot/grub' is not readable by GRUB on b

Post by boxcounter »

Hi guys.
Finally I tried on x64 fedora 19, it worked.
Thank you all for the help!
boxcounter
Posts: 13
Joined: Fri Oct 04, 2013 4:02 am

Re: Path `/tmp/antos/boot/grub' is not readable by GRUB on b

Post by boxcounter »

Additional, it worked on both x64 ubuntu 13.10 and x64 fedora 19 with built in grub (version 2.0.0).

Donot need to change any option of the command I uesed:

Code: Select all

kpartx -av ./antos.img
mkdir /tmp/antos
mount -text2 /dev/mapper/loop0p1 /tmp/antos
grub-install --no-floppy --modules="biosdisk part_msdos ext2 configfile normal multiboot" --root-directory=/tmp/antos /dev/loop0
Hope this will help guys facing the same trouble.
Post Reply