Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
is /boot supposed to be remounted as ro in chroot env?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 423
Location: Tokyo

PostPosted: Thu Jun 13, 2013 7:06 pm    Post subject: is /boot supposed to be remounted as ro in chroot env? Reply with quote

Really can't figure this one out. I threw my hands up and started over on a build.
It's 4AM so I need to sleep, but the same thing seems to have happened again.

Output before chroot
Code:

root@sysresccd /root % mount |grep sd
/dev/sda4 on /mnt/gentoo type ext4 (rw)
/dev/sda1 on /mnt/gentoo/boot type ext2 (rw)


When I chroot in, these mounts don't show up. I believe that's fine and dandy, but once I install grub, /boot is remounted as ro. So, for starters, I can't edit the grub.conf file. I can easily umount and mount, but doing this gave way to a rather large problem. Not sure if the two are related. It's the DEVTMPFS=y is not set. That seems to have plagued a lot of people, but this is a fresh install.

W/ my last attempt, it seemed no matter what I did to the kernel, DEVTMPFS always showed up as not set. Thought it might be mounting some other partition and having it parading around as the one I knew. Rebuilding the kernel now to put it in, and it looks like it's rebuilding all the objects from scratch. Irksome, to say the least.

EDIT: Yep, it's a turd.

If I run emerge grub, it mounts /boot as ro. Can't run grub-install after that. I can remount it as rw, but then I get something like this.

Code:

# grub-install --no-floppy /dev/sda
The file /boot/grub/stage1 not read correctly.


Ideas?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 6431
Location: Goose Creek SC

PostPosted: Thu Jun 13, 2013 7:24 pm    Post subject: Reply with quote

before entering the change root be absolutely sure that /mnt/gentoo has the intended root partition mounted, that the intended root partition contains an empty /mnt/gentoo/boot directory, that the boot partition is then mounted at /mnt/gentoo/boot: nominally:
Code:
mount /dev/sda3 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sdb1 /mnt/gentoo/boot


check that /etc/fstab entry for /boot does not specify ro; best if it says default,noauto or defaults
Code:
mount -o remount,rw /boot
to go to rw

setup grub manually:
Code:
grub
find /boot/grub/stage1
will return in the format (hdx,y) substitute the returned values in the following
Code:
root (hdx,y)
setup (hdx)
quit
this will setup the MBR of the drive with gentoo installed
if BIOS uses the gentoo drive as primary boot drive, grub wiil appear upon reboot
if grub.conf specifies root (hd0,0) and the boot partition is the first partition on the drive the the grub menu should appear immediately after.

to use grub-install you needed to run
Code:
grep -v rootfs /proc/mounts > /etc/mtab
first and then hope it guesses right
_________________
Defund the FCC.
Back to top
View user's profile Send private message
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 423
Location: Tokyo

PostPosted: Fri Jun 14, 2013 1:08 am    Post subject: Reply with quote

Grub will not read /mnt/grub/stage1
I've confirmed the file resides there. Grub says it doesn't though.

I tried LILO just to see, and I'm getting the same scenario. I followed the handbook... when I get to /sbin/lilo, I have the following mounts

Code:

/dev/sda4 on / type ext4 (rw,relatime,data=ordered)
/dev/sda1 on /boot type ext2 (ro,noatime)


These are the mounts before chroot'ing

Code:

root@sysresccd /root % mount |grep sd
/dev/sda4 on /mnt/gentoo type ext4 (rw)
/dev/sda1 on /mnt/gentoo/boot type ext2 (rw)
Back to top
View user's profile Send private message
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 423
Location: Tokyo

PostPosted: Fri Jun 14, 2013 1:16 am    Post subject: Reply with quote

If I unmount and remount (rw) /boot, then run /sbin/lilo, it seems to work. I have a bootable system. So as long as I can put up w/ lilo's ugly screen and it moaning about a bad video mode, I should be fine. This machine won't have X, so what do I care?

Now to figure out why my NIC isn't working.
Thanks for the help -- I am interested in knowing the root of the problem though.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 6431
Location: Goose Creek SC

PostPosted: Fri Jun 14, 2013 1:57 am    Post subject: Reply with quote

Quote:
Grub will not read /mnt/grub/stage1
because it should be reading /boot/grub/stage1 :) grub was right
_________________
Defund the FCC.
Back to top
View user's profile Send private message
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 423
Location: Tokyo

PostPosted: Fri Jun 14, 2013 2:15 am    Post subject: Reply with quote

DONAHUE wrote:
Quote:
Grub will not read /mnt/grub/stage1
because it should be reading /boot/grub/stage1 :) grub was right


Oops -- although I tink that was a typo here only.
There's definitely some weird stuff going on. LILO will boot, but every time I go to /usr/src/linux, make changes, and compile, it basically makes the same #(#%ing kernel. That's to say, cksum returns the same value for arch/x86_64/boot/bzImage as /boot/3.8.13-gentoo. :-/

Been using gentoo for 10 years... and am seriously considering Ubuntu, even though I hate it.
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 2278
Location: UK

PostPosted: Fri Jun 14, 2013 2:54 am    Post subject: Reply with quote

Try making /etc/mtab a symlink to /proc/self/mounts if it isn't already. The static file tends to get out of sync very easily when chroots are involved (i.e. `mount` outputs wrong info)
Back to top
View user's profile Send private message
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 423
Location: Tokyo

PostPosted: Fri Jun 14, 2013 3:01 am    Post subject: Reply with quote

Starting from scratch. This machine is obviously very, very cocked up.

Code:

# ls -l /boot/grub/stage1
-rw-r--r-- 1 root root 512 Jun 14 20:58 /boot/grub/stage1


Code:

# grub-install --no-floppy /dev/sda
The file /boot/grub/stage1 not read correctly.


Manually configuring grub (as shown above) does not work either.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 6431
Location: Goose Creek SC

PostPosted: Fri Jun 14, 2013 3:06 am    Post subject: Reply with quote

have you looked at /etc/fstab?
boot gentoo, run
Code:
mount /boot
then run
Code:
mount
and
Code:
df -h
see if the three are consistent and sensible

NIC troubles may be related to udev renaming the interfaces; run
Code:
ifconfig -a

if interface names are weird, en3lps0 instead of eth0 kind of weird, you can adapt to it by search and replace or
Code:
touch /etc/udev/rules.d/80-net-name-slot.rules
to create a blank file that udev will understand to mean leave the kernel nic names alone

edit: we cross posted
_________________
Defund the FCC.
Back to top
View user's profile Send private message
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 423
Location: Tokyo

PostPosted: Fri Jun 14, 2013 5:38 am    Post subject: Reply with quote

I think I have whatever funk my boot partition was in solved, but I still have an issue w/ the NIC. I assumed the kernel(s) were not being copied to whatever Grub or LILO was booting from, as I continually got the same error. What has happened on this fresh build.

1) Compiled kernel
2) Rebooted, got moaning about DEVTMPFS not being present
3) Rebuilt kernel w/ DEVTMPFS and copied to /boot
4) Rebooted -- no DEVTMPFS error, but eth0 is not present.

I ran lspci from the sysrescuecd and it shows it's using kernel modeul -r8169. .config has CONFIG_R8169=y. :-/ Still won't create eth0.

Frustrating. Thinking about the test version of gentoo-sources to spice things up.

EDIT: Here's the other weird thing. In my kernel, I had all Realtek devices set to *. I removed them all except r8169. Rebuilt and ran chksum on bzImage versus the old one. Same damn thing. That can't be good, can it? .config and .config.old have differences.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 6431
Location: Goose Creek SC

PostPosted: Fri Jun 14, 2013 5:46 am    Post subject: Reply with quote

NIC troubles may be related to udev renaming the interfaces; run

Code:
ifconfig -a


if interface names are weird, en3lps0 instead of eth0 kind of weird, you can adapt to it by search and replace or

Code:
touch /etc/udev/rules.d/80-net-name-slot.rules

to create a blank file that udev will understand to mean leave the kernel nic names alone. then reboot.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 423
Location: Tokyo

PostPosted: Fri Jun 14, 2013 7:23 am    Post subject: Reply with quote

DONAHUE wrote:
NIC troubles may be related to udev renaming the interfaces; run

Code:
ifconfig -a


if interface names are weird, en3lps0 instead of eth0 kind of weird, you can adapt to it by search and replace or

Code:
touch /etc/udev/rules.d/80-net-name-slot.rules

to create a blank file that udev will understand to mean leave the kernel nic names alone. then reboot.


I came back in here to say that was my problem. Dug around Google and here for quite a while, looking for such a one-lined solution. You're a rock star.
How do I send you a beer through the internet?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 6431
Location: Goose Creek SC

PostPosted: Fri Jun 14, 2013 1:46 pm    Post subject: Reply with quote

dos equis in hand

eselect news read all provides a tortured nearly incomprehensible explanation about udev. using touch is someone else's idea; I was making a blank file the hard way until I saw the touch line and admired it
_________________
Defund the FCC.
Back to top
View user's profile Send private message
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 423
Location: Tokyo

PostPosted: Sat Jun 15, 2013 7:47 am    Post subject: Reply with quote

I'm a huge fan of touching!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum