You are not logged in.

#1 2012-07-21 15:41:24

@op
Member
Registered: 2011-04-05
Posts: 49

[SOLVED] Forgot to create grub2 config

Today I updated my machines to grub2 and everything worked very well. But something has to go wrong everytime and I forgot to run the config creation with

grub-mkconfig -o /boot/grub/grub.cfg

on the last machine and rebooted.
Now grub starts but of course can't find my hard drive.
How can I fix this? Can I run a live system and generate the config file?

Last edited by @op (2012-07-22 12:52:49)

Offline

#2 2012-07-21 15:46:08

Shark
Member
From: /dev/zero
Registered: 2011-02-28
Posts: 686

Re: [SOLVED] Forgot to create grub2 config

Take a live CD/USB. Chroot and issue command for generating grub.cfg. This is how i made it when did the same mistake.


If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau

Registered Linux User: #559057

Offline

#3 2012-07-21 16:10:58

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] Forgot to create grub2 config

From a "live" Linux distribution:

mount /dev/sdaX /mnt                 <-- your "/"
mount /dev/sdaY /mnt/boot            <-- your boot partition (if you have one)
cd /mnt
for i in /proc /sys /dev; do mount -B $i .$i; done
chroot .
grub-mkconfig -o /boot/grub/grub.cfg

Don't forget to mark it as solved (by editing the first post).


Edit: Fixed the mount order.

Last edited by DSpider (2012-07-21 16:39:13)


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#4 2012-07-21 17:56:21

@op
Member
Registered: 2011-04-05
Posts: 49

Re: [SOLVED] Forgot to create grub2 config

Thank you for your detailed instructions. I have a problem with mounting my boot partition.

# mount /dev/sda1 /mnt/boot
Unable to read data cache entry [16329fc]
Unable to read page, block 16329fc, size 1f47c
Unable to read data cache entry [16329fc]
Unable to read page, block 16329fc, size 1f47c
mount: unkown filesystem type 'ext2'

The same happens when I add -t ext2.

Last edited by @op (2012-07-21 17:56:39)

Offline

#5 2012-07-21 18:16:06

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: [SOLVED] Forgot to create grub2 config

If you didn't create a config you should still be able to get to the GRUB prompt. From there you can enter all the required commands (which are normal in your grub.cfg menu entry) and boot from there.

Of course make sure you create a config file before you reboot again.

Offline

#6 2012-07-21 18:59:56

@op
Member
Registered: 2011-04-05
Posts: 49

Re: [SOLVED] Forgot to create grub2 config

Grub starts fine, so I could try that too.
But I also would like to know what's the problem with mounting my boot partition, even it's for further maintenance.

Offline

#7 2012-07-22 08:59:57

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [SOLVED] Forgot to create grub2 config

@op wrote:

Today I updated my machines to grub2 and everything worked very well. But something has to go wrong everytime and I forgot to run the config creation with

grub-mkconfig -o /boot/grub/grub.cfg

on the last machine and rebooted.
Now grub starts but of course can't find my hard drive.
How can I fix this? Can I run a live system and generate the config file?

If you still have your grub-legacy's grub.conf or menu.lst you can try "legacy_configfile" command from the grub command line.

Offline

#8 2012-07-22 10:31:10

@op
Member
Registered: 2011-04-05
Posts: 49

Re: [SOLVED] Forgot to create grub2 config

I got one step further, but there is another problem.
At first I chrooted into my system using a live CD like DSpider said and ran the grub-mkconfig command which seemed to work.
After the grub screen he now boots the system and a the point where he's checking the filesystem there is an error with sd4 (my home partition).
If I boot with the live CD again I can mount sda4 with no problems.

The error message says (translated)

/dev/sda1: clean ...
/dev/sda4 contains a faulty filesystem, check forced.
/dev/sda4:
Inodes, which are parts of a defect list with orphan links

/dev/sda4: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY
*** Filesystem Check Failed ***
Please repair manually and reboot (...)
***

What I tried next was the.ridikulus.rat's advice. I got into the grub console and booted with my legacy config file, which actually worked. The next step was to run grub-mkconfig again, but when rebooting the same error from above occurs.

Last edited by @op (2012-07-22 10:40:32)

Offline

#9 2012-07-22 10:49:27

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] Forgot to create grub2 config

This doesn't make any sense:

/dev/sda4: UNEXPECTED INCONSISTENCY; fgrub-mkconfigsck EXECUTE MANUALLY

Did you paste "grub-mkconfig" in the middle of "fsck"? lol

Post your fstab. Or better yet, check it against the examples from the fstab wiki page. Only the "/" entry needs "1" at the end. Everything else should have either "2" or "0" (see "Field definitions"). Check it carefully for typos (e.g. "etx2" instead of "ext2", correct - and existent - mount points, no extra odd parameters, etc). Also, if you have a separate /usr partition see this: https://wiki.archlinux.org/index.php/Fs … _partition


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#10 2012-07-22 11:48:11

@op
Member
Registered: 2011-04-05
Posts: 49

Re: [SOLVED] Forgot to create grub2 config

Yes, I pasted it accidentally ^^ I edited my post.

Somehow I don't think it's a problem with my fstab, but I checked it and changed the pass values like you said. But it changed nothing.

Here's my fstab

devpts         /dev/pts        devpts        defaults     0   0
shm            /dev/shm       tmpfs         nodev,nosuid  0   0
UUID=072ba75b-(...) / ext4 defaults 0 1
UUID=20970ff1-(...) swap swap defaults 0 0
UUID=5c36e2a4-(...) /boot ext2 defaults 0 0
UUID=b4bc53f1-(...) /home ext4 defaults 0 2

#usb proxy fix for virtual box
none /proc/bus/usb    usbfs   auto,busgid=108,busmode=0775,devgid=128,devmode=664   0   0

fstab on my laptop does not have the devpts and shm parts, so I commented them out for testing. But with no effect.

Last edited by @op (2012-07-22 11:54:05)

Offline

#11 2012-07-22 12:16:18

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] Forgot to create grub2 config

From a "live" Linux distribution, run:

# e2fsck -p /dev/sda4

...and hope it's not a hardware problem.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#12 2012-07-22 12:24:58

@op
Member
Registered: 2011-04-05
Posts: 49

Re: [SOLVED] Forgot to create grub2 config

# e2fsck -p /dev/sda4
/dev/sda4 contains a file system with errors, check forced.
/dev/sda4 Inodes that were part of a currupted orphan linked list found.

/dev/sda4. UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
  (i.e., without -a or -p options)

maybe I should run fsck without -p? big_smile

fsck /dev/sda4
fsck from util-linux 2.19.1
e2fsck 1.41.14 (22-Dev-2010)
/dev/sda4 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sized
Inodes that were part of a currupted orphan linked list found. Fix<y>?

I fixed several errors in the file system and rebooted. Now everything seems to work without any issues. Thank you guys.

Last edited by @op (2012-07-22 12:52:29)

Offline

Board footer

Powered by FluxBB