Skip to contentSkip to conversation

Can't mount nfs rw

DISCUSSION Nicholas Lafferty 2 participants 5 messages Sep 4, 2002 – Sep 6, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I'm having problems getting my diskless clients to mount NFS directories in Read-Write mode. I'm using bpbatch and tftp to transfer the kernel and a ramdisk for the root file system. I pass an initscript to the kernel that mounts the root file system of the server as read-only (mounts on /ro), /home/guest/share mounts as ro2 (read-only), and /home/guest/01 mounts as /rw (read-write). Then init is invoked. The problem is that all of the mounts are read-only.

#Here is what my initscript does for the mounts.
mount-t nfs -o nolock,ro,vers=2 $SERVER:/ /ro
mount-t nfs -o nolock,ro,vers=2 $SERVER:/home/guest/share /ro2
mount-t nfs -o nolock,rw,vers=2 $SERVER:/home/guest/$ID /rw

/sbin/init '#'

# Here is my /etc/exports
/
192.168.0.0/255.255.255.0(ro,no_root_squash)
/home/guest/share 192.168.0.0(ro,no_root,squash)

/home/guest/01            192.168.0.0(rw,no_root_squash)
/home/guest/02            192.168.0.0(rw,no_root_squash)
/home/guest/03            192.168.0.0(rw,no_root_squash)

Any suggestions on some other things to try?

Nicholas Lafferty
Manager
Pennswoods.net
Country Club Mall

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#1 lore raw
Quoted 19 lines · On Wednesday September 4, [email protected] wrote:

I'm having problems getting my diskless clients to mount NFS directories in Read-Write mode. I'm using bpbatch and tftp to transfer the kernel and a ramdisk for the root file system. I pass an initscript to the kernel that mounts the root file system of the server as read-only (mounts on /ro), /home/guest/share mounts as ro2 (read-only), and /home/guest/01 mounts as /rw (read-write). Then init is invoked. The problem is that all of the mounts are read-only.

#Here is what my initscript does for the mounts.
mount-t nfs -o nolock,ro,vers=2 $SERVER:/ /ro
mount-t nfs -o nolock,ro,vers=2 $SERVER:/home/guest/share /ro2
mount-t nfs -o nolock,rw,vers=2 $SERVER:/home/guest/$ID /rw

/sbin/init '#'

# Here is my /etc/exports
/
192.168.0.0/255.255.255.0(ro,no_root_squash)
/home/guest/share 192.168.0.0(ro,no_root,squash)

Quoted 6 lines
/home/guest/01            192.168.0.0(rw,no_root_squash)
/home/guest/02            192.168.0.0(rw,no_root_squash)
/home/guest/03            192.168.0.0(rw,no_root_squash)

Any suggestions on some other things to try?

perl -i -p -e 's,192.168.0.0\(,192.168.0.0/255.255.255.0\(,' /etc/exports

NeilBrown

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#2 lore raw

I'm not quite sure I know your perlf00. What does : perl -i -p -e
's,192.168.0.0\(,192.168.0.0/255.255.255.0\(,' /etc/exports actually do? I issue the command and it just hangs. Does it change my exports file in some way?

Thanks,

Nick

----- Original Message -----
From: "Neil Brown" <[email protected]>
To: "Nicholas Lafferty" <[email protected]>
Cc: "nfs" <[email protected]>
Sent: Wednesday, September 04, 2002 10:34 PM
Subject: Re: [NFS] Can't mount nfs rw

Quoted 2 lines · On Wednesday September 4, [email protected] wrote:
Quoted 1 line

I'm having problems getting my diskless clients to mount NFS directories

in

Quoted 2 lines
Quoted 2 lines

Read-Write mode. I'm using bpbatch and tftp to transfer the kernel and a ramdisk for the root file system. I pass an initscript to the kernel

that

Quoted 2 lines
Quoted 2 lines

mounts the root file system of the server as read-only (mounts on /ro), /home/guest/share mounts as ro2 (read-only), and /home/guest/01 mounts

as

Quoted 27 lines
Quoted 14 lines

/rw (read-write). Then init is invoked. The problem is that all of the mounts are read-only.

#Here is what my initscript does for the mounts.
mount-t nfs -o nolock,ro,vers=2 $SERVER:/ /ro
mount-t nfs -o nolock,ro,vers=2 $SERVER:/home/guest/share /ro2
mount-t nfs -o nolock,rw,vers=2 $SERVER:/home/guest/$ID /rw

/sbin/init '#'

# Here is my /etc/exports
/
192.168.0.0/255.255.255.0(ro,no_root_squash)
/home/guest/share 192.168.0.0(ro,no_root,squash)

Quoted 6 lines
/home/guest/01            192.168.0.0(rw,no_root_squash)
/home/guest/02            192.168.0.0(rw,no_root_squash)
/home/guest/03            192.168.0.0(rw,no_root_squash)

Any suggestions on some other things to try?

perl -i -p -e 's,192.168.0.0\(,192.168.0.0/255.255.255.0\(,' /etc/exports

NeilBrown

Quoted 7 lines

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#3 lore raw
Quoted 4 lines · On Thursday September 5, [email protected] wrote:

I'm not quite sure I know your perlf00. What does : perl -i -p -e
's,192.168.0.0\(,192.168.0.0/255.255.255.0\(,' /etc/exports actually do? I issue the command and it just hangs. Does it change my exports file in some way?

Hmmm. The command worked for me.
It uses perl to do an in-place (-i) edit of /etc/exports which changes every
192.160.0.0(
to
192.160.0.0/255.255.255.0(

Producing
/ 192.168.0.0/255.255.255.0(ro,no_root_squash)
/home/guest/share 192.168.0.0/255.255.255.0(ro,no_root,squash)

/home/guest/01            192.168.0.0/255.255.255.0(rw,no_root_squash)
/home/guest/02            192.168.0.0/255.255.255.0(rw,no_root_squash)
/home/guest/03            192.168.0.0/255.255.255.0(rw,no_root_squash)

As it was, the only filesystem that was exported to 192.168.*.* was /, and it was exported read-only, just as you reported.

Note: this will only work if /home/guest/* are on a different filesystem to /. If they are on the same filesystem, you may as well just export '/' rw.

NeilBrown

Quoted 14 lines

Thanks,

Nick

----- Original Message -----
From: "Neil Brown" <[email protected]>
To: "Nicholas Lafferty" <[email protected]>
Cc: "nfs" <[email protected]>
Sent: Wednesday, September 04, 2002 10:34 PM
Subject: Re: [NFS] Can't mount nfs rw

Quoted 1 line · On Wednesday September 4, [email protected] wrote:
Quoted 42 lines
Quoted 1 line
Quoted 1 line

I'm having problems getting my diskless clients to mount NFS directories

in

Quoted 2 lines
Quoted 2 lines

Read-Write mode. I'm using bpbatch and tftp to transfer the kernel and a ramdisk for the root file system. I pass an initscript to the kernel

that

Quoted 2 lines
Quoted 2 lines

mounts the root file system of the server as read-only (mounts on /ro), /home/guest/share mounts as ro2 (read-only), and /home/guest/01 mounts

as

Quoted 34 lines
Quoted 14 lines

/rw (read-write). Then init is invoked. The problem is that all of the mounts are read-only.

#Here is what my initscript does for the mounts.
mount-t nfs -o nolock,ro,vers=2 $SERVER:/ /ro
mount-t nfs -o nolock,ro,vers=2 $SERVER:/home/guest/share /ro2
mount-t nfs -o nolock,rw,vers=2 $SERVER:/home/guest/$ID /rw

/sbin/init '#'

# Here is my /etc/exports
/
192.168.0.0/255.255.255.0(ro,no_root_squash)
/home/guest/share 192.168.0.0(ro,no_root,squash)

Quoted 6 lines
/home/guest/01            192.168.0.0(rw,no_root_squash)
/home/guest/02            192.168.0.0(rw,no_root_squash)
/home/guest/03            192.168.0.0(rw,no_root_squash)

Any suggestions on some other things to try?

perl -i -p -e 's,192.168.0.0\(,192.168.0.0/255.255.255.0\(,' /etc/exports

NeilBrown

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#4 lore raw

Unfortunaly they are on the same filesystem. I'm mounting / as /ro on the client and symlinking to the need directories. I changed / to export as rw and then I remount / onto /ro as ro after the system boots. Does that sound like a safe workaround?

Thanks,
Nick

----- Original Message -----
From: "Neil Brown" <[email protected]>
To: "Nicholas Lafferty" <[email protected]>
Cc: "nfs" <[email protected]>
Sent: Thursday, September 05, 2002 8:24 PM
Subject: Re: [NFS] Can't mount nfs rw

Quoted 3 lines · On Thursday September 5, [email protected] wrote:
Quoted 2 lines

I'm not quite sure I know your perlf00. What does : perl -i -p -e
's,192.168.0.0\(,192.168.0.0/255.255.255.0\(,' /etc/exports actually

do? I

Quoted 1 line
Quoted 1 line

issue the command and it just hangs. Does it change my exports file in

some

Quoted 17 lines
Quoted 1 line

way?

Hmmm. The command worked for me.
It uses perl to do an in-place (-i) edit of /etc/exports which changes every
192.160.0.0(
to
192.160.0.0/255.255.255.0(

Producing
/ 192.168.0.0/255.255.255.0(ro,no_root_squash)
/home/guest/share 192.168.0.0/255.255.255.0(ro,no_root,squash)

/home/guest/01            192.168.0.0/255.255.255.0(rw,no_root_squash)
/home/guest/02            192.168.0.0/255.255.255.0(rw,no_root_squash)
/home/guest/03            192.168.0.0/255.255.255.0(rw,no_root_squash)
Quoted 24 lines

As it was, the only filesystem that was exported to 192.168.*.* was /, and it was exported read-only, just as you reported.

Note: this will only work if /home/guest/* are on a different filesystem to /. If they are on the same filesystem, you may as well just export '/' rw.

NeilBrown

Quoted 15 lines

Thanks,

Nick

----- Original Message -----
From: "Neil Brown" <[email protected]>
To: "Nicholas Lafferty" <[email protected]>
Cc: "nfs" <[email protected]>
Sent: Wednesday, September 04, 2002 10:34 PM
Subject: Re: [NFS] Can't mount nfs rw

Quoted 2 lines · On Wednesday September 4, [email protected] wrote:
Quoted 1 line

I'm having problems getting my diskless clients to mount NFS

directories

Quoted 2 lines
Quoted 2 lines

in

Quoted 1 line
Quoted 1 line

Read-Write mode. I'm using bpbatch and tftp to transfer the kernel

and a

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line

ramdisk for the root file system. I pass an initscript to the kernel

that

Quoted 1 line
Quoted 1 line

mounts the root file system of the server as read-only (mounts on

/ro),

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

/home/guest/share mounts as ro2 (read-only), and /home/guest/01

mounts

Quoted 2 lines
Quoted 2 lines

as

Quoted 1 line
Quoted 1 line

/rw (read-write). Then init is invoked. The problem is that all of

the

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines

mounts are read-only.

#Here is what my initscript does for the mounts.
mount-t nfs -o nolock,ro,vers=2 $SERVER:/ /ro
mount-t nfs -o nolock,ro,vers=2 $SERVER:/home/guest/share /ro2
mount-t nfs -o nolock,rw,vers=2 $SERVER:/home/guest/$ID /rw

/sbin/init '#'

# Here is my /etc/exports
/
192.168.0.0/255.255.255.0(ro,no_root_squash)
/home/guest/share 192.168.0.0(ro,no_root,squash)

/home/guest/01            192.168.0.0(rw,no_root_squash)
/home/guest/02            192.168.0.0(rw,no_root_squash)
/home/guest/03            192.168.0.0(rw,no_root_squash)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

Any suggestions on some other things to try?

perl -i -p -e 's,192.168.0.0\(,192.168.0.0/255.255.255.0\(,'

/etc/exports

Quoted 13 lines
Quoted 11 lines
Quoted 11 lines

NeilBrown

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

Quoted 7 lines

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs