Why mounting /var from another patition fail?

Asked by Evren Yurtesen

I have a system which PXE boots and uses NFS root filesystem. Long story short, I have /dev/sda1 configured as ext4 and added the following line into /etc/fstab (in the nfs share)

/dev/sda1 /var ext4 defaults,noatime 0 1

I see that this does not get mounted at boot time. However, if I crate a folder 'localvar' on the nfs share, and change the line to

/dev/sda1 /localvar ext4 defaults,noatime 0 1

then it gets mounted at boot time just fine. I want to know why '/var' is behaving differently and how can this be fixed?

Thanks!

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Did you make the /var folder to mount to?

Revision history for this message
Evren Yurtesen (eyurtese-g) said :
#2

Yes, there is the whole original /var folder there. I followed the diskless boot instructions (more or less)
https://help.ubuntu.com/community/DisklessUbuntuHowto

Everything seems to work otherwise, but the machine just will not mount /var, specifically '/var'

After boot, I could execute 'mount -a' and it mounted /var . So I am not sure what stops it from mounting /var at boot. For now I had to make a workaround by making an init script with only 'mount -a' in it at start action, it seems to do the job.

I can try to investigate the issue further if you give some pointers at where to look? I tried to check dmesg, /var/log/syslog etc. and did not see anything like an error message for mounting '/var' it looked like it was skipped altogether.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Try adding:

mount -a

In /etc/rc.local above the 'exit 0' line

Revision history for this message
Evren Yurtesen (eyurtese-g) said :
#4

Actually, right now it seems to be working. I am not sure what I did (perhaps I had a typo in fstab?).

But I have a new problem... It looks like the mounting is done so late that rpc.statd is opening files in old /var before the mount. I am not sure exactly what is the reason for this but when I mount /var over this, the state becomes invisible (obviously) (it is the /var/lib/nfs/state file)

rpc.statd 464 statd cwd DIR 0,17 4096 3548547 /var/lib/nfs (192.168.100.252:/nfsroot)

Can you provide any workarounds to that?

Revision history for this message
Launchpad Janitor (janitor) said :
#5

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Evren Yurtesen (eyurtese-g) said :
#6

My problem about rpc.statd is still happening...

Revision history for this message
Launchpad Janitor (janitor) said :
#7

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Evren Yurtesen (eyurtese-g) said :
#8

No ideas on why it is startin so early?

Revision history for this message
Launchpad Janitor (janitor) said :
#9

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Evren Yurtesen (eyurtese-g) said :
#10

This keeps on expiring, will it ever be looked into?

Revision history for this message
Launchpad Janitor (janitor) said :
#11

This question was expired because it remained in the 'Open' state without activity for the last 15 days.