Root Aliases & Lock-ups on Mount w/ Initrd (was Re: initrd: couldn'tumount)

Root Aliases & Lock-ups on Mount w/ Initrd (was Re: initrd: couldn'tumount)

Post by Grant Erickso » Sat, 25 Aug 2001 00:50:08

I've been following the thread between Andreas Haumer, Daniel Wagner, and
Alan Cox about not being able to unmount an initrd volume for the past
week or so as I've recently run into two, somewhat related problems, which
I am unable to explain.

1) The 'chroot' command fails with a message on the console about busy
   inodes and d_count=9:

        cardmgr[13]: executing: './ide start hda'
        cardmgr[13]: exiting
         hda: hda1 hda2
        Start mounting filesystem: ide0(3,1)
        Starting XFS recovery on filesystem: ide0(3,1) (dev: 3/1)
        Ending XFS recovery on filesystem: ide0(3,1) (dev: 3/1)  
        VFS: busy inodes on changed media.
        VFS: Mounted root (xfs filesystem).
        change_root: old root has d_count=9
        Freeing unused kernel memory: 60k init 4k openfirmware

   Later, when I try to force unmount the initrd and call 'blockdev
   --flushbufs /dev/ram0' in rc.sysinit, it fails with a message about
   busy buffers:

        umount'ing initrd
        BLKFLSBUF: Device or resource busy
        INIT: Entering runlevel: 3
        The system is coming up.

   When the system is finally "up" I end up with two /initrd mount points,
   one on top the other:

        # cat /proc/mounts
        /dev/root /initrd/initrd ext2 rw 0 0
        /dev/root.old /initrd xfs rw,noatime 0 0
        proc /initrd/proc proc rw 0 0
        /dev/root / xfs rw,noatime 0 0
        /proc /proc proc rw 0 0
        none /dev/pts devpts rw 0 0

   The mount /initrd is the same as / (ls -i bears this out) and
   /initrd/initrd is the initial RAM disk.

   When I get the d_count=9 message and run fuser, the only processes
   running are those I'd expect--kernel threads and linuxrc (which should
   be disassociated with any files):

        fuser -mv /initrd
                             USER        PID ACCESS COMMAND
        /initrd              0             1 .rc..  swapper
                             0             2 .rc..  keventd
                             0             3 .rc..  kswapd
                             0             4 .rc..  kreclaimd
                             0             5 .rc..  bdflush
                             0             6 .rc..  kupdate
                             0             7 .rc..  pagebuf_daemon
                             0             8 fr.e.  linuxrc
                             0            24 fr.e.  sh
                             0        kernel mount  /proc

   This behavior happens regardless of whether or not the file system
   on the SANDisk is xfs or ext2. I suspect there must be something
   wrong in either the way I've written linuxrc or there's something
   awry in fs/super.c or fs/block_dev.c.

   Has anyone else tried this configuration successfully? Any insight?

2) The second issue I notice is that when the root file system is
   XFS, 1 time out of 20, the sytem freezes shortly after mounting:

        Ending XFS recovery on filesystem: ide0(3,1) (dev: 3/1)
        [ Hang ]

   It hangs regardless of whether or not it does recovery.

   When I run ext2 as the root file system, 9 times out of 10, the system
   freezes shortly after mounting.

   Problem here might well be pivot_root rather than mount. Anyone seen
   similar such hangs?

The goal:

   - Launch an initrd to allow switching the root file system over to an
     XFS volume on the SanDisk device

The setup:

   - TI PCI 1420 CardBus controller  
   - SanDisk SDCFB-128, ATA DISK drive
   - Monta Vista Linux 2.4.2-mvista_010329
     * XFS 1.0.1 patches (yes, I realize that these should have been
       applied to 2.4.5; however, save a few files, they merged well onto
   - PowerPC 405GP Revision E
   - pcmcia-cs 3.1.27

The linuxrc:


mount -t proc /proc /proc
if [ -f /etc/pcmcia.conf ] ; then
    . /etc/pcmcia.conf
insmod $PC/pcmcia_core.o $CORE_OPTS
insmod $PC/$PCIC.o $PCIC_OPTS
insmod $PC/ds.o
cardmgr $V -q -o -s /var/run/stab -p /tmp/
umount /proc
mount -t xfs -o noatime dev/hda1 mnt
cd mnt
pivot_root . initrd
exec chroot . sh -c 'bin/mount -t proc proc proc; echo "0x03010000" > \
proc/sys/kernel/real-root-dev' < dev/console > dev/console 2>&1

Any nudges in the right direction to a root cause would be greatly



 Grant Erickson                       University of Minnesota Alumni

  o                          1998 MSEE

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at
Please read the FAQ at


1. Couldn't get initrd to work with milo-2.2-17.

I couldn't get initrd to work with milo-2.2-17.

I tried to re-install RH 6.2 on a floppyless and CDROMless UDB
(Multia).  I installed milo and it boots linux OK.  I put the kernel I
extracted from generic.img and ramdisk.img on hda4.  I then did
milo> hda4:

milo> boot vmlinux.gz initrd=ramdisk.img

It says loading ramdisk from file ramdisk.img and boots the kernel.
It then warns about can't open initial console and aborts saying can't
find init.  

My guess is that it the root wasn't mounted from the ramdisk, but
another partition on the disk.

A trick I used to installed RH 5.2 didn't work either.  I uncompressed
the ramdisk and extracted the root file system to a partition.  I just
pointed the root to that partition and the install worked for 5.2.


2. Trouble with PCI SCSI driver on AST Manhattan P-90 (fwd)

3. ramdisk and initrd fail: unable to mount root fs on 01:00 (from standard LRP 3.0.0pre)

4. Newbie desperate for Sound and Networking

5. initrd's ramdisk mounted in read-only mode

6. gs3.33 error

7. initrd bk6 & 7 builds - undefined initrd_load & real_root_dev

8. PPP configuration

9. How is initrd used in lilo.conf stanzas and what's it's purpose?

10. initrd 'dev busy'?

11. PROBLEM: kernel mount of initrd fails unless mke2fs uses 1024 byt e blocks

12. How to mount an initrd image

13. initrd, kernel modules and root=/dev/cdrom