Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub error
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
iceamber
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2016
Posts: 87

PostPosted: Mon Apr 24, 2017 1:32 pm    Post subject: Grub error Reply with quote

Hi, all

I tried to install grub to a image, which generated by command
Code:
# dd if=/dev/zero of=disk.img count=$((63*16*200))


And created a partition by fdisk, the result of creating partition is
Code:
# fdisk -lu disk.img

Disk disk.img:98.4 MiB,103219200 bytes,201600 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:0xf00d5eb1

Device   Boot    Start  End  Blocks  Sizes Id  System
disk.img1  *     2048 201599 199552 97.4M 83 Linux


And then mounted it by
Code:
# losetup /dev/loop0 disk.img
# mount -o loop,offset=$((2048*512)) /dev/loop0 /mnt/img


then I installed grub to the device by
Code:
grub-install --no-floppy --boot-directory=/mnt/img /dev/loop0
Installing for i386-pc platform.
Installation finished. No error reported.


but it failed to boot and the grub reported
Code:
error: no such device : ...
error: unknown filesystem
Entering rescue mode...
grub rescue>
grub rescue>ls
(hd0)


it seems that couldn't find the partition, but I had formatted after created.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10261
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Apr 24, 2017 8:51 pm    Post subject: Reply with quote

Moved from Multimedia to Installing Gentoo.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Johanenta
n00b
n00b


Joined: 19 Apr 2017
Posts: 1
Location: Milan, Italy

PostPosted: Mon Apr 24, 2017 11:15 pm    Post subject: Reply with quote

Have you found resolution to your issue already? I am wondering what might be the reason of that error...
_________________
Do not take life too seriously. You will never get out of it alive.
Back to top
View user's profile Send private message
iceamber
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2016
Posts: 87

PostPosted: Tue Apr 25, 2017 1:34 am    Post subject: Reply with quote

Johanenta wrote:
Have you found resolution to your issue already? I am wondering what might be the reason of that error...


No, it has not been solved yet
Back to top
View user's profile Send private message
iceamber
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2016
Posts: 87

PostPosted: Tue Apr 25, 2017 10:28 am    Post subject: Reply with quote

It'll be solved if use kpartx instead, what's the difference between kpartx and losetup?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum