I've got Fedora 9 on my pc, and I want to run it out of RAM, essentially
making the disk read-only. Can anyone point me to some instructs for this?
Thanks.
Printable View
I've got Fedora 9 on my pc, and I want to run it out of RAM, essentially
making the disk read-only. Can anyone point me to some instructs for this?
Thanks.
Christian Williamson wrote:[color=blue]
> I've got Fedora 9 on my pc, and I want to run it out of RAM, essentially
> making the disk read-only. Can anyone point me to some instructs for this?
>
> Thanks.[/color]
well making a ramdisk and using it for swap is not hard..
I am less sure about other processes that use disk..I guess you could
have a /tmp in ramdisk as well..and log files..well a patch to syslog to
make it either junk log files or write them to somewhere else would be
called for.
I take it this is for a very stripped down specific application?
Hello,
The Natural Philosopher a écrit :[color=blue]
>
> well making a ramdisk and using it for swap is not hard..[/color]
And is definitely totally useless.
PS : what does this have to do with networking ?
The Natural Philosopher wrote:[color=blue]
> Christian Williamson wrote:[color=green]
>> I've got Fedora 9 on my pc, and I want to run it out of RAM, essentially
>> making the disk read-only. Can anyone point me to some instructs for
>> this?
>>
>> Thanks.[/color]
> well making a ramdisk and using it for swap is not hard..
>
> I am less sure about other processes that use disk..I guess you could
> have a /tmp in ramdisk as well..and log files..well a patch to syslog to
> make it either junk log files or write them to somewhere else would be
> called for.
>
>
> I take it this is for a very stripped down specific application?[/color]
I haven't stripped it down. I ran a script to see how many files were
changed from boot, and it ended up being over 34,000 files, 26,000 of
them in /proc. See
[url]http://www.mydigitallife.info/2006/01/19/find-files-that-are-modified-today-or-since-certain-time-ago-in-unix/[/url]
for the find command.
I'd like to boot from the disk as if it's read-only, then run everything
out of ram.
The Natural Philosopher wrote:[color=blue]
> Christian Williamson wrote:[color=green]
>> I've got Fedora 9 on my pc, and I want to run it out of RAM, essentially
>> making the disk read-only. Can anyone point me to some instructs for
>> this?
>>
>> Thanks.[/color]
> well making a ramdisk and using it for swap is not hard..
>
> I am less sure about other processes that use disk..I guess you could
> have a /tmp in ramdisk as well..and log files..well a patch to syslog to
> make it either junk log files or write them to somewhere else would be
> called for.
>
>
> I take it this is for a very stripped down specific application?[/color]
I haven't stripped it down. I ran a script to see how many files were
changed from boot, and it ended up being over 34,000 files, 26,000 of
them in /proc. See
[url]http://www.mydigitallife.info/2006/01/19/find-files-that-are-modified-today-or-since-certain-time-ago-in-unix/[/url]
for the find command.
I'd like to boot from the disk as if it's read-only, then run everything
out of ram.
Pascal Hambourg wrote:[color=blue]
> Hello,
>
> The Natural Philosopher a écrit :[color=green]
>>
>> well making a ramdisk and using it for swap is not hard..[/color]
>
> And is definitely totally useless.
>[/color]
Why? if the OS wants to see swap, give it some..it may be happier that
way than simply removing swap altogether.
[color=blue]
> PS : what does this have to do with networking ?[/color]
no idea. I fund it in linux group..ah - cross posted.
Sorry about that.
I didn;t notice.
Pascal Hambourg wrote:[color=blue]
> Hello,
>
> The Natural Philosopher a écrit :[color=green]
>>
>> well making a ramdisk and using it for swap is not hard..[/color]
>
> And is definitely totally useless.
>
> PS : what does this have to do with networking ?[/color]
I could boot over the network and place everything in ramdisk.
The Natural Philosopher a écrit :[color=blue][color=green]
>>[color=darkred]
>>> well making a ramdisk and using it for swap is not hard..[/color]
>>
>> And is definitely totally useless.[/color]
>
> Why? if the OS wants to see swap, give it some..it may be happier that
> way than simply removing swap altogether.[/color]
Why would the system want to see swap ? Linux does not need swap to
operate. AFAIK, swap space may be used for two reasons.
1) Free some RAM for processes or disk cache. Obviously, creating swap
space in RAM won't free any RAM. On the contrary, it will consume some
RAM even though swap is not needed.
2) Suspend-to-disk. Obviously again, swap space in RAM cannot be used
for this.
Christian Williamson a écrit :[color=blue]
>
> I could boot over the network and place everything in ramdisk.[/color]
If you want to boot over the network then say it explicitly because it
is a specific matter.
If you want to boot from a local read-only medium, you may want to
consider UnionFS <http://en.wikipedia.org/wiki/UnionFS>. It allows to
merge read-only (local medium) and read-write (ramdisk or tmpfs)
filesystems into one read-write filesystem. This is used by some Live
CDs in order to save RAM.
Pascal Hambourg wrote:[color=blue]
> Christian Williamson a écrit :[color=green]
>>
>> I could boot over the network and place everything in ramdisk.[/color]
>
> If you want to boot over the network then say it explicitly because it
> is a specific matter.
>
> If you want to boot from a local read-only medium, you may want to
> consider UnionFS <http://en.wikipedia.org/wiki/UnionFS>. It allows to
> merge read-only (local medium) and read-write (ramdisk or tmpfs)
> filesystems into one read-write filesystem. This is used by some Live
> CDs in order to save RAM.[/color]
Thanks. BTW, Pascal, which group do you think I should I have posted the
original in?
"Christian Williamson" <c.willi@verizon.net> wrote[color=blue]
> The Natural Philosopher wrote:[color=green]
>> Christian Williamson wrote:[color=darkred]
>>> I've got Fedora 9 on my pc, and I want to run it out of RAM, essentially
>>> making the disk read-only. Can anyone point me to some instructs for
>>> this?
>>>
>>> Thanks.[/color]
>> well making a ramdisk and using it for swap is not hard..
>>
>> I am less sure about other processes that use disk..I guess you could
>> have a /tmp in ramdisk as well..and log files..well a patch to syslog to
>> make it either junk log files or write them to somewhere else would be
>> called for.
>>
>>
>> I take it this is for a very stripped down specific application?[/color]
>
> I haven't stripped it down. I ran a script to see how many files were
> changed from boot, and it ended up being over 34,000 files, 26,000 of
> them in /proc. See[/color]
Um .... I thought files in /proc were not actually stored on the disk??
Magnate wrote:[color=blue]
> "Christian Williamson" <c.willi@verizon.net> wrote[color=green]
>> The Natural Philosopher wrote:[color=darkred]
>>> Christian Williamson wrote:
>>>> I've got Fedora 9 on my pc, and I want to run it out of RAM,
>>>> essentially
>>>> making the disk read-only. Can anyone point me to some instructs for
>>>> this?
>>>>
>>>> Thanks.
>>> well making a ramdisk and using it for swap is not hard..
>>>
>>> I am less sure about other processes that use disk..I guess you could
>>> have a /tmp in ramdisk as well..and log files..well a patch to syslog to
>>> make it either junk log files or write them to somewhere else would be
>>> called for.
>>>
>>>
>>> I take it this is for a very stripped down specific application?[/color]
>>
>> I haven't stripped it down. I ran a script to see how many files were
>> changed from boot, and it ended up being over 34,000 files, 26,000 of
>> them in /proc. See[/color]
>
> Um .... I thought files in /proc were not actually stored on the disk??[/color]
I dont think they are..
Pascal Hambourg wrote:[color=blue]
> The Natural Philosopher a écrit :[color=green][color=darkred]
>>>
>>>> well making a ramdisk and using it for swap is not hard..
>>>
>>> And is definitely totally useless.[/color]
>>
>> Why? if the OS wants to see swap, give it some..it may be happier that
>> way than simply removing swap altogether.[/color]
>
> Why would the system want to see swap ? Linux does not need swap to
> operate. AFAIK, swap space may be used for two reasons.
>[/color]
Well if it doesn't then of course that is a useless suggestion..I
thought it needed it there, even if it didn't use it.
On Thu, 18 Sep 2008 10:44:38 +0100, The Natural Philosopher <a@b.c> wrote:[color=blue]
> well making a ramdisk and using it for swap is not hard..[/color]
Using ram for a swap file is insanity. You're basically setting up the
ram to simulate a block device so that you can use it to simulate ram!
Just run with enough memory and no swap file. Linux uses shared libraries
like swap; it'll drop unused pages knowing that it can always return to the
libraries to reload them.
The only concern I have is that linux may use too much ram for disk buffering
and not leave import application pages resident.
On Thu, 18 Sep 2008 08:31:57 +0000, Christian Williamson wrote:
[color=blue]
> I've got Fedora 9 on my pc, and I want to run it out of RAM, essentially
> making the disk read-only. Can anyone point me to some instructs for this?
>
> Thanks.
>[/color]
This works in theory. Practical limits may be another matter, though.
Certain rescue environments work in RAM because they are small enough to
fit while leaving enough free memory for the OS to use as RAM. The problem
comes with the magnitude of a full install of a modern GNU/Linux. I
do not use FC 9, but I assume a full install consumes over 4G of hard
disk space. If that is written to RAM, then it might work (in theory) if
your box has 5G or more RAM (leaving 1G for the OS itself). In addition to
the full amount of RAM, you also need a motherboard capable of using
the RAM, and a PAE enabled kernel (for a 32-bit kernel), or if you have
compatible hardware then a 64-bit kernel be used.
Other options...
1. If you have the RAM, then I guess your initrd can be your root
filesystem. There will be some delay as the initrd is read into RAM at
boot. There could also be some size limits for the initrd which I am not
aware of. I have only used initrd's which were less than 256M.
2. You can have a root filesystem on tmpfs. IIRC, tmpfs uses half of
available RAM by default. There is an IBM article written by Robbins on
the topic.
[url]http://www.ibm.com/developerworks/library/l-fs3.html[/url]
3. An easier "performance" solution is to get the fastest read media
available. 8G of flash memory is very affordable now. It has the
advantage over your method (AIUI) in that the storage is local and does
not need not be transmitted for each new boot. Only the portions of the
filesystem which are used are ever placed in memory at all, etc.
--
Douglas Mayne
On 2008-09-18, Christian Williamson <c.willi@verizon.net> wrote:
[color=blue]
> I've got Fedora 9 on my pc, and I want to run it out of RAM,
> essentially making the disk read-only. Can anyone point me to
> some instructs for this?[/color]
What you're describing is generally referred to as a "livecd".
If you're interested in building one of your own, then Google
for "build linux livecd".
If you just want to download one and run from it, then just go
to distrowatch and download one.
--
Grant Edwards grante Yow! I like the way ONLY
at their mouths move ... They
visi.com look like DYING OYSTERS
Christian Williamson <c.willi@verizon.net> writes:
[color=blue]
> I've got Fedora 9 on my pc, and I want to run it out of RAM, essentially
> making the disk read-only. Can anyone point me to some instructs for this?[/color]
Once I did something similar but with Debian. The machine was a
diskless box, and it booted over the network. Then it mounted a
root partition through nfs, created a local filesystem (AFAIR
it was tmpfs), copied the root to this new fs in ram, pivot
root, umount nfsroot, etc. It even ran X out of ram.
The good thing about this is that it is very easy to add a cloned
machined to the network. (which is very useful in a regulated
environment). There is no worry about backing up root partitions
and restoring if a machine/disk fails. The nfs server can be
a simple default linux install with dhcp/nfs enabled, and all
you need to worry about is the backup of some config files and
the exported root directory structure. Very easy to restore in
case of a disaster.
The downside is that ram is wasted. However, today ram is
cheap, and after a good pruning, I cut down the root partition
to a very reasonable size.
Another downside is that you will go through a lot of misery,
and it is not something that somebody can really help you
from a remote location at the beginning, when help is actually
needed. The upside is that you will learn a lot.
Vilmos
"Magnate" <not@receiving.here> writes:
[color=blue]
>
> Um .... I thought files in /proc were not actually stored on the
> disk??[/color]
That's correct. Every piece of hardware in UNIX is accessed through a
filename. In particular, /proc is a special filesystem:
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
See proc(5)
The proc filesystem is a pseudo-filesystem which is used as an inter-
face to kernel data structures. It is commonly mounted at /proc. Most
of it is read-only, but some files allow kernel variables to be
changed.
On Thu, 18 Sep 2008, Christian Williamson wrote:
[color=blue]
> I've got Fedora 9 on my pc, and I want to run it out of RAM, essentially
> making the disk read-only. Can anyone point me to some instructs for this?
>[/color]
Maybe you should be more descriptive about what you want to do,
because it looks like this thread has gone off on a tangent, though
who knows.
Linux always runs out of RAM, the kernel is loaded, which then in
turn loads some other things and then you get a prompt, from where
you can load other things.
Hence it's not clear if you are asking for hints on dealing with
no writes to the hard drive, or if you are asking about something
else.
If you are asking about running Linux normally, then the issue
becomes turning off things like logging, and other things that
routinely write to disk, and then figure out how to deal with
things you need to save when the computer turns off.
An obvious example of this is the EEEPC, where it runs like
any Linux, but lacks a hard drive so you want to keep writes
down to a minimum. So logging is turned off (so I gather) and
yet when it's time to save a document, it gets written to the
flash drive that is the stand in for a hard drive.
I'm sure this sort of thing has been documented, but I can't
say where.
Michael
Christian Williamson a écrit :[color=blue]
>
> Thanks. BTW, Pascal, which group do you think I should I have posted the
> original in?[/color]
Sorry, I don't know the comp.os.linux.* hierarchy well enough to answer
this question.