Greetings, I'm trying to emerge GRUB but every time I do so it marks my boot partition as read only (ro) and fails. Here is the result of "mount" before emerging grub:
Code: Select all
/dev/sda3 on / type ext3 (rw,noatime)
/dev/sda1 on /boot type ext2 (rw,noatime)
And the output from emerging grub:
Code: Select all
>>> Installing (1 of 1) sys-boot/grub-0.97-r10
*
* 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 ...
*
*
* Automatically remounting /boot as ro
*
mkdir: cannot create directory `//boot/grub': Read-only file system
* ERROR: sys-boot/grub-0.97-r10 failed:
* //boot/grub does not exist!
*
* Call stack:
* ebuild.sh, line 56: Called pkg_postinst
* environment, line 3940: Called setup_boot_dir '//boot'
* environment, line 4286: 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-0.97-r10',
* the complete build log and the output of 'emerge -pqv =sys-boot/grub-0.97-r10'.
* The complete build log is located at '/var/tmp/portage/sys-boot/grub-0.97-r10/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/sys-boot/grub-0.97-r10/temp/environment'.
* S: '/var/tmp/portage/sys-boot/grub-0.97-r10/work/grub-0.97'
!!! FAILED postinst: 1
>>> Recording sys-boot/grub in "world" favorites file...
* Messages for package sys-boot/grub-0.97-r10:
* Fallback PaX marking -m
* /var/tmp/portage/sys-boot/grub-0.97-r10/image//sbin/grub
*
* To avoid automounting and auto(un)installing with /boot,
* just export the DONT_MOUNT_BOOT variable.
*
* ERROR: sys-boot/grub-0.97-r10 failed:
* //boot/grub does not exist!
*
* Call stack:
* ebuild.sh, line 56: Called pkg_postinst
* environment, line 3940: Called setup_boot_dir '//boot'
* environment, line 4286: 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-0.97-r10',
* the complete build log and the output of 'emerge -pqv =sys-boot/grub-0.97-r10'.
* The complete build log is located at '/var/tmp/portage/sys-boot/grub-0.97-r10/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/sys-boot/grub-0.97-r10/temp/environment'.
* S: '/var/tmp/portage/sys-boot/grub-0.97-r10/work/grub-0.97'
>>> Auto-cleaning packages...
>>> No outdated packages were found on your system.
* Regenerating GNU info directory index...
* Processed 73 info files.
Afterwards I run mount again and see this:
Code: Select all
/dev/sda3 on / type ext3 (rw,noatime)
/dev/sda1 on /boot type ext2 (ro,noatime)
I know how to remount /boot as rw (mount -o remount,rw /boot). Should I just do that and try running with DONT_MOUNT_BOOT set? I'd be more comfortable knowing why grub is failing to install.
UPDATE: Figured this out, grub is finding a boot partition used by my live cd (SystemRescueCd 2.0.0, /livemnt/boot is the directory), noticing that it is read only, and then trying to make /boot rw and "restore" it to ro later.
Still not sure how to fix this, maybe run without the mounting step? Does anyone know of a guide that would tell me how to install grub with DONT_MOUNT_BOOT set?
The offending check in /eclass/mount-boot.eclass is the following:
Code: Select all
local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts | sed -n '/\/boot .*,ro,/p')
This fails, finding the wrong /boot.
UPDATE2: So here's what I've done so far:
1. After failure, remounted drive as rw:
2. Added DONT_MOUNT_BOOT=true to /etc/make.conf
3. Emerged grub again, no errors
4. Had to remount /boot as rw again:
5. Install grub
6. Select /boot when prompted for directory
Hoping this works, haven't booted yet.
thanks