[BusyBox] Re: Problem with busybox based initrd: umount of initrd hangs system (Terry Barnaby)

Terry Barnaby terry1 at beam.ltd.uk
Fri Jul 1 04:44:14 UTC 2005


Peter S. Mazinger wrote:
>>From: Terry Barnaby <terry1 at beam.ltd.uk>
>>Subject: [BusyBox] Problem with busybox based initrd: umount of initrd
>>	hangs	system
>>To: busybox at mail.codepoet.org
>>Message-ID: <42C3DD97.1060709 at beam.ltd.uk>
>>Content-Type: text/plain; charset="iso-8859-1"
>>
>>Hi,
>>
>>I am building a custom initrd for booting a Fedora 3 based system.
>>In general all is working fine, except that when I try an umount the initrd
>>after boot has suceeded the system hangs with no error messages.
>>
>>I have created a cpio based initrd using busybox. A simplified version
>>of the "init" script is attched. This finishes with running /bin/sh on the
>>hard disk mounted file system. If I try and run "umount /initrd1" the system
>>hangs.
>>The system is booted using PXE based network boot using pxelinux 3.0.9.
>>I am using busybox-1.00.
>>The kernel is Fedora3's version 2.6.11-1.35_FC3smp.
>>
>>Any Ideas ??
>>
>>Terry
>>-------------- next part --------------
>>#!/bin/ash
>>################################################################################
>>#	Init			Beamsys Startup
>>#				T.Barnaby,	BEAM Ltd,	2005-06-29
>>################################################################################
>>#
>>
>>echo ""
>>echo "##### Beamsys Initrd init: ${VERSION} #####"
>>
>>echo "Mounting /proc filesystem"
>>mount -t proc /proc /proc
>>
>>insmod /lib/jbd.ko
>>insmod /lib/ext3.ko
>>
>>echo "Mounting root filesystem"
>>mount -r -t ext3 /dev/hda1 /sysroot
>>
>>echo "Switching to new root"
>>umount /proc
>>cd /sysroot
>>
>># Debug point
>>/bin/ash
> 
> 
> why do you run the shell again ?
Thanks for the reply.

This is a simple debug point allowing me to have a look to see
what is running and mounted etc. Removing it make no difference.
This is a "simplified" test init script.

> 
> 
>>pivot_root . initrd1
> 
> 
> does the initrd1 dir exist on the root filesystem?
> 
> 
Yes, the harddisk based file system has /initrd1 and the initial ram
disk does end up mounted on /initrd1 Ok. Its just when I try and
run "umount /initrd1" the system locks up.
With the full script Fedora3 boots completely and runs Ok apart
from unmounting the initrd. Thats why I have been using /initrd1
rather than /initrd (saves me modifying Fedora init code :) )

>># Debug point
>>exec usr/sbin/chroot . /bin/sh <dev/console >dev/console 2>&1
>>
>>#exec usr/sbin/chroot . sbin/init <dev/console >dev/console 2>&1
>>#exec usr/sbin/chroot .  /bin/sh -c 'umount /initrd1; exec /sbin/init' <dev/console >dev/console 2>&1
> 
> 
> Peter
> 


Terry



More information about the busybox mailing list