Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 427340 - sys-boot/grub-static-0.97-r10 incorrectly detects /boot as read-only and fails
Summary: sys-boot/grub-static-0.97-r10 incorrectly detects /boot as read-only and fails
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: AMD64 Project
URL:
Whiteboard:
Keywords:
Depends on: 674364
Blocks:
  Show dependency tree
 
Reported: 2012-07-20 15:37 UTC by Roland Ramthun
Modified: 2019-01-10 08:48 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Ramthun 2012-07-20 15:37:16 UTC
While trying to install sys-boot/grub-static-0.97-r10 the /boot partition incorrectly gets detected as being read-only.

The remount attempt in this case remounts it ro and installation fails.

sysresccd linux # cat /etc/fstab 

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda1		/boot		ext2		noauto,noatime	1 2
/dev/sda2		/		ext4		noatime,discard	0 1


sysresccd linux # mount
/dev/sda2 on / type ext4 (rw,noatime,discard)
/dev/sda1 on /boot type ext2 (rw,noatime)

sysresccd linux # touch /boot/test && rm /boot/test
(works without error)

sysresccd linux # emerge grub-static

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-boot/grub-static-0.97-r10  0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] 

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) sys-boot/grub-static-0.97-r10
 * grub-static-0.97-r10.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...                                                                                                                                                                       [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     3.3.8-gentoo
 * Checking for suitable kernel configuration options...                                                                                                                                                                              [ ok ]
>>> Unpacking source...
>>> Unpacking grub-static-0.97-r10.tar.bz2 to /var/tmp/portage/sys-boot/grub-static-0.97-r10/work

bzip2: /var/tmp/portage/sys-boot/grub-static-0.97-r10/distdir/grub-static-0.97-r10.tar.bz2: trailing garbage after EOF ignored
>>> Source unpacked in /var/tmp/portage/sys-boot/grub-static-0.97-r10/work
>>> Compiling source in /var/tmp/portage/sys-boot/grub-static-0.97-r10/work ...
>>> Source compiled.
>>> Test phase [not enabled]: sys-boot/grub-static-0.97-r10

>>> Install grub-static-0.97-r10 into /var/tmp/portage/sys-boot/grub-static-0.97-r10/image/ category sys-boot
 * New grub can run on your system, good!
>>> Completed installing grub-static-0.97-r10 into /var/tmp/portage/sys-boot/grub-static-0.97-r10/image/



 * QA Notice: Pre-stripped files found:
 * /usr/lib/debug/bin/mbchk.debug
 * /usr/lib/debug/sbin/grub.debug
ecompressdir: bzip2 -9 /usr/share/info
ecompressdir: bzip2 -9 /usr/share/man

>>> Installing (1 of 1) sys-boot/grub-static-0.97-r10
 * checking 38 files for package collisions
>>> Merging sys-boot/grub-static-0.97-r10 to /
 * 
 * To avoid automounting and auto(un)installing with /boot,
 * just export the DONT_MOUNT_BOOT variable.
 * 
 * 
 * Your boot partition, detected as being mounted as /boot, is read-only.
 * Remounting it in read-write mode ...
 * 
--- /bin/
>>> /bin/mbchk
--- /usr/
--- /usr/share/
--- /usr/share/info/
>>> /usr/share/info/multiboot.info.bz2
>>> /usr/share/info/grub.info.bz2
--- /usr/share/grub/
>>> /usr/share/grub/splash.xpm.gz
--- /usr/share/man/
--- /usr/share/man/man1/
>>> /usr/share/man/man1/mbchk.1.bz2
--- /usr/share/man/man8/
>>> /usr/share/man/man8/grub-terminfo.8.bz2
>>> /usr/share/man/man8/grub.8.bz2
>>> /usr/share/man/man8/grub-install.8.bz2
>>> /usr/share/man/man8/grub-md5-crypt.8.bz2
--- /usr/share/doc/
--- /usr/share/doc/grub-static-0.97-r10/
>>> /usr/share/doc/grub-static-0.97-r10/grub.conf.sample.bz2
>>> /usr/share/doc/grub-static-0.97-r10/AUTHORS.bz2
>>> /usr/share/doc/grub-static-0.97-r10/NEWS.bz2
>>> /usr/share/doc/grub-static-0.97-r10/README.bz2
>>> /usr/share/doc/grub-static-0.97-r10/TODO.bz2
>>> /usr/share/doc/grub-static-0.97-r10/THANKS.bz2
>>> /usr/share/doc/grub-static-0.97-r10/grub.conf.gentoo.bz2
>>> /usr/share/doc/grub-static-0.97-r10/BUGS.bz2
>>> /usr/share/doc/grub-static-0.97-r10/ChangeLog.bz2
--- /usr/lib/
--- /usr/lib/debug/
--- /usr/lib/debug/bin/
>>> /usr/lib/debug/bin/mbchk.debug
--- /usr/lib/debug/sbin/
>>> /usr/lib/debug/sbin/grub.debug
--- /sbin/
>>> /sbin/grub
>>> /sbin/grub-md5-crypt
>>> /sbin/grub-install
>>> /sbin/grub-set-default
>>> /sbin/grub-terminfo
--- /lib/
--- /lib/grub/
--- /lib/grub/i386-pc/
>>> /lib/grub/i386-pc/xfs_stage1_5
>>> /lib/grub/i386-pc/iso9660_stage1_5
>>> /lib/grub/i386-pc/jfs_stage1_5
>>> /lib/grub/i386-pc/fat_stage1_5
>>> /lib/grub/i386-pc/reiserfs_stage1_5
>>> /lib/grub/i386-pc/e2fs_stage1_5
>>> /lib/grub/i386-pc/ufs2_stage1_5
>>> /lib/grub/i386-pc/stage2
>>> /lib/grub/i386-pc/stage1
>>> /lib/grub/i386-pc/vstafs_stage1_5
>>> /lib/grub/i386-pc/stage2_eltorito
>>> /lib/grub/i386-pc/minix_stage1_5
>>> /lib/grub/i386-pc/ffs_stage1_5
>>> Safely unmerging already-installed instance...
 * 
 * To avoid automounting and auto(un)installing with /boot,
 * just export the DONT_MOUNT_BOOT variable.
 * 
 * 
 * Your boot partition, detected as being mounted as /boot, is read-only.
 * Remounting it in read-write mode ...
 * 
No package files given... Grabbing a set.
--- replaced obj /usr/share/man/man8/grub.8.bz2
--- replaced obj /usr/share/man/man8/grub-terminfo.8.bz2
--- replaced obj /usr/share/man/man8/grub-md5-crypt.8.bz2
--- replaced obj /usr/share/man/man8/grub-install.8.bz2
--- replaced dir /usr/share/man/man8
--- replaced obj /usr/share/man/man1/mbchk.1.bz2
--- replaced dir /usr/share/man/man1
--- replaced dir /usr/share/man
--- replaced obj /usr/share/info/multiboot.info.bz2
--- replaced obj /usr/share/info/grub.info.bz2
--- replaced dir /usr/share/info
--- replaced obj /usr/share/grub/splash.xpm.gz
--- replaced dir /usr/share/grub
--- replaced obj /usr/share/doc/grub-static-0.97-r10/grub.conf.sample.bz2
--- replaced obj /usr/share/doc/grub-static-0.97-r10/grub.conf.gentoo.bz2
--- replaced obj /usr/share/doc/grub-static-0.97-r10/TODO.bz2
--- replaced obj /usr/share/doc/grub-static-0.97-r10/THANKS.bz2
--- replaced obj /usr/share/doc/grub-static-0.97-r10/README.bz2
--- replaced obj /usr/share/doc/grub-static-0.97-r10/NEWS.bz2
--- replaced obj /usr/share/doc/grub-static-0.97-r10/ChangeLog.bz2
--- replaced obj /usr/share/doc/grub-static-0.97-r10/BUGS.bz2
--- replaced obj /usr/share/doc/grub-static-0.97-r10/AUTHORS.bz2
--- replaced dir /usr/share/doc/grub-static-0.97-r10
--- replaced dir /usr/share/doc
--- replaced dir /usr/share
--- replaced obj /usr/lib/debug/sbin/grub.debug
--- replaced dir /usr/lib/debug/sbin
--- replaced obj /usr/lib/debug/bin/mbchk.debug
--- replaced dir /usr/lib/debug/bin
--- replaced dir /usr/lib/debug
--- replaced dir /usr/lib
--- replaced dir /usr
--- replaced obj /sbin/grub-terminfo
--- replaced obj /sbin/grub-set-default
--- replaced obj /sbin/grub-md5-crypt
--- replaced obj /sbin/grub-install
--- replaced obj /sbin/grub
--- replaced dir /sbin
--- replaced obj /lib/grub/i386-pc/xfs_stage1_5
--- replaced obj /lib/grub/i386-pc/vstafs_stage1_5
--- replaced obj /lib/grub/i386-pc/ufs2_stage1_5
--- replaced obj /lib/grub/i386-pc/stage2_eltorito
--- replaced obj /lib/grub/i386-pc/stage2
--- replaced obj /lib/grub/i386-pc/stage1
--- replaced obj /lib/grub/i386-pc/reiserfs_stage1_5
--- replaced obj /lib/grub/i386-pc/minix_stage1_5
--- replaced obj /lib/grub/i386-pc/jfs_stage1_5
--- replaced obj /lib/grub/i386-pc/iso9660_stage1_5
--- replaced obj /lib/grub/i386-pc/ffs_stage1_5
--- replaced obj /lib/grub/i386-pc/fat_stage1_5
--- replaced obj /lib/grub/i386-pc/e2fs_stage1_5
--- replaced dir /lib/grub/i386-pc
--- replaced dir /lib/grub
--- replaced dir /lib
--- replaced obj /bin/mbchk
--- replaced dir /bin
 * 
 * Automatically remounting /boot as ro
 * 
>>> Regenerating /etc/ld.so.cache...
>>> Original instance of package unmerged safely.
ln: Symbolischen Verknüpfung „//boot/boot“ konnte angelgt werden: Das Dateisystem ist nur lesbar
mkdir: kann Verzeichnis „//boot/grub“ nicht anlegen: Das Dateisystem ist nur lesbar
 * ERROR: sys-boot/grub-static-0.97-r10 failed (postinst phase):
 *   //boot/grub does not exist!
 * 
 * Call stack:
 *     ebuild.sh, line   85:  Called pkg_postinst
 *   environment, line 2602:  Called setup_boot_dir '//boot'
 *   environment, line 2844:  Called die
 * The specific snippet of code:
 *           mkdir "${dir}" || die "${dir} does not exist!";
 * 
 * If you need support, post the output of 'emerge --info =sys-boot/grub-static-0.97-r10',
 * the complete build log and the output of 'emerge -pqv =sys-boot/grub-static-0.97-r10'.
 * The complete build log is located at '/var/tmp/portage/sys-boot/grub-static-0.97-r10/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-boot/grub-static-0.97-r10/temp/environment'.
 * S: '/var/tmp/portage/sys-boot/grub-static-0.97-r10/work/grub-static-0.97'
!!! FAILED postinst: 1

 * Messages for package sys-boot/grub-static-0.97-r10:

 * 
 * To avoid automounting and auto(un)installing with /boot,
 * just export the DONT_MOUNT_BOOT variable.
 * 

 * Messages for package sys-boot/grub-static-0.97-r10:

 * 
 * To avoid automounting and auto(un)installing with /boot,
 * just export the DONT_MOUNT_BOOT variable.
 * 
 * ERROR: sys-boot/grub-static-0.97-r10 failed (postinst phase):
 *   //boot/grub does not exist!
 * 
 * Call stack:
 *     ebuild.sh, line   85:  Called pkg_postinst
 *   environment, line 2602:  Called setup_boot_dir '//boot'
 *   environment, line 2844:  Called die
 * The specific snippet of code:
 *           mkdir "${dir}" || die "${dir} does not exist!";
 * 
 * If you need support, post the output of 'emerge --info =sys-boot/grub-static-0.97-r10',
 * the complete build log and the output of 'emerge -pqv =sys-boot/grub-static-0.97-r10'.
 * The complete build log is located at '/var/tmp/portage/sys-boot/grub-static-0.97-r10/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-boot/grub-static-0.97-r10/temp/environment'.
 * S: '/var/tmp/portage/sys-boot/grub-static-0.97-r10/work/grub-static-0.97'
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * Regenerating GNU info directory index...
 * Processed 72 info files.
Comment 1 Roland Ramthun 2012-07-20 15:49:07 UTC
The system is amd64 multilib. Emerging sys-boot/grub gives similar messages, but works. After merging sys-boot-grub grub is installed in /boot, but /boot has been remounted ro.

[...]
make[2]: Entering directory `/var/tmp/portage/sys-boot/grub-0.97-r10/work/grub-0.97'
make[2]: Für das Ziel »install-exec-am« ist nichts zu tun.
make[2]: Für das Ziel »install-data-am« ist nichts zu tun.
make[2]: Leaving directory `/var/tmp/portage/sys-boot/grub-0.97-r10/work/grub-0.97'
make[1]: Leaving directory `/var/tmp/portage/sys-boot/grub-0.97-r10/work/grub-0.97'
 * Fallback PaX marking -m
 *      /var/tmp/portage/sys-boot/grub-0.97-r10/image//sbin/grub
 TYPE    PAX   FILE 
ET_EXEC --mxe- /var/tmp/portage/sys-boot/grub-0.97-r10/image//sbin/grub 
>>> Completed installing grub-0.97-r10 into /var/tmp/portage/sys-boot/grub-0.97-r10/image/

strip: strip --strip-unneeded -R .comment -R .GCC.command.line
   bin/mbchk
   sbin/grub
ecompressdir: bzip2 -9 /usr/share/info
ecompressdir: bzip2 -9 /usr/share/doc
ecompressdir: bzip2 -9 /usr/share/man

>>> Installing (2 of 2) sys-boot/grub-0.97-r10
 * checking 36 files for package collisions
>>> Merging sys-boot/grub-0.97-r10 to /
 * 
 * To avoid automounting and auto(un)installing with /boot,
 * just export the DONT_MOUNT_BOOT variable.
 * 
 * 
 * Your boot partition, detected as being mounted as /boot, is read-only.
 * Remounting it in read-write mode ...
 * 
--- /bin/
>>> /bin/mbchk
--- /usr/
--- /usr/share/
--- /usr/share/info/
>>> /usr/share/info/multiboot.info.bz2
>>> /usr/share/info/grub.info.bz2
>>> /usr/share/grub/
>>> /usr/share/grub/splash.xpm.gz
--- /usr/share/man/
--- /usr/share/man/man1/
>>> /usr/share/man/man1/mbchk.1.bz2
--- /usr/share/man/man8/
>>> /usr/share/man/man8/grub-terminfo.8.bz2
>>> /usr/share/man/man8/grub.8.bz2
>>> /usr/share/man/man8/grub-install.8.bz2
>>> /usr/share/man/man8/grub-md5-crypt.8.bz2
--- /usr/share/doc/
>>> /usr/share/doc/grub-0.97-r10/
>>> /usr/share/doc/grub-0.97-r10/grub.conf.sample.bz2
>>> /usr/share/doc/grub-0.97-r10/AUTHORS.bz2
>>> /usr/share/doc/grub-0.97-r10/NEWS.bz2
>>> /usr/share/doc/grub-0.97-r10/README.bz2
>>> /usr/share/doc/grub-0.97-r10/TODO.bz2
>>> /usr/share/doc/grub-0.97-r10/THANKS.bz2
>>> /usr/share/doc/grub-0.97-r10/grub.conf.gentoo.bz2
>>> /usr/share/doc/grub-0.97-r10/BUGS.bz2
>>> /usr/share/doc/grub-0.97-r10/ChangeLog.bz2
--- /sbin/
>>> /sbin/grub
>>> /sbin/grub-md5-crypt
>>> /sbin/grub-install
>>> /sbin/grub-set-default
>>> /sbin/grub-terminfo
--- /lib/
>>> /lib/grub/
>>> /lib/grub/i386-pc/
>>> /lib/grub/i386-pc/xfs_stage1_5
>>> /lib/grub/i386-pc/iso9660_stage1_5
>>> /lib/grub/i386-pc/jfs_stage1_5
>>> /lib/grub/i386-pc/fat_stage1_5
>>> /lib/grub/i386-pc/reiserfs_stage1_5
>>> /lib/grub/i386-pc/e2fs_stage1_5
>>> /lib/grub/i386-pc/ufs2_stage1_5
>>> /lib/grub/i386-pc/stage2
>>> /lib/grub/i386-pc/stage1
>>> /lib/grub/i386-pc/vstafs_stage1_5
>>> /lib/grub/i386-pc/stage2_eltorito
>>> /lib/grub/i386-pc/minix_stage1_5
>>> /lib/grub/i386-pc/ffs_stage1_5
 * 
 * To avoid automounting and auto(un)installing with /boot,
 * just export the DONT_MOUNT_BOOT variable.
 * 
 * 
 * Your boot partition, detected as being mounted as /boot, is read-only.
 * Remounting it in read-write mode ...
 * 
 * Linking from new grub.conf name to menu.lst
 * Copying files from /lib/grub, /usr/lib/grub and /usr/share/grub to //boot/grub
Probing devices to guess BIOS drives. This may take a long time.
 * Grub has been installed to //boot successfully.
 * 
 * To interactively install grub files to another device such as a USB
 * stick, just run the following and specify the directory as prompted:
 *    emerge --config =grub-0.97-r10
 * Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell
 * grub where to install in a non-interactive way.
 * 
 * Automatically remounting /boot as ro
 * 
>>> sys-boot/grub-0.97-r10 merged.

[...]

sysresccd linux # mount
/dev/sda2 on / type ext4 (rw,noatime,discard)
/dev/sda1 on /boot type ext2 (ro,noatime)
Comment 2 SpanKY gentoo-dev 2012-07-24 15:46:15 UTC
grub-static and grub use the same exact /boot mount logic -- they simply call the eclass.  are you sure they behave the same ?
Comment 3 Roland Ramthun 2012-07-24 16:00:50 UTC
Well, both give the "Automatically remounting /boot as ro" message.

But grub remounted after installing the files into /boot while grub-static remounted it prior to installing the files and subsequently failed.
Comment 4 Roland Ramthun 2012-07-26 19:22:30 UTC
Today I installed Gentoo on a different second computer and had the exact same behaviour. Both systems were stable amd64 multilib systems and installed as described in the Gentoo AMD64 Handbook.
Comment 5 Mikle Kolyada archtester Gentoo Infrastructure gentoo-dev Security 2018-12-12 17:23:51 UTC
Masked for removal
Comment 6 Elmar Haag 2018-12-13 06:42:00 UTC
sys-boot/grub-static-0.97-r12 works perfect since many years on 24 boxes I look after, including some with RAID 5. 

No maintainence and no new feature needed that screw up a perfectly good and reliable application.

sys-boot/grub (Grub 2) is unreliable, overdesigned and complicated pile of dung to install and troubleshoot.
Comment 7 manwe 2018-12-14 16:53:31 UTC
+1 on that! Please don't remove grub-static.
Comment 8 Steffen Schaumburg 2018-12-20 00:24:39 UTC
If there's no further maintenance needed you can simply copy the ebuild to your local overlay - that takes less time than it takes to copy&paste a bugzilla message to a second bug. Of course if any maintenance is needed after all you'll have to perform that yourself.

Instructions: https://wiki.gentoo.org/wiki/Handbook:AMD64/Portage/CustomTree#Defining_a_custom_repository
Comment 9 Maik 2019-01-07 12:20:46 UTC
+1 do not remove grub-static.

If somebody needs new features -> grub2.
Grub works since many years on maybe 200+ servers without problems.
Comment 10 Mikle Kolyada archtester Gentoo Infrastructure gentoo-dev Security 2019-01-10 08:48:23 UTC
Gone