|
From: | Ford Han |
Subject: | Help! syntax error when using grub2-mkconfig -o /boot/grub2/grub.cfg in Fedora 17 |
Date: | Wed, 18 Jul 2012 16:44:54 +0800 |
#!/bin/sh -e
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
echo "Adding Ubuntu to GRUB 2"
cat << EOF
menuentry "Ubuntu, with Linux 3.2.0-26-generic-pae" {
set root=(hd0,7)
linux (hd0,6)/vmlinuz-3.2.0-26-generic-pae
root=/dev/sda7 ro quiet splash $vt_handoff
initrd (hd0,6)/initrd.img-3.2.0-26-generic-pae
}
EOF
2). Then I use the grub2-mkconfig command to re-create the grub.cfg file: grub2-mkconfig -o /boot/grub2/grub.cfg
The output says there are errors:
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.4.4-5.fc17.i686
Found initrd image: /boot/initramfs-3.4.4-5.fc17.i686.img
Found linux image: /boot/vmlinuz-3.3.4-5.fc17.i686
Found initrd image: /boot/initramfs-3.3.4-5.fc17.i686.img
No volume groups found
Found Windows 7 (loader) on /dev/sda1
Found Windows 7 (loader) on /dev/sda2
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 175
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub2/grub.cfg.new file attached.done
These commands have been verified in GRUB 2 boot prompts. I do not know which line is line 175 and where is the specific error.
3). If I remove the newly added file 15_Ubuntu from directory /etc/grub.d and grub2-mkconfig again, the output has no error messages.
FYI, the partition information is as follows (there are two swaps now, just ignore it. I will update later):
address@hidden grub.d]# fdisk -l
Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x9157ea21
Device Boot Start End Blocks
Id System
/dev/sda1 * 2048
3074047 1536000 7
HPFS/NTFS/exFAT
/dev/sda2 3074048 100397055
48661504 7 HPFS/NTFS/exFAT
/dev/sda3 100399102 596467711
248034305 f W95 Ext'd (LBA)
Partition 3 does not start on physical sector boundary.
/dev/sda4 596467712 625139711
14336000 7 HPFS/NTFS/exFAT
/dev/sda5 100399104 414971903
157286400 7
HPFS/NTFS/exFAT
/dev/sda6 414973952 415948799 487424
83 Linux
/dev/sda7 415950848 425713663
4881408 83 Linux
/dev/sda8 425715712 433526783
3905536 82 Linux swap / Solaris
/dev/sda9 433528832 496889855
31680512 83 Linux
/dev/sda10 496891904 497915903 512000
83 Linux
/dev/sda11 497917952 578033663
40057856 83 Linux
/dev/sda12 578035712 588275711
5120000 83 Linux
/dev/sda13 588277760 596467711
4094976 82 Linux swap / Solaris
Disk /dev/sdb: 2001 MB, 2001731584 bytes
26 heads, 56 sectors/track, 2685 cylinders, total 3909632 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: 0xc3072e18
[Prev in Thread] | Current Thread | [Next in Thread] |