public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: linux-kernel@vger.kernel.org
Subject: Can't free the ramdisk (initrd, pivot_root)
Date: 14 Apr 2001 23:36:59 -0700	[thread overview]
Message-ID: <9bbfib$qu4$1@cesium.transmeta.com> (raw)

Hello friends,

I am trying the following setup, and it works beautifully, *except*
that I don't seem to be able to free the ramdisk memory at the end.
This is using the 2.4.3 stock kernel:

I load an initrd in "non-initrd" mode:

label single
        kernel vmlinuz
        append initrd=initrd.gz root=/dev/ram0 init=/linuxrc single

The initrd sets up a ramfs which is intended to become the root
filesystem, and then calls pivot_root:

[....]
umount /proc

# At this point, all that is mounted is /ram and /ram/usr

# Switch roots and run init
cd /ram
pivot_root /ram /ram/initrd
exec /sbin/init "$@"


(And yes, the /ram/initrd mount point directory does exist.)

This successfully runs init, and I can umount /initrd in the new
setup, but I cannot then destroy the ramdisk contents by calling
ioctl([/dev/ram0], BLKFLSBUF, 0) -- it always returns EBUSY.  What is
holding this ramdisk busy, especially since I could successfully
umount the filesystem?  Seems like a bug to me.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt

             reply	other threads:[~2001-04-15  6:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-15  6:36 H. Peter Anvin [this message]
2001-04-15 18:26 ` Can't free the ramdisk (initrd, pivot_root) Scott Murray
2001-04-16  1:31   ` H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2001-04-15 20:57 Amit D Chaudhary
2001-04-16  1:32 ` H. Peter Anvin
2001-04-16  1:53   ` Scott Murray
2001-06-18 13:21 Ralph Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='9bbfib$qu4$1@cesium.transmeta.com' \
    --to=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox