Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

uClinux mounting problem

Hi all,

I got problem when trying to mount a Linux PC to a local folder of Cyclone (/var) .

Here are the steps performed :

(the kit I'm using is cyclone 1c12 eval edition)

1) Log in uClinux on Cyclone

2) Setup an IP for the Cyclone : ifconfig eth0 192.168.1.20 netmask 255.255.255.0

3) Setup the IP for the Linux PC (Assuming : 192.168.1.19)

4) In Linux PC , Setup NFS shares by opening file /etc/exports (under ROOT) and add the following command :

/home/mymnt 192.168.1.20(rw)

5) Start NFS server : $ /etc/init.d/nfs start

6) Mount the Linux PC : mount –t –n nfs 192.168.1.19:/home/mymnt /var

After completing 6) , the following error occurred :

can't create lock file /etc/mtab~25: read-only file system (use -n flag to override)

I think the cause of the error is /etc folder (on cyclone) is READ-ONLY , so , uClinux cannot create mtab~25 on it. How can I "forward" the creation of mtab~25 to a writable folder such as /var , /usr ?

Thanks,

OneNet

9 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi OneNet,

    Add an empty file: /etc/mtab to your file system -- then try again -- this was all I needed.

    Regards,

    --Scott
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Scott,

    As I mentioned , the folder /etc on Cycloneis READ-ONLY.

    (mtab~25 is created at runtime)

    Thank you so much,

    OneNet
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    As the mount command told you: add the -n flag to your mount command. That way it doesn't try to write to the /etc/mtab file but mounts anyway.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Onenet,

    > As I mentioned , the folder /etc on Cycloneis READ-ONLY.

    And as I mentioned, adding /etc/mtab to the filesystem worked for me. The problem

    I observed was related to locking /etc/mtab. The fact that the filesystem

    was readonly was irrelevant.

    Regards,

    --Scott
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi wqoossens ,

    I already used -n flag in the above commands.

    Regards,

    OneNet
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Scott ,

    I added mtab and fstab to /etc of the Cyclone uClinux filesystem (I added fstab since if I I had added mtab ONLY , uClinux would have asked me for fstab)

    Here are the contents of both mtab and fstab :

    portmap:192.168.1.19

    lockd:192.168.1.19

    rquotad:192.168.1.19

    mountd:192.168.1.19

    statd:192.168.1.19

    where 192.168.1.19 is the IP of Linux PC

    I think these files set the connection TO the Linux PC we want to mount. (?????)

    Also , I have added a step :

    4a) In Linux PC , open /etc/hosts.allow as ROOT and add the following to the file :

    portmap:192.168.1.20

    lockd:192.168.1.20

    mountd:192.168.1.20

    statd:192.168.1.20

    where 192.168.1.20 is the Cyclone IP

    (the content of hosts.allow accepts the connection from the machines in the list)

    At step 6), run the command :

    mount 192.168.1.19:/home/mymnt /var

    The following error occurred :

    mount: rpc: port mapper failure - rpc: unable to receive

    About this error , I thaught that I "opened" connection between Linux PC (/etc/hosts.allow) and Cyclone (fstab , mtab). Do I have a lack of some step ?

    What do you think ?

    OneNet
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Onenet,

    > By the way , do you know how to bring in the portmapper from the uCLinux CVS

    Use CVS to checkout the portmap code from the CVS repository.

    Regards,

    --Scott