Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 169075 - util-linux's `mount -at nfs` misbehaves wrt to read only/write options
Summary: util-linux's `mount -at nfs` misbehaves wrt to read only/write options
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-03 02:28 UTC by Fab
Modified: 2008-03-29 21:34 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fab 2007-03-03 02:28:49 UTC
Hi,

I found a strange problem with the netmount script provided by baselayout.
If I mount the exported directory manually, it is mounted with read-write access, as requested by the configuration.
But if I mount it with the netmount script, the directory is readonly.

Is this a bug or did I miss something ? Thanks.

Server and client : gentoo-sources-2.6.19-r5 - nfs-utils-1.0.10
Baselayout 1.12.9 on client







On the server :
------------
/etc/exports :
/data/partage 192.168.2.85(sync,no_root_squash,rw,no_subtree_check)

# exportfs -v | grep partage
/data/partage   192.168.2.85(rw,wdelay,no_root_squash,no_subtree_check,anonuid=65534,anongid=65534)







On the client :
------------
/etc/fstab :
192.168.2.78:/data/partage    /data/partage           nfs             defaults,rw,sync,hard,intr              0 0



# /etc/init.d/netmount start
 * Mounting network filesystems ...    [ ok ]

# LC_ALL="C" touch /data/partage/aaa
touch: cannot touch `/data/partage/aaa': Read-only file system

# grep partage /proc/mounts
192.168.2.78:/data/partage /data/partage nfs ro,sync,vers=3,rsize=32768,wsize=32768,hard,intr,proto=udp,timeo=7,retrans=3,sec=sys,addr=192.168.2.78 0 0

# /etc/init.d/netmount stop
 * Unmounting network filesystems ...   [ ok ]

# mount -v /data/partage
192.168.2.78:/data/partage on /data/partage type nfs (rw,sync,hard,intr,addr=192.168.2.78)

# grep partage /proc/mounts
192.168.2.78:/data/partage /data/partage nfs rw,sync,vers=3,rsize=32768,wsize=32768,hard,intr,proto=udp,timeo=7,retrans=3,sec=sys,addr=192.168.2.78 0 0

# touch /data/partage/aaa

# ls -l /data/partage/aaa
-rw-r--r-- 1 root root 0 mar  3  2007 /data/partage/aaa










# emerge --info (client)
Portage 2.1.2-r9 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.19-gentoo-r5 i686)
=================================================================
System uname: 2.6.19-gentoo-r5 i686 AMD Sempron(tm) 2200+
Gentoo Base System release 1.12.9
Timestamp of tree: Fri, 02 Mar 2007 08:50:01 +0000
ccache version 2.4 [disabled]
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=athlon-xp -pipe"
DISTDIR="/distpack/distfiles"
FEATURES="autoconfig buildpkg distlocks metadata-transfer parallel-fetch sandbox sfperms strict userfetch userpriv usersandbox"
GENTOO_MIRRORS="ftp://mirror.ovh.net/gentoo-distfiles/ ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"
LANG="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"
LINGUAS="fr"
MAKEOPTS="-j2"
PKGDIR="/distpack/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/gentrees/portage"
PORTDIR_OVERLAY="/var/gentrees/overlay-perso"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X aac alsa berkdb bitmap-fonts bzip2 cairo cdr cli cracklib crypt cups curl dbus dri dts dvd dvdr dvdread emboss encode fam firefox fortran gdbm gif gnome gpm gstreamer gtk hal iconv isdnlog java jpeg ldap libg++ mad midi mikmod mmx mmxext mp3 mpeg ncurses nls nptl nptlonly nsplugin ogg opengl oss pam pcre perl png ppds pppd python quicktime readline reflection sdl session spell spl sse ssl tcpd truetype truetype-fonts type1-fonts unicode usb userlocales vorbis win32codecs x86 xml xorg xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" USERLAND="GNU" VIDEO_CARDS="sis nvidia nv"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS




Reproducible: Always
Comment 1 SpanKY gentoo-dev 2007-03-03 03:05:00 UTC
the netmount script merely runs `mount`

try doing:
umount /data/partage
mount -at nfs
Comment 2 Fab 2007-03-03 09:10:25 UTC
ok, the problem doesn't seems to be with the netmount script, but simply with mount : in fact I export several directories from /data in readonly before this one, and mount doesn't seems to read the fstab correctly.
Look at this : if I mount one directory in readonly before /data/partage, /data/partage will be in readonly :
==> mount -at nfs gives the same issue.


# mount -v /data/partage
192.168.2.78:/data/partage on /data/partage type nfs (rw,hard,intr,addr=192.168.2.78)
# touch /data/partage/aaa
# umount /data/partage


# mount -v /data/musique
192.168.2.78:/data/Musique on /data/musique type nfs (ro,hard,intr,addr=192.168.2.78)

# mount -v /data/partage
192.168.2.78:/data/partage on /data/partage type nfs (rw,hard,intr,addr=192.168.2.78)

# LC_ALL=C touch /data/partage/aaa
touch: cannot touch `/data/partage/aaa': Read-only file system



/etc/fstab :
------------
192.168.2.78:/data/Jeux    /data/jeux      nfs     ro,hard,intr   0 0
192.168.2.78:/data/Musique /data/musique   nfs     ro,hard,intr   0 0
192.168.2.78:/data/photos  /data/photos    nfs     ro,hard,intr   0 0
192.168.2.78:/data/partage /data/partage   nfs     rw,hard,intr   0 0
Comment 3 Fab 2007-03-03 09:31:41 UTC
If i modify the fstab like following (/data/partage before others), it works, but the others seem to be mounted in rw in /proc/mounts, but they are in readonly.


/etc/fstab :
------------
192.168.2.78:/data/partage /data/partage   nfs     rw,hard,intr   0 0
192.168.2.78:/data/Jeux    /data/jeux      nfs     ro,hard,intr   0 0
192.168.2.78:/data/Musique /data/musique   nfs     ro,hard,intr   0 0
192.168.2.78:/data/photos  /data/photos    nfs     ro,hard,intr   0 0


# mount -at nfs

# grep data /proc/mounts
192.168.2.78:/data/partage /data/partage nfs rw,vers=3,rsize=32768, [snip...]
192.168.2.78t:/data/Jeux /data/jeux nfs rw,vers=3,rsize=32768, [snip...]
192.168.2.78:/data/Musique /data/musique nfs rw,vers=3,rsize=32768, [snip...]
192.168.2.78:/data/photos /data/photos nfs rw,vers=3,rsize=32768, [snip...]

# LC_ALL=C touch /data/musique/aaa
touch: cannot touch `/data/musique/aaa': Read-only file system
# LC_ALL=C touch /data/photos/aaa
touch: cannot touch `/data/photos/aaa': Read-only file system
# LC_ALL=C touch /data/jeux/aaa
touch: cannot touch `/data/jeux/aaa': Read-only file system
# LC_ALL=C touch /data/partage/aaa
Comment 4 Emil Beinroth 2007-04-16 11:29:18 UTC
I have/had the same problem .. after doing a little search I found this: 
http://thread.gmane.org/gmane.linux.nfs/11391 .. which referred to this: http://lkml.org/lkml/2006/10/18/264

Setting an explicit fsid for the mounts solved the problem for me.
Comment 5 SpanKY gentoo-dev 2008-03-29 21:34:03 UTC
looks like this is a nfs/kernel issue that is being worked on.  in the meantime, you can workaround things by using the fsid in /etc/exports as Emil helpfully points out.