Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 219116 - sys-apps/openrc: inconsistent boot time mounting of USB partitions
Summary: sys-apps/openrc: inconsistent boot time mounting of USB partitions
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-24 07:20 UTC by Heiko Baums
Modified: 2008-11-27 09:34 UTC (History)
3 users (show)

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


Attachments
rc.log (rc.log,3.69 KB, text/plain)
2008-04-24 21:33 UTC, Heiko Baums
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Baums 2008-04-24 07:20:00 UTC
With baselayout-2.0.0 and openrc-0.2.2 my USB HDD is automounted at boot time only randomly. Most of the time it's not automounted.

With baselayout-1.12.12 and without openrc it was always automounted at boot time without any problems.

This is the appropriate line in /etc/fstab:
UUID=<uuid>   /home/<user>/<directory>   ext3   noatime,users,exec   0 0


emerge --info:

Portage 2.1.5_rc6 (default-linux/x86/2007.0/desktop, gcc-4.1.2, glibc-2.7-r2, 2.6.24-gentoo-r5 i686)
=================================================================
System uname: 2.6.24-gentoo-r5 i686 AMD Athlon(tm) XP 1600+
Timestamp of tree: Thu, 24 Apr 2008 06:30:02 +0000
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.5
dev-lang/python:     2.5.1-r5
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.62
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.24
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/applications/kde /usr/kde/3.5/share/config /usr/kde/3.5/share/services/searchproviders /usr/kde/3.5/shutdown /usr/share/applications /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://de-mirror.org/distro/gentoo/ http://mirror.switch.ch/ftp/mirror/gentoo/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/"
LANG="de_DE.UTF-8"
LDFLAGS=""
LINGUAS="de"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/sunrise /usr/portage/local/private"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac aalib accessibility acl aften agg alsa apache2 apm arts asf audiofile authfile avi berkdb bluetooth bzip2 cairo caps cdda cddb cdparanoia cdr chardet clamav cli cracklib crypt css ctype cups curl d dbus dga divx dri dv dvb dvd dvdnav dvdr dvdread eds emboss encode espeak expat extrafilters fam fame fbcon fbcondecor festival ffmpeg firefox flac fltk fontconfig foomaticdb fortran ftp gcj gd gdbm gif gimp glib glitz gmedia gmp gnutls gpm graphviz gs gstreamer gtk gtkhtml gucharmap hddtemp iconv idn ilbc imagemagick imlib inkjar ipv6 irmc isdnlog jack jack-tmpfs jackmidi jce jpeg kde ladspa lame lcms libffi libnotify libsamplerate lirc live lm_sensors logrotate loop-aes lzo mad mbox mbrola md5sum midi mikmod mjpeg mmx mmxext mng modplug motif mozilla mp2 mp3 mp4 mpeg mplayer mudflap musepack musicbrainz mysql mysqli nas ncurses network nls nptl nptlonly nsplugin objc objc++ objc-gc offensive ofx ogg opengl openmp osc oss pam pcre pdf perl php plugin png ppds pppd print python qt3 qt3support qt4 quicktime quotes rar readline real realmedia reflection rtc rtsp scanner sdl session shout sndfile speex spell spl sqlite sse ssl svg tcl tcltk tcpd tetex themes theora threads threadsafe tidy tiff tk tokenizer tools truetype unicode usb utempter v4l v4l2 vcd vdr vidix visualization vlm vorbis win32codecs wma wmf wmp x264 x86 xcomposite xine xiph xml xorg xpm xv xvid xvmc yv12 zip zlib" ALSA_CARDS="ice1712" 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" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" LIRC_DEVICES="devinput" USERLAND="GNU" VIDEO_CARDS="nvidia v4l"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 SpanKY gentoo-dev 2008-04-24 20:18:47 UTC
enable logging in rc.conf and post relevant rc.log file's as attachments
Comment 2 Heiko Baums 2008-04-24 21:33:39 UTC
Created attachment 150869 [details]
rc.log

Attached the rc.log of the latest shutdown and boot process.

But I found out, that the USB HDD is always automounted, if rc logging is enabled. After disabling rc logging again, the USB HDD isn't automounted anymore.
Comment 3 SpanKY gentoo-dev 2008-04-24 22:11:41 UTC
what is the error ?  mount doesnt just arbitrarily skip mount points.
Comment 4 Heiko Baums 2008-04-25 00:53:51 UTC
There is no error message. At least I haven't found one.

When I turned off the USB HDD before booting the system with baselayout-1, I've got the message, that some devices aren't ready or can't be mounted, when the devices have been mounted.

With baselayout-2.0.0 and openrc-0.2.2 I'm not getting any error messages, neither on the screen nor in the log files.

Because the USB HDD is always mounted, when rc logging is enabled and the boot process therefore is a bit slower, I guess, that there is a timing problem somewhere in the rc scripts and/or the boot process.
Comment 5 SpanKY gentoo-dev 2008-04-25 05:10:59 UTC
edit your localmount init.d script and add "-v" to the mount function in start() and post the output
Comment 6 Heiko Baums 2008-04-25 07:11:28 UTC
When adding -v to the mount parameters (mount -atv "${types}") in /etc/init.d/localmount, then absolutely nothing is mounted except the root partition, not even the partitions on my local harddrive like the /home partition.

So I removed the -v option again.
Comment 7 SpanKY gentoo-dev 2008-04-25 07:43:57 UTC
that doesnt really make any sense ... -v mode should just print out what it's doing, not change any behavior.  what did you make it look like ?
mount -vat "${types}"

what version of util-linux are you using ?
Comment 8 Heiko Baums 2008-04-25 08:17:55 UTC
I already changed it to mount -vat "${types}", and now it seems to always automount the USB HDD again.

So with rc logging enabled or with mount -vat it always mounts the USB HDD, but with rc logging disabled and with mount -at it doesn't mount the USB HDD.

Maybe it's also, because -v takes a bit longer than it takes without -v, like it is with the rc logging. Just a guess.

I'm using util-linux-2.13.1.

I'll update to util-linux-2.13.1.1, and test it again.
Comment 9 Heiko Baums 2008-04-25 08:46:17 UTC
The problem still exists with util-linux-2.13.1.1.
Comment 10 Peter Volkov (RETIRED) gentoo-dev 2008-04-26 07:49:17 UTC
Usb devices normally take some time to settle, so it's very possible that with openrc, which is faster than baselayout-1.x, your kernel doesn't manage to scan device and does not create devices and that's why you experience such behavior.

Try to add kernel boot option 'rootdelay=10' to delay mounting of root files system to see if you manage to reproduce this bug in this case. This is not good solution as it slows down whole boot process on 10 seconds but if it fixes the problem you may tune you system to automount your USB harddrive with any existing automount solutions...
Comment 11 Heiko Baums 2008-04-26 22:14:36 UTC
That was also my guess, that it's a timing problem. But I think, in the meantime it's fixed "by itself".

During the tests I ran two or three `emerge -uDN world`, and with one of them splashutils was also updated.

With the last splashutils on the silent splash I've got only the message "Initializing the kernel..." through the whole boot process, but not "Booting the system..." and the percentage anymore. With the new splashutils I'm getting the message "Booting the system..." and the percentage again. And now the USB HDD is always automounted again.

I think it's because the silent splash with the percentage takes a bit longer than the silent splash without the percentage or the verbose splash.

But the now working silent splash, the mount option -v or the enabled rc logging don't take 10 seconds longer. So I think rootdelay=10 is a bit too long. I think - I can't test it anymore, because it's solved - rootdelay=1 or rootdelay=2 should be enough.

But what I wonder at is, that this problem occurs, because actually the drive is ready after the system selftest, before grub is loaded. Or can it be, that the kernel or udev need a bit longer to detect the usb device?
Comment 12 José Otávio Rizzatti Ferreira 2008-04-28 04:22:04 UTC
Googling around, I found a udev rule that fixes the problem. We need to add the following line to one of /etc/udev/rules.d/<something>.rules
In my case, it was 30-kernel-compat.rules

ACTION=="add", SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt"

This way, the partitions are mounted when the devices are connected. Tested with iPod, external USB HDD and USB stick.

sys-fs/udev-120
sys-apps/hal-0.5.10
app-misc/hal-info-20071030
2.6.22-gentoo-r10
Comment 13 Doug Goldstein (RETIRED) gentoo-dev 2008-10-07 15:36:26 UTC
Matthias, any input on the rule posted here?
Comment 14 Matthias Schwarzott gentoo-dev 2008-10-07 20:59:08 UTC
Between udev-119 and udev-120 this rule was removed:
ACTION=="add", KERNEL=="[0-9]*:[0-9]*", SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt"

Can you please try if this rule also fixes your bug?


According to Kay Sievers he added this patch to the kernel to remove the need for the wait-rule:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bfd129445f23c037d9a440ebfa4109e11c220301
If I did use git correct, this was added before kernel 2.6.24-rc1.

So your 2.6.24-gentoo-r5 should definitely contain it.
Comment 15 Heiko Baums 2008-10-07 23:54:53 UTC
Somehow I haven't thought about this bug anymore.

I can't say, since when this bug is fixed, but this bug indeed seems to be fixed.

Now I'm using gentoo-sources-2.6.25-r4 and util-linux-2.14.

And in /etc/rc.conf I have disabled rc logging and in /etc/init.d/localmount I have mount -at "${types}". I can't remember, that I've changed one of these settings. Maybe I had disabled rc logging and used mount -vat, to workaround the problem, and in the meantime /etc/init.d/localmount was updated by an `emerge -uDN world`.
Comment 16 Matthias Schwarzott gentoo-dev 2008-11-27 09:34:52 UTC
Closing this bug as it seems fixed. Please re-open if it appears again.