Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 81181 - initscripts fail during boot because /var not mounted
Summary: initscripts fail during boot because /var not mounted
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: Highest major (vote)
Assignee: Gentoo's Team for Core System packages
Depends on:
Reported: 2005-02-07 17:11 UTC by Cheyenne Wills
Modified: 2005-02-09 21:21 UTC (History)
0 users

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

sep-var-boot.png (sep-var-boot.png,19.40 KB, image/png)
2005-02-09 19:05 UTC, SpanKY

Note You need to log in before you can comment on or make changes to this bug.
Description Cheyenne Wills 2005-02-07 17:11:15 UTC

Am running into a problem with the initscripts.  

I have /var defined in it's own partition.  

svcdir points to /var/lib/init.d

When rc is running, it tries to write into svcdir, but during boot localmount has not yet ran so /var has not been mounted, resulting in various errors (errors from ln, chkfs, etc.)

/var should probably be mounted in rc - sysinit
Comment 1 SpanKY gentoo-dev 2005-02-07 23:27:44 UTC
can you post the output somehow ?
did previous 1.11.x versions work ?

if you read /sbin/rc you'll see that /var is supposed to be mounted before $svcdir is utilized
Comment 2 Cheyenne Wills 2005-02-08 06:36:12 UTC
2nd question first -- yes this did work with older versions.

1st question hmm -- since /var/log is not yet mounted, I don't have a log. Let me see if I can play around and try to capture something.  Won't be till late this evening however.

One possible solution is during rc (sysinit) processing, is to see if /var is in the fstab and do the checkfs/mount for it explicitly there.  In fact, it might be a good idea to have a list of the different "critical" directories that are needed by rc and have them checked and mounted in rc (sysinit).
Comment 3 Cheyenne Wills 2005-02-08 06:44:58 UTC
Just took a look at something...

mkdir /tmp/fooroot
I did a mount --bind -o ro / /tmp/fooroot

and there was /tmp/fooroot/var/lib/init.d/... directory structure

So... I think in addition part of the problem is:

In checkroot, root gets mounted read only (and it looks like there is a path out of there were root could be left readonly)

In addition /var directory that is part of the physical "root" partition gets replaced by the /var partition when it is mounted.

Lots of twisty little passages.  

I will try to play around this evening
Comment 4 SpanKY gentoo-dev 2005-02-09 19:05:38 UTC
Created attachment 50882 [details]

ok, i'm unable to reproduce here ... this is my setup:

/dev/hda   /	ext2  0 1
/dev/hdb   /var ext2  0 2

my / has a completely blank /var/, so there's no way for that to be an issue

bootup with baselayout-1.11.9-r1 is exactly as expected, see the attached
screen shot of qemu test env
Comment 5 Cheyenne Wills 2005-02-09 21:04:59 UTC
Did the following:

   mount --bind / /mnt/fixroot
   cd /mnt/fixroot/var
   rm -r *         # Clean out everything on the root partition var directory
   cd /
   umount /mnt/fixroot

I was still having problems..

changed /etc/conf.d/rc to set svcdir to /etc/runlib and to mount a tmpfs for it.

Was still having problems

After doing quite abit of tracing, I was able to finally track down that I had a "stray" entry in fstab for 
   none /devfs /dev

-- I am using udev

So What I think was happening was that when rc hit localmount, it mounted /devfs on /dev and screwing up what udev had set up.

removing the /devfs entry from fstab cleared up the boot problem.

I suspect that earlier versions of baselayout either masked the problem, or I was just getting lucky.

I am going to check one last thing.. I'm going to remove the svcdir mount statement.  I suspect that in the root partition I will find the svcdir data there.
Comment 6 Cheyenne Wills 2005-02-09 21:12:47 UTC
did the change -- root partition var directory still clean..

So.. looks like I had a config problem that was masked by the earlier versions of baselayout.

Sorry for the wild goose chase..
Comment 7 Cheyenne Wills 2005-02-09 21:21:00 UTC
Closing as user configuration error