Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Minor awk error on boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Cutriss
n00b
n00b


Joined: 01 Feb 2006
Posts: 10

PostPosted: Wed Feb 01, 2006 5:05 pm    Post subject: Minor awk error on boot Reply with quote

Hopefully having a more permanent record of this error will net me a better response than on IRC.

I installed 2005.1 a couple weekends ago and have been slowly working on getting it configured on a Toshiba Tecra M4. I followed BobP's Stage 1/3 install guide and after struggling with several different issues, I finally have it mostly useable.

However, I have what appears to be a minor error on bootup whenever root is mounted. As I don't have the laptop in front of me ATM, I'm doing this from memory, but it was something like
Code:
awk: (FILENAME=/proc/mounts FNR=6) Error writing to standard output (Invalid argument)
It looks to me like root is being mounted ro, as that's what reiserfs reports on every boot.

Does anyone have any suggestions on what I can do to clear this error?
_________________
.
Back to top
View user's profile Send private message
Cutriss
n00b
n00b


Joined: 01 Feb 2006
Posts: 10

PostPosted: Thu Feb 02, 2006 5:30 pm    Post subject: Reply with quote

I believe the problem is in checkroot:
Code:
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
   before *
}

start() {
   local retval=0

   if [[ ! -f /fastboot && -z ${CDBOOT} ]] && ! is_net_fs / ; then
      if touch -c / >& /dev/null ; then
         ebegin "Remounting root filesystem read-only"
         mount -n -o remount,ro /
         eend $?
      fi

      if [[ -f /forcefsck ]] || get_bootparam "forcefsck" ; then
         ebegin "Checking root filesystem (full fsck forced)"
         fsck -C -a -f /
         # /forcefsck isn't deleted because checkfs needs it.
         # it'll be deleted in that script.
         retval=$?
      else
         # Obey the fs_passno setting for / (see fstab(5))
         # - find the / entry
         # - make sure we have 6 fields
         # - see if fs_passno is something other than 0
         if [[ -n $(awk '($1 ~ /^(\/|UUID|LABEL)/ && $2 == "/" \
                         && NF == 6 && $6 != 0) { print }' /etc/fstab) ]]
         then
            ebegin "Checking root filesystem"
            fsck -C -T -a /
            retval=$?
         else
            ebegin "Skipping root filesystem check (fstab's passno == 0)"
            retval=0
         fi
      fi

      if [[ ${retval} -eq 0 ]] ; then
         eend 0
      elif [[ ${retval} -eq 1 ]] ; then
         ewend 1 "Filesystem repaired"
      elif [[ ${retval} -eq 2 || ${retval} -eq 3 ]] ; then
         ewend 1 "Filesystem repaired, but reboot needed!"
         echo -ne "\a"; sleep 1; echo -ne "\a"; sleep 1
         echo -ne "\a"; sleep 1; echo -ne "\a"; sleep 1
         ewarn "Rebooting in 10 seconds ..."
         sleep 10
         einfo "Rebooting"
         /sbin/reboot -f
      else
         if [[ ${RC_FORCE_AUTO} == "yes" ]] ; then
            eend 2 "Rerunning fsck in force mode"
            fsck -y -C -T /
         else
            eend 2 "Filesystem couldn't be fixed :("
            /sbin/sulogin ${CONSOLE}
         fi
         einfo "Unmounting filesystems"
         /bin/mount -a -o remount,ro &> /dev/null
         einfo "Rebooting"
         /sbin/reboot -f
      fi
   fi

   # Should we mount root rw ?
   if mount -vf -o remount / 2> /dev/null | \
      awk '{ if ($6 ~ /rw/) exit 0; else exit 1; }'
   then
      ebegin "Remounting root filesystem read/write"
      mount -n -o remount,rw / &> /dev/null
      if [[ $? -ne 0 ]] ; then
         eend 2 "Root filesystem could not be mounted read/write :("
         if [[ ${RC_FORCE_AUTO} != "yes" ]] ; then
            /sbin/sulogin ${CONSOLE}
         fi
      else
         eend 0
      fi
   fi

   if [[ ${BOOT} == "yes" ]] ; then
      local x=
      local y=

      #
      # Create /etc/mtab
      #

      # Don't create mtab if /etc is readonly
      if ! touch /etc/mtab 2> /dev/null ; then
         ewarn "Skipping /etc/mtab initialization (ro root?)"
         return 0
      fi

      # Clear the existing mtab
      > /etc/mtab

      # Add the entry for / to mtab
      mount -f /

      # Don't list root more than once
      awk '$2 != "/" {print}' /proc/mounts >> /etc/mtab

      # Now make sure /etc/mtab have additional info (gid, etc) in there
      for x in $(awk '{ print $2 }' /proc/mounts | sort -u) ; do
         for y in $(awk '{ print $2 }' /etc/fstab) ; do
            if [[ ${x} == ${y} ]] ; then
               mount -f -o remount $x
               continue
            fi
         done
      done

      # Remove stale backups
      rm -f /etc/mtab~ /etc/mtab~~
   fi
}


# vim:ts=4
I think the problem is oriented around this particular block:
Code:
   # Should we mount root rw ?
   if mount -vf -o remount / 2> /dev/null | \
      awk '{ if ($6 ~ /rw/) exit 0; else exit 1; }'
   then
      ebegin "Remounting root filesystem read/write"
      mount -n -o remount,rw / &> /dev/null
      if [[ $? -ne 0 ]] ; then
         eend 2 "Root filesystem could not be mounted read/write :("
         if [[ ${RC_FORCE_AUTO} != "yes" ]] ; then
            /sbin/sulogin ${CONSOLE}
         fi
      else
         eend 0
      fi
   fi
...since I see the error reported at the same time that root is mounted.

Since I'm not familiar with awk syntax, is there something minorly wrong with this line that needs to be fixed?
_________________
.
Back to top
View user's profile Send private message
Cutriss
n00b
n00b


Joined: 01 Feb 2006
Posts: 10

PostPosted: Sat Feb 04, 2006 7:33 pm    Post subject: Reply with quote

Would this be better to post in a different forum?
_________________
.
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Sat Feb 04, 2006 7:50 pm    Post subject: Reply with quote

Moved from Installing Gentoo to Other Things Gentoo.
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
Cutriss
n00b
n00b


Joined: 01 Feb 2006
Posts: 10

PostPosted: Sat Feb 04, 2006 7:51 pm    Post subject: Reply with quote

Thanks nixnut. Hopefully this helps me out a bit better. ^^;
_________________
.
Back to top
View user's profile Send private message
Fat_DRagon
n00b
n00b


Joined: 02 Feb 2006
Posts: 1

PostPosted: Sat Feb 04, 2006 7:52 pm    Post subject: Reply with quote

I had this problem with my pc right before i upgraded
Back to top
View user's profile Send private message
luismanson
Tux's lil' helper
Tux's lil' helper


Joined: 04 Aug 2005
Posts: 123

PostPosted: Fri Dec 01, 2006 11:37 pm    Post subject: Reply with quote

Fat_DRagon wrote:
I had this problem with my pc right before i upgraded


i have the same problem here :S
amd64, with the clock fix on module dependencies...
upgraded on 11/27
Back to top
View user's profile Send private message
tranquilcool
Veteran
Veteran


Joined: 25 Mar 2005
Posts: 1179

PostPosted: Sun Dec 03, 2006 6:57 am    Post subject: Reply with quote

i have the same problem.

anybody?
_________________
this is a strange strange world.
Back to top
View user's profile Send private message
luismanson
Tux's lil' helper
Tux's lil' helper


Joined: 04 Aug 2005
Posts: 123

PostPosted: Wed Dec 06, 2006 4:02 am    Post subject: bug... Reply with quote

bug reported....

btw: i dont have internet on my home, so if anyone can be more specific on the bug page would be nice

see here: 157283
Back to top
View user's profile Send private message
BeanLord
n00b
n00b


Joined: 29 Nov 2007
Posts: 1

PostPosted: Thu Nov 29, 2007 6:10 pm    Post subject: Had the same problem, the fix (for me at least) was simple Reply with quote

I had the exact same warning upon boot, although the system seemed to run fine. An interesting side effect was my / filesystem being reported twice by df. One was listed as being /dev/root and the other as rootfs. My understanding is that is normal 'under the hood' but shouldn't be displayed by userland tools such as df. Anyhow the solution for me was as simple as remerging baselayout then rebooting. Both issues were resolved after that. This may or may not help others having the same problem but it's worth giving it a shot.

Update: After I originally posted this I decided to try something. I remembered that recently I'd been playing around with einit and thought maybe that had something to do with it. So I reboot the machine with einit then reboot again using SysV. While booting with SysV I got that message again and had the double / entry in df. Once again remerging baselayout then rebooting solved issue for me.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things 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