Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 11795 - freezes on "unmounting filesystems"
Summary: freezes on "unmounting filesystems"
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 All
: High major (vote)
Assignee: Martin Schlemmer (RETIRED)
Depends on:
Reported: 2002-12-08 15:19 UTC by David T. Yorke
Modified: 2003-02-04 19:42 UTC (History)
0 users

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

The script that freezed the system (OLDHALT.SH,3.74 KB, text/plain)
2002-12-08 15:20 UTC, David T. Yorke
The return of "cat /proc/mounts" (PROC.TXT,235 bytes, text/plain)
2002-12-08 15:21 UTC, David T. Yorke
my /etc/fstab (fstab,1.10 KB, application/octet-stream)
2002-12-14 14:47 UTC, David T. Yorke
Output of emerge info (emergeinfo.txt,1.19 KB, text/plain)
2002-12-15 19:25 UTC, David T. Yorke

Note You need to log in before you can comment on or make changes to this bug.
Description David T. Yorke 2002-12-08 15:19:22 UTC is freezing on function "unmounting filesystems ..." from what I have
figured out so far the command:
for x in $(awk '!/(^#|proc|devfs|tmpfs|^none|^\/dev\/root| \/ )/ {print $2}'
/proc/mounts |sort -r) 
is choking on the part of the regex that sys " \/ ".  It just hangs forever. 
Removing that part lets the awk finish but then  "/" gets retuned to the umount
function as part of the loop.  That sounds like a bad thing.

I'm using baselayout and gawk-3.1.1-r1 on an AMD IBM Aptiva 2158-530. 
Bug exists with or without devfs running.

I've marked this as a major bug because without commenting out these lines, I
can't shutdown or reboot normally.

I'll attach a copy of my /proc/mounts and the
Comment 1 David T. Yorke 2002-12-08 15:20:44 UTC
Created attachment 6311 [details]
The script that freezed the system
Comment 2 David T. Yorke 2002-12-08 15:21:43 UTC
Created attachment 6312 [details]
The return of "cat /proc/mounts"
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-10 13:00:25 UTC
Please include /etc/fstab.
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-10 13:44:38 UTC
If I run from command line:

nosferatu mozilla # awk
'!/(^#|^[[:space:]]*$|proc|devfs|tmpfs|^none|^\/dev\/root| \/ )/ {print $2}'
nosferatu mozilla # awk
'!/(^#|^[[:space:]]*$|proc|devfs|tmpfs|^none|^\/dev\/root)/ {print $2}' /tmp/mounts 
nosferatu mozilla # 

Which is wrong, as then / will be unmounted premacurely ...

Please include the same info as above.
Comment 5 David T. Yorke 2002-12-14 14:47:41 UTC
Created attachment 6502 [details]
my /etc/fstab

here is my fstab.  sorry it took so long to get back to you on this.
Comment 6 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-14 14:55:39 UTC
No problem.  This is a weird one ... does your gawk/awk work ... can you run
them from command line ?  Also, did you try a vanilla kernel yet ?
Comment 7 David T. Yorke 2002-12-14 17:06:04 UTC
I'm already running a vanilla-sources kernel and awk does work from the command
line,as I stated in my original post, it just chokes on the part of the awk
command that describes the root directory.
Comment 8 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-15 01:21:40 UTC
Err, problem is it is working fine for thousands of other users.  Also,
There is nothing wrong with that regex (syntax wise) ...
Comment 9 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-15 01:41:11 UTC
Please paste output of:

  # emerge info

Comment 10 David T. Yorke 2002-12-15 19:25:23 UTC
Created attachment 6531 [details]
Output of emerge info
Comment 11 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-15 20:21:56 UTC
Change your CFLAGS and CXXFLAGS to:

  CFLAGS="-march=k6-2 -O2 -pipe"
  CXXFLAGS="-march=k6-2 -O2 -pipe"

Remerge gawk, and see if that fixes it.
Comment 12 David T. Yorke 2002-12-15 21:25:05 UTC
how can i do that from the command line without messing with my make.conf?
Comment 13 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-15 22:13:51 UTC
 # CFLAGS="-march=k6-2 -O2 -pipe" CXXFLAGS="-march=k6-2 -O2 -pipe" emerge gawk
Comment 14 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-17 07:33:02 UTC
And ?

Comment 15 David T. Yorke 2002-12-17 19:58:14 UTC
Sorry for the delay. I remerged gawk with -O only and it runs OK, but ...

The plot thickens.  If i run what is in the script:
awk '!/(^#|proc|devfs|tmpfs|^none|^\/dev\/root| \/ )/ {print $2}'
/proc/mounts |sort -r

It outputs:

if I take out the space at the end of the " \/ " it outputs nothing.  Which is
the correct answer.

So ... it works almost.  Any other ideas/suggestions? Can that trailing space
come out?

Dave Yorke
Comment 16 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-17 22:25:08 UTC
nosferatu root # awk '!/(^#|proc|devfs|tmpfs|^none|^\/dev\/root| \/ )/ {print
$2}' /proc/mounts |sort -r
nosferatu root # 

It should actually list all local mounts except rootfs (/), and devfsd, proc,
etc ....

Maybe try it like so:

# awk '!/(^#|proc|devfs|tmpfs|^none|^\/dev\/root|[[:space:]]\/[[:space:]])/
{print $2}' /proc/mounts |sort -r
Comment 17 David T. Yorke 2002-12-17 22:42:42 UTC
In my case, with my system now anyway, I only have devfs, tmpfs,rootfs and proc.
 So it should come back blank.

Btw, you' sugggested code:
# awk '!/(^#|proc|devfs|tmpfs|^none|^\/dev\/root|[[:space:]]\/[[:space:]])/
{print $2}' /proc/mounts |sort -r

Returned nothing as it was supposed to.  Excellent. <<Twiddle fingers ala Monty

One question though, if the awk returns nothing will the for loop skip itself
because x = 0 or will it crash?  I'm only asking because I have very little
experience in shell programming.

David Yorke

Comment 18 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-18 01:40:50 UTC
It should not run the code in the for loop.  Great, ill tweak the code
in on cvs.
Comment 19 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-18 09:05:12 UTC
Try masked baselayout- please.
Comment 20 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-19 09:16:53 UTC
Open if still problems with