# [Solved] Problem remounting root fs rw on software raid

## Shado23

I'm in the process of setting up a new gentoo install on a software raid on sata disks.

I have everything relevant compiled into the kernel and it to boots using two ways:

1. manually configured kernel without an initrd.

2. genkernel configured kernel or manually configured kernel with  genkernel initrd. (this makes no difference)

Since this is the same with the genkernel configured kernel I presume that my kernel config is correct at least in this regard, so I'm not posting it.

Both show errors on boot (though slightly different ones), but with the crucial difference that only with the genkernel initrd

do the filesystems get remounted rw.

There is nothing in dmesg, but I captured the RC_LOG in hope that you can help me solve that.

1. normal without initrd

```

* Activating (possible) swap ...

  [ ok ]

 * Checking root filesystem ...

/dev/md7: clean, 6308/126720 files, 16938/252960 blocks

  [ ok ]

 * Remounting root filesystem read/write ...

 * Root filesystem could not be mounted read/write :(

  [ !! ]

Give root password for maintenance

(or type Control-D to continue):

 * Skipping /etc/mtab initialization (ro root?)

 * Setting hostname to localhost ...

  [ ok ]

 * Using /etc/modules.autoload.d/kernel-2.6 as config:

 *   Loading module nvidia ...

  [ ok ]

 * Autoloaded 1 module(s)

 * Checking all filesystems ...

/dev/md0: clean, 46/6000 files, 12570/24000 blocks

/dev/md1: clean, 67476/735840 files, 296790/1469888 blocks (check in 5 mounts)

/dev/md5: clean, 131517/247296 files, 239818/493920 blocks (check in 3 mounts)

/dev/md4: clean, 39771/612864 files, 96508/1224896 blocks (check in 5 mounts)

/dev/md3: clean, 13/612864 files, 27449/1224896 blocks

/dev/md6: clean, 11/3670016 files, 123372/7329600 blocks

  [ ok ]

 * Mounting local filesystems ...

  [ ok ]

 * Mounting USB device filesystem (usbfs) ...

  [ ok ]

 * Activating (possibly) more swap ...

  [ ok ]

 * Setting system clock using the hardware clock [UTC] ...

  [ ok ]

 * Mounting tmpfs at /var/lib/init.d ...

  [ ok ]

 * Caching service dependencies ...

  [ ok ]

```

2. with genkernel initrd

```

* Activating (possible) swap ...

  [ ok ]

 * Remounting root filesystem read-only ...

mount: / not mounted already, or bad option

  [ !! ]

 * Checking root filesystem ...

/dev/md7 is mounted.

^G^G^G^GWARNING!!!  Running e2fsck on a mounted filesystem may cause

SEVERE filesystem damage.^G^G^G

Do you really want to continue (y/n)? rm: unable to remove `/dev': Device or resource busy

yes

/dev/md7: recovering journal

/dev/md7: clean, 6301/126720 files, 16932/252960 blocks

  [ ok ]

 * Remounting root filesystem read/write ...

 * Root filesystem could not be mounted read/write :(

  [ !! ]

Give root password for maintenance

(or type Control-D to continue):

 * Setting hostname to localhost ...

  [ ok ]

* Using /etc/modules.autoload.d/kernel-2.6 as config:

 *   Loading module nvidia ...

  [ ok ]

 * Autoloaded 1 module(s)

 * Checking all filesystems ...

/dev/md0: clean, 46/6000 files, 12570/24000 blocks

/dev/md1: clean, 67476/735840 files, 296790/1469888 blocks (check in 5 mounts)

/dev/md5: clean, 131517/247296 files, 239818/493920 blocks (check in 3 mounts)

/dev/md4: clean, 39771/612864 files, 96508/1224896 blocks (check in 5 mounts)

/dev/md3: clean, 13/612864 files, 27449/1224896 blocks

/dev/md6: clean, 11/3670016 files, 123372/7329600 blocks

  [ ok ]

 * Mounting local filesystems ...

  [ ok ]

 * Mounting USB device filesystem (usbfs) ...

  [ ok ]

 * Activating (possibly) more swap ...

  [ ok ]

 * Setting system clock using the hardware clock [UTC] ...

  [ ok ]

* Mounting tmpfs at /var/lib/init.d ...

  [ ok ]

 * Caching service dependencies ...

  [ ok ]

```

Some more info that might help:

output of mount for 1.

```

rootfs on / type rootfs (rw)

udev on /dev type tmpfs (rw)

/dev/md7 on / type ext3 (rw,data=ordered)

proc on /proc type proc (rw,nodiratime)

sysfs on /sys type sysfs (rw)

udev on /dev type tmpfs (rw,nosuid)

devpts on /dev/pts type devpts (rw)

usbfs on /proc/bus/usb type usbfs (rw)

```

output of mount for 2.

```

/dev/md/7 on / type ext3 (rw,noatime,nodiratime,commit=120,data=writeback)

udev on /dev type tmpfs (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

udev on /dev type tmpfs (rw,nosuid)

devpts on /dev/pts type devpts (rw)

/dev/md/0 on /boot type ext2 (rw,noatime,nodiratime)

/dev/md/1 on /usr type ext3 (rw,noatime,nodiratime,commit=120,data=writeback)

/dev/md/5 on /usr/portage type ext3 (rw,noatime,nodiratime,commit=120,data=writeback)

/dev/md/4 on /var type ext3 (rw,noatime,nodiratime,commit=120,data=writeback)

/dev/md/3 on /tmp type ext3 (rw,noatime,nodiratime,commit=120,data=writeback)

/dev/md/6 on /opt type ext3 (rw,noatime,nodiratime,commit=120,data=writeback)

shm on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)

usbfs on /proc/bus/usb type usbfs (rw,devmode=0664,devgid=85)

svcdir on /var/lib/init.d type tmpfs (rw,mode=0755,size=1048k)

```

/etc/fstab

```

/dev/md0                /boot           ext2            noatime,nodiratime                              1 1

/dev/md7                /               ext3            noatime,nodiratime,commit=120,data=writeback    1 1

/dev/md1                /usr            ext3            noatime,nodiratime,commit=120,data=writeback    1 1

/dev/md5                /usr/portage    ext3            noatime,nodiratime,commit=120,data=writeback    1 1

/dev/md4                /var            ext3            noatime,nodiratime,commit=120,data=writeback    1 1

/dev/md3                /tmp            ext3            noatime,nodiratime,commit=120,data=writeback    1 1

/dev/md6                /opt            ext3            noatime,nodiratime,commit=120,data=writeback    1 1

/dev/sda2               none            swap            sw,prio=1                                       0 0

/dev/sdb2               none            swap            sw,prio=1                                       0 0

```

/proc/mdstats

```

Personalities : [linear] [raid0] [raid1]

md0 : active raid1 sdb1[1] sda1[0]

      24000 blocks [2/2] [UU]

md1 : active raid0 sdb5[1] sda5[0]

      5879552 blocks 64k chunks

md2 : active raid0 sdb6[1] sda6[0]

      4899584 blocks 64k chunks

md3 : active raid0 sdb7[1] sda7[0]

      4899584 blocks 64k chunks

md4 : active raid0 sdb8[1] sda8[0]

      4899584 blocks 64k chunks

md5 : active raid0 sdb9[1] sda9[0]

      1975680 blocks 64k chunks

md6 : active raid0 sdb10[1] sda10[0]

      29318400 blocks 64k chunks

md7 : active raid0 sdb11[1] sda11[0]

      1011840 blocks 64k chunks

unused devices: <none>

```

emerge info

```

Portage 2.0.53 (default-linux/amd64/2005.1, gcc-4.1.0-beta20051125, glibc-2.3.90.20051201-r0, 2.6.14-acid2 x86_64)

=================================================================

System uname: 2.6.14-acid2 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4400+

Gentoo Base System version 1.12.0_pre11

dev-lang/python:     2.3.5-r2, 2.4.2

sys-apps/sandbox:    1.2.16

sys-devel/autoconf:  2.13, 2.59-r7

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1

sys-devel/binutils:  2.16.1-r1

sys-devel/libtool:   1.5.20-r1

virtual/os-headers:  2.6.11-r3

ACCEPT_KEYWORDS="amd64 ~amd64"

AUTOCLEAN="yes"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -march=k8 -mtune=k8 -fomit-frame-pointer -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"

CXXFLAGS="-O2 -march=k8 -mtune=k8 -fomit-frame-pointer -pipe -fvisibility-inlines-hidden"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig confcache distlocks prelink sandbox sfperms strict"

GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"

MAKEOPTS="-j3"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage /usr/local/kdesvn"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="amd64 3dnowex X a52 aac alsa avi bash-completion berkdb bitmap-fonts bzip2 cairo cdb cdparanoia cdr cjk crypt dbus dga djbfft dlloader dmx dts dvd dvdr dvdread eds emboss encode expat fam font-server foomaticdb gif gnome gpm gstreamer gtk gtk2 hal id3 imlib jpeg kde kdeenablefinal logitech-mouse lzo lzw lzw-tiff mad matroska mp3 mpeg ncurses nls nodrm nptl nptlonly nvidia offensive ogg opengl pam pcre pdflib perl pic png python qt quicktime rdesktop readline rtc sdl spell ssl svg tcpd theora tiff truetype truetype-fonts type1-fonts udev unicode usb userlocales vorbis xml2 xpm xv xvid zlib userland_GNU kernel_linux elibc_glibc"

Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS

```

If there is anything else I should post, please tell me.

Thanks in advance for your time.Last edited by Shado23 on Sun Dec 04, 2005 8:56 pm; edited 1 time in total

----------

## ty

Have you tried an /etc/fstab with simpler options, say just a noatime for all the mount points? 

I've had problems with sata and raid -- it always works but it can be a little fussy.

----------

## Shado23

Surprisingly that did it...

Seems like you can't mount your root fs with data=writeback, very strange.

Anyways thanks a lot for the quick resolution.^^

----------

