varlock and varrun

Thomas Kaiser ubuntu at kaiser-linux.li
Tue Apr 17 07:42:47 UTC 2007


Christoph Pleger wrote:
> Hello,
>
> On Mon, 16 Apr 2007 21:35:43 +0200
> Nils Kassube <kassube at gmx.net> wrote:
>
>   
>>>> I generated a minimal edgy system by debootstrap, copied that
>>>> system to a machine with fresh formatted partitions and installed
>>>> a kernel and a bootloader. After rebooting, the machine did not
>>>> fully come up and I found out that the reason for that was that
>>>> /var/lock and /var/run had not been mounted. After some
>>>> investigation I found out that /var/lock and /var/run should be
>>>> mounted by S01mountkernfs.sh and I wonder how that is possible
>>>> when S35mountall.sh is run later, because the mountpoints
>>>> /var/lock and /var/run cannot be present before mounting /var,
>>>> what normally should be done by S35mountall.sh.
>>>>
>>>> In spite of that, after a normal CD-installation the machine boots
>>>> successfully. But I cannot find the significant difference between
>>>> a CD-installation and my debootstrap-installation.
>>>>
>>>> Does anybody know why mounting /var/lock and /var/run works ok
>>>> after installing from CD?
>>>>         
>>> Does really nobody here know how Ubuntu manages to mount /var/lock
>>> and /var/run before /var? In a user technical support list?
>>>       
>
>   
>> On my Dapper system:
>>
>> $ grep -l varrun /etc/init.d/*
>> /etc/init.d/mtab
>> $ ls -l /etc/rc*.d/*mtab
>> lrwxrwxrwx 1 root root 14 2007-02-21 22:24 /etc/rcS.d/S22mtab ->
>> ../init.d/mtab
>>
>> I.e. the script mtab is started before mountall.sh.
>>     
>
> Yes, and that I see as the problem where I wonder why it does not occur
> in a CD-installed Ubuntu system:
>
> /var/lock and /var/run are mounted in S01mountkernfs.sh (S22mtab only
> creates the entries in /etc/mtab, but does not mount anything, see "man
> mount" for the meaning of paramater -f), but /var is mounted in
> S35mountall.sh. So, directories /var/lock and /var/run are not present
> at the time when they are tried to be used as mountpoints. And even if
> they existed in the root filesystem /, they would be overwritten by
> mounting /var later.
>
> So, I still have no explanation how /var/lock and /var/run can be
> mounted successfully in a CD-installed system.
>
> Regards
>   Christoph
>
>   
Hi Christoph

When I check the mounted filesystems on my machine I don't see that /var 
is mounted:
thomas at LAPI01:~$ mount
/dev/sda2 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /media/sda1 type ntfs (rw,nls=utf8,umask=007,gid=46)
/dev/sda6 on /home type ext3 (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
thomas at LAPI01:~$

/var/run and /var/lock are directories in the filesystem and they are 
present when S01mountkernfs.sh is run and can be used as mount point. 
S01mountkernfs.sh will mount /var/run and /var/lock as tempfs.
And S35mountall.sh does not mount /var.

You may have to check if your kernel supports tempfs.

Hope this helps.

Thomas





More information about the ubuntu-users mailing list