public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: sl@whiskey.fireplug.net (Stuart Lynne)
To: linux-kernel@vger.kernel.org
Subject: Re: / on ramfs, possible?
Date: 30 Oct 2000 12:09:36 -0800	[thread overview]
Message-ID: <8tkki0$v0p$1@whiskey.enposte.net> (raw)
In-Reply-To: <200010300727.IAA12250@hell.wii.ericsson.net>

In article <200010300727.IAA12250@hell.wii.ericsson.net>,
Anders Eriksson <aer-list@mailandnews.com> wrote:
>--==_Exmh_17293564P
>Content-Type: text/plain; charset=us-ascii
>
>
>I want my / to be a ramfs filesystem. I intend to populate it from an 
>initrd image, and then remount / as the ramfs filesystem. Is that at 
>all possible? The way I see it the kernel requires / on a device 
>(major,minor) or nfs.
>
>Am I out of luck using ramfs as /? If it's easy to fix, how do I fix it?

Yes it works.

You will need pivot_root. 

Something like the following at the end of your initrd /linuxrc script 
should mount your ramfs, copy the existing root fs files to it, pivot
and unmount your old root. YMMV
 
    mkdir -p /ramfs /ram1
    mount -t ramfs /ramfs /ramfs
    find / | sed '/^\/ramfs/d;/^\/proc\/.*/d' | cpio -pdmV /ramfs
    cd /ramfs
    pivot_root . ram1
    exec chroot . sh -c 'umount /ram1; exit' < dev/console >dev/console


BTW has anyone thought of writing a small utility to emulate df for ramfs?

-- 
                                            __O 
Fireplug - a Lineo company                _-\<,_ 
PGP Fingerprint: 28 E2 A0 15 99 62 9A 00 (_)/ (_) 88 EC A3 EE 2D 1C 15 68
Stuart Lynne <sl@fireplug.net>       www.fireplug.net        604-461-7532
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  parent reply	other threads:[~2000-10-30 20:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-30  7:27 / on ramfs, possible? Anders Eriksson
2000-10-30  7:34 ` H. Peter Anvin
2000-10-30 23:24   ` David Woodhouse
2000-10-30 23:26     ` H. Peter Anvin
2000-10-30 23:32       ` David Woodhouse
2000-10-30 23:37         ` H. Peter Anvin
2000-10-30 23:39         ` Jeff Garzik
2000-11-01  9:16         ` aer-list
2000-10-30 12:42 ` Alan Cox
2000-10-30 20:09 ` Stuart Lynne [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-10-30  8:39 Adam J. Richter

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='8tkki0$v0p$1@whiskey.enposte.net' \
    --to=sl@whiskey.fireplug.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sl@fireplug.net \
    /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