Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub2: fails to find a device... [SOLVED]
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
Spanik
Guru
Guru


Joined: 12 Dec 2003
Posts: 457
Location: Belgium

PostPosted: Sun Mar 27, 2016 1:43 pm    Post subject: Grub2: fails to find a device... [SOLVED] Reply with quote

Installing on a "new" MSI K9ND motherboard and HD. Following the handbook for amd64 and using the BIOS path. Used the partition scheme as in the handbook (just a larges swap) on /dev/sda.

Dev/sda1 and /dev/sda2 are ext2, /dev/sda4 (/) is xfs.

Came to Grub2 and there it went wrong like in previous installs.

Code:
livecd init.d # grub2-install /dev/sda
Installing for i386-pc platform
grub2-install: error: cannot find a device for /boot/grub (is /dev mounted?).


I can go to /boot/grub and there are few directories (fonts i386-pc locale themes) and a file grubenv.

What device is it complaining about? /dev/sda1 or /dev/sda2? I think that the directory i386-pc is put there by grub, right?

EDIT: when using --verbose I see that a lot of copying fails, things like:
Code:
 grub2-install : info: copying '/usr/share/locale/bg_BG/LC_MESSAGES/grub.mo' -> '/boot/grub/locale/bg_BG.mo' .
grub2-install : info: cannot open '/usr/share/locale/bg_BG/LC_MESSAGES/grub.mo' : no such file or directory.

But I cannot go to the start of the messages. Using a > to copy the output to a file also fails. Any idea how to capture the output of the --verbose to a txt file?
_________________
Expert in non-working solutions


Last edited by Spanik on Wed Mar 30, 2016 7:08 pm; edited 1 time in total
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6281

PostPosted: Sun Mar 27, 2016 2:32 pm    Post subject: Reply with quote

What you see in /boot/grub are probably the flies from your live cd.
I suggest that you run grub2-install from within the chroot.

Concerning redirection: You didn't say what failed. Perhaps you are redirecting to a file in a non-writable directory (e.g. if you are still on the live cd). Or the message do not go to stderr but to stdout. In the latter case you can either use 2>... to only redirect stderr or use >file 2>&1 to redirect both (when you use bash or zsh also the bashism >&file can be used).
Back to top
View user's profile Send private message
Spanik
Guru
Guru


Joined: 12 Dec 2003
Posts: 457
Location: Belgium

PostPosted: Sun Mar 27, 2016 2:55 pm    Post subject: Reply with quote

AFAIK I'm in de chroot environment. I could configure and compile the kernel etc. Or doesn't that tell me anything? But I'll reboot and try again from the start (without repartitioning the disks)

Well, I used:
Code:
 grub2-install --verbose /dev/sda > /var/log/gub2_install.txt

The file was created but empty.

Another probably silly question, but when chrooting you use
Code:
root #export PS1="(chroot) $PS1"


Now is that PS + "letter l" or +"number 1"???? They both look the same in the lettertype used.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Spanik
Guru
Guru


Joined: 12 Dec 2003
Posts: 457
Location: Belgium

PostPosted: Sun Mar 27, 2016 3:19 pm    Post subject: Reply with quote

I rebooted and found all partitions of /dev/sda empty... No idea what happened here. I downloaded stage3, a portage snapshot, emerged and configured a kernel. All that is gone. Going to start all over again this evening but first a bit relaxing because I really want to trow that pc out of the window. Lucky it is too heavy to do so.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6281

PostPosted: Sun Mar 27, 2016 3:32 pm    Post subject: Reply with quote

Spanik wrote:
Well, I used:
Code:
 grub2-install --verbose /dev/sda > /var/log/gub2_install.txt

The file was created but empty.

In this case the 2>/var/... should solve it. You can also do
Code:
grub2-install --verbose /dev/sda 2>&1 | less
This will direct stderr as well as stdout to the "less" program which shows output pagewise. If your shell is zsh, you can also use the shortcut
Code:
grub2-install --verbose /dev/sda |& less

Quote:
Another probably silly question, but when chrooting you use
Code:
root #export PS1="(chroot) $PS1"

Now is that PS + "letter l" or +"number 1"???? They both look the same in the lettertype used.

It is "number 1", but the whole thing will just make the prompt string of your shell look different. "man zshall" (or "man bash", depending on which shell you use) and typing "/PS1" (+enter, perhaps followed by typing "n") will show you the meaning of this special variable.

Quote:
I rebooted and found all partitions of /dev/sda empty... No idea what happened here.

It is hard to tell from the distance, but if you installed on the chroot and compiled a kernel, I can hardly imagine that you did this in the ramdisk. So I would guess the data is still there.
Perhaps on your machine /dev/sda is not always the same device when booting.
Back to top
View user's profile Send private message
Spanik
Guru
Guru


Joined: 12 Dec 2003
Posts: 457
Location: Belgium

PostPosted: Sun Mar 27, 2016 6:42 pm    Post subject: Reply with quote

mv wrote:
It is hard to tell from the distance, but if you installed on the chroot and compiled a kernel, I can hardly imagine that you did this in the ramdisk. So I would guess the data is still there.
Perhaps on your machine /dev/sda is not always the same device when booting.


This has happened between the install and boot of the kernel before. Don't know if it will be this way with the new motherboard. But in any case I booted from the livecd in both cases. My guess is something went wrong with the chroot. Compiling the kernel did take a long time, longer then I remembered of previous occasions.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6281

PostPosted: Mon Mar 28, 2016 7:26 am    Post subject: Reply with quote

Spanik wrote:
But in any case I booted from the livecd in both cases.

Dependent on your hardware and its timing, it can happen that booting from the same medium twice will give you two different devices for /dev/sda. That's why things like UUIDs have been introduced.
I do not have experience how likely this is, but before giving up and reinstalling, I would carefully check this possibility.

I can really hardly imagine what else might have happened: You might have "forgotten" to mount (e.g. by making a typo in the mount command which you did not realize) and thus actually installed on a ramdisk, only, or you might have switched off before anything from your cache has been written. Both does not seem very likely to me...
Back to top
View user's profile Send private message
Spanik
Guru
Guru


Joined: 12 Dec 2003
Posts: 457
Location: Belgium

PostPosted: Wed Mar 30, 2016 7:07 pm    Post subject: Reply with quote

Re-installed and this times it seems to have worked (but I now have another issue with Grub2).
_________________
Expert in non-working solutions
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