[SOLVED] GRUB: Cannot find list of partitions && /usr/sbin/grub-setup: error
Linux MintThis forum is for the discussion of Linux Mint.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
GRUB: Cannot find list of partitions && /usr/sbin/grub-setup: error
I use four partitions on my machine: first and second for different Linux systems, third for data and fourth for swap. On the first partition I installed Mint. By default it used GRUB installed on /dev/sda. Then I installed Slackware on the second partition. I decided to put LILO on /dev/sda. In result I lost access to GRUB and Mint.
Now my goal is to install Mint’s GRUB on /dev/sda1 and then configure Slackware’s LILO to run Mint’s GRUB.
To achieve the first goal I run Mint DVD, open terminal and use the commands:
$ sudo mount /dev/sda1 /mnt/
$ sudo mount --bind /dev/ /mnt/dev/
$ sudo mount --bind /proc/ /mnt/proc/
$ sudo chroot /mnt/
Then I try to generate grub.cfg...
# update-grub2
Code:
Generating grub.cfg ...
Found Debian background: linuxmint.png
Found linux image: /boot/vmlinuz-2.6.32-21-generic
Found initrd image: /boot/initrd.img-2.6.32-21-generic
Found memtest86+ image: /boot/memtest86+.bin
Cannot find list of partitions!
done
The above command claims it cannot find the list of partitions. I tried to find any help about that topic but without success.
First question: does that message informs about some serious problem?
Second question: how can I pass the list of partitions on to GRUB?
Next I try to install GRUB on /dev/sda1...
# grub-install /dev/sda1
Code:
/usr/sbin/grub-setup: error: hd0,1 appears to contain a reiserfs filesystem which isn't known to reserve space for DOS-style boot. Installing GRUB there could result in FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe disables this check, use at your own risk).
For more comfortable reading I quote the above message here:
Quote:
/usr/sbin/grub-setup: error: hd0,1 appears to contain a reiserfs filesystem which isn't known to reserve space for DOS-style boot. Installing GRUB there could result in FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe disables this check, use at your own risk).
I tried to find any information about that message but I found just the same message in grub-setup.c file...
Code:
#: util/i386/pc/grub-setup.c:258
#, c-format
msgid ""
"%s appears to contain a %s filesystem which isn't known to reserve space for "
"DOS-style boot. Installing GRUB there could result in FILESYSTEM "
"DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe "
"disables this check, use at your own risk)"
msgstr ""
I tried to use --skip-fs-probe option but grub-install doesn’t accept it...
Third question: how can I force GRUB to install boot loader on /dev/sda1 instead of /dev/sda?
***
Here are my GRUB’s configuration files...
/etc/default/grub:
Code:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX="vga=791"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1024x768
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_LINUX_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
/etc/grub.d/40_custom:
Code:
#!/bin/sh
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.
menuentry "Slackware Linux" {
set root=(hd0,2)
linux /boot/vmlinuz-generic-smp-2.6.33.4-smp root=/dev/sda2 ro vga=791
initrd /boot/initrd.gz
}
/boot/grub/grub.cfg:
Code:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod reiserfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 80831a79-bd79-400f-acb9-ecd256b50e08
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=1024x768
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod reiserfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 80831a79-bd79-400f-acb9-ecd256b50e08
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/06_mint_theme ###
insmod reiserfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 80831a79-bd79-400f-acb9-ecd256b50e08
insmod png
if background_image /boot/grub/linuxmint.png ; then
set color_normal=white/black
set color_highlight=white/light-gray
else
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
fi
### END /etc/grub.d/06_mint_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry "Linux Mint 9, 2.6.32-21-generic (/dev/sda1)" --class linuxmint --class gnu-linux --class gnu --class os {
recordfail
insmod reiserfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 80831a79-bd79-400f-acb9-ecd256b50e08
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=80831a79-bd79-400f-acb9-ecd256b50e08 ro vga=791
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry "Linux Mint 9, 2.6.32-21-generic (/dev/sda1) -- recovery mode" --class linuxmint --class gnu-linux --class gnu --class os {
recordfail
insmod reiserfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 80831a79-bd79-400f-acb9-ecd256b50e08
echo 'Loading Linux 2.6.32-21-generic ...'
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=80831a79-bd79-400f-acb9-ecd256b50e08 ro single vga=791
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod reiserfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 80831a79-bd79-400f-acb9-ecd256b50e08
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod reiserfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 80831a79-bd79-400f-acb9-ecd256b50e08
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# 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.
menuentry "Slackware Linux" {
set root=(hd0,2)
linux /boot/vmlinuz-generic-smp-2.6.33.4-smp root=/dev/sda2 ro vga=791
initrd /boot/initrd.gz
}
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/40_custom.old ###
# 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.
### END /etc/grub.d/40_custom.old ###
Look at the tutorial link below, Section 4.G, Reinstall Grub. According to that you would just run: grub-install /dev/sda1 to install Grub 2 on the first partition.
grub-setup: info: cannot open `/boot/grub/device.map'.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: the size of hd0 is 156301488.
.
.
.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: /dev/sda1 starts from 63.
grub-setup: info: opening the device hd0.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: DOS partition 0 starts from 63.
grub-setup: info: getting the size of /boot/grub/boot.img.
grub-setup: info: reading /boot/grub/boot.img.
grub-setup: info: getting the size of /boot/grub/boot.img.
grub-setup: info: getting the size of /boot/grub/core.img.
grub-setup: info: reading /boot/grub/core.img.
grub-setup: info: getting the size of /boot/grub/core.img.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: setting the root device to `hd0,1'.
grub-setup: info: dos partition is 0, bsd partition is -1.
grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea..
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged..
grub-setup: error: if you really want blocklists, use --force.
Because GRUB displayed an error message I tried to add --force option to the above command...
grub-setup: info: cannot open `/boot/grub/device.map'.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: the size of hd0 is 156301488.
.
.
.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: /dev/sda1 starts from 63.
grub-setup: info: opening the device hd0.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: DOS partition 0 starts from 63.
grub-setup: info: getting the size of /boot/grub/boot.img.
grub-setup: info: reading /boot/grub/boot.img.
grub-setup: info: getting the size of /boot/grub/boot.img.
grub-setup: info: getting the size of /boot/grub/core.img.
grub-setup: info: reading /boot/grub/core.img.
grub-setup: info: getting the size of /boot/grub/core.img.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: setting the root device to `hd0,1'.
grub-setup: info: dos partition is 0, bsd partition is -1.
grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea..
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged..
grub-setup: info: attempting to read the core image `/boot/grub/core.img' from GRUB.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: the size of hd0 is 156301488.
grub-setup: info: the first sector is <5561791,0,512>.
grub-setup: info: saving <5561792,0,512> with the segment 0x820.
grub-setup: info: saving <5561793,0,512> with the segment 0x840.
grub-setup: info: saving <5561794,0,512> with the segment 0x860.
.
.
.
grub-setup: info: saving <5561840,0,512> with the segment 0xe20.
grub-setup: info: saving <5561841,0,512> with the segment 0xe40.
grub-setup: info: saving <5561842,0,502> with the segment 0xe60.
grub-setup: info: opening the core image `/boot/grub/core.img'.
grub-setup: info: writing 0x400 bytes.
In both above listings grub-setup displays the message: “GRUB can only be installed in this setup by using blocklists”. I found help about block lists...
Quote:
A block list is used for specifying a file that doesn’t appear in the filesystem, like a chainloader. The syntax is [offset]+length[,[offset]+length].... Here is an example:
0+100,200+1,300+300
This represents that GRUB should read blocks 0 through 99, block 200, and blocks 300 through 599. If you omit an offset, then GRUB assumes the offset is zero.
I’m sorry. I’m very good in computing but not enough good to guess all those GRUB’s offsets and lengths. Or maybe I can’t interpret properly some grub-setup messages...
Using grub-install without or with --force option gives the same results as before...
# grub-install /dev/sda1
Code:
/usr/sbin/grub-setup: error: hd0,1 appears to contain a reiserfs filesystem which isn't known to reserve space for DOS-style boot. Installing GRUB there could result in FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe disables this check, use at your own risk).
# grub-install --force /dev/sda1
Code:
/usr/sbin/grub-setup: error: hd0,1 appears to contain a reiserfs filesystem which isn't known to reserve space for DOS-style boot. Installing GRUB there could result in FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe disables this check, use at your own risk).
***
@yancek
As I wrote in the first post I tried grub-install /dev/sda1 command to install boot loader on the first partition but it refused to do it displaying very rare message about reiserfs filesystem, DOS-style boot, FILESYSTEM DESTRUCTION and --skip-fs-probe option. I’m sorry but your advice to use that command isn’t helpful at all because I encountered the problems when I tried to use that command. As for LILO I didn’t ask about it because I don’t have the problem with LILO but with GRUB.
I rebooted machine and tried to boot Mint on /dev/sda1 using Mint DVD once again. It seems after last changes I lost the possibility to chroot to Mint installed on /dev/sda1...
$ sudo mount /dev/sda1 /mnt/
$ sudo mount –bind /dev/ /mnt/dev/
$ sudo mount –bind /proc/ /mnt/proc/
$ sudo chroot /mnt/
Code:
sudo: unable to execute /usr/sbin/chroot: Input/output error
I suspect in such a situation I can only reinstall Mint. I’m afraid the result will be the same. I’d like to have Mint using ReiserFS and bootloader on the first partition. Meanwhile my experience shows GRUB doesn’t understand ReiserFS and refuses to install bootloader on the first partition. It’s very disappointing state of affairs.
On the contrary - grub2 appears to understand the structure of reiser very well.
You were warned, you used --force, *you* screwed the filesystem. You shoot yourself in the foot, don't go blaming others.
Like lilo grub2 relies on a blocklist - it moans (as above) about being installed into a partition, but seems to operate o.k. once done. On sane filesystems.
You shoot yourself in the foot, don’t go blaming others.
I used --force option after exhausting the other possibilities. I stated above GRUB doesn’t understand ReiserFS well because with LILO I can install bootloader on the ReiserFS partition without any problems. Moreover LILO never forced me to use some magic blocklists. It denies your thesis that both LILO and GRUB rely on blocklists. Searching Internet I found mentioned above GRUB problem a few times – always in the context of ReiserFS. More helpful than patronizing me would be helping me in understand how could I install GRUB’s bootloader on ReiserFS partition. Anyway thank you for your attempt to be helpful.
w1k0,
You might find it easier to put Grub2 on the MBR, and chainload slackware by putting your slackware bootloader into your slackware partition (sda2?) superblock. I can't remember whether Lilo will go into the superblock, but Grub 1 certainly will.
Grub2 has some advantages, but you're not the only one to have troubles getting it to go anywhere except the MBR.
For a lot of info on booting, see here
Grub2 has some advantages, but you're not the only one to have troubles getting it to go anywhere except the MBR.
It’s sad news. When I installed the former version of Mint I used the configuration you suggest here. So I used GRUB from MBR to run Mint from first partition or Slackware from the second one. It worked without any problems. Now I tried the reverse method: to use LILO from MBR to run one of the mentioned distributions. That doesn’t work because GRUB refuses to install bootloader on the beginning of the partition.
You stated that problem is common. So I’ll have to live with GRUB’s menu instead of LILO’s one. It isn’t very painful for me to use GRUB instead of LILO because I keep Mint on my spare machine and I use it rather seldom. In my opinion Mint is a great distribution for newcomers. So I test and configure the new version of Mint on my spare machine and then clone it on my girlfriend’s machine. That’s my whole story about Mint.
Thank you impert for your nice assistance. I’ll keep that thread opened for a few days in hope that someone knows the tricky method of installing GRUB’s bootloader at the beginning of the partition and then I’ll mark it as SOLVED.
I’ll keep that thread opened for a few days in hope that someone knows the tricky method of installing GRUB’s bootloader at the beginning of the partition and then I’ll mark it as SOLVED.
Maybe it's just not possible with reiserfs.
I know that Saikee, who wrote the "Just booting tips" in that link I gave you, has suggested using the -f option, but it was almost certainly with ext3. There does have to be somewhere for it to go at the start of the partition.
Moreover LILO never forced me to use some magic blocklists. It denies your thesis that both LILO and GRUB rely on blocklists.
lilo always uses blocklists - it's why you have to continually rerun the lilo command after changes to the config.
The fact that you don't understand that is irrelevant.
For various reasons I haven't used reiser since before it was renamed to reiserfs. I can't help you as to whether what you want is even possible. Given Hans bloody-minded attitude, I doubt it.
Basically, Ubuntu's copy of grub-install is not configured to write to anything other than ext3fs during setup, and attempts to install GRUB when the /boot/ folder is on a ReiserFS partition and GRUB is to be written to the bootsector were failing. This issue manifests itself in all releases since (and including) Hoary Hedgehog (5.04); including the most recent Ubuntu Feisty Fawn (7.04) and Ubuntu Gutsy Gibbon (7.10) releases.
Unfortunately this has been a (little-) known issue ever since March of 2005, but no one has bothered to fix it since. Every once in a while someone "bumps" the bug and confirms that it's still present, but it hasn't yet been addressed or even assigned.
The first paragraph above seems to describe my situation. I use ReiserFS root partition with /boot directory on it and I tried to install GRUB to bootsector. The second paragraph reports that issue appears since 2005. If it’s true shame on Ubuntu team moreover other distributions cope with such configuration well.
Your second link is from June 2007:
Quote:
When one tries to install GRUB on a reiserfs partition instead of the MBR,
the installation fails with the following message:
"Executing 'grub-install (hd0,9)' failed.
This is a fatal error."
I have confirmed that this error does not occur when an ext3 partition
or the MBR is used for GRUB.
In my case the error message is different but it seems GRUB still doesn’t understand ReiserFS. So I have two options: to give up with ReiserFS and use EXT3 or to give up with partition bootsector and use MBR. I don’t like to change my habits but I’m now in a dead end.
"If your boot partition (the one holding the kernel) is ReiserFS, be sure to mount it with the -o notail option so GRUB gets properly installed.
Make sure that notail ends up in your new /etc/fstab boot partition entry, too."
It concerns Gentoo and according to first yancek’s link the problem I described occurs in Ubuntu so the chances notail option will help in my situation are rather little.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.