LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 09-14-2007, 04:18 PM   #1
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Rep: Reputation: 15
run on ramdrvie


what distribution would be best to start out with for my project? I would like one based off red hat, like fedora core, or centos (centos preferred) I need it to be installed to a hard drive, then when it boots, load a ram drive and copy everything to it and shut down the hard drive after a few minutes and unmount it. brazil firewall does something like this, but there is a lot I can't do with it. I need to be able to run apache, php, mysql, gcc, and my own software, along with the router software. centos is what I usually use for servers, but how do I get that to run from ram?

another method I was thinking about, maybe use a centos live cd, but I have to be able to easily make changes to the config and permanently install other software. would I be able to write a script to copy files from a hard drive and unmount it after starting the boot from the cd-rom, but before loading any services?
 
Old 09-16-2007, 01:16 AM   #2
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
I guess the biggest question is, why do you want to run from a ramdrive? It sounds like you are working on a sort of hardened-server, so I would guess that the purpose is to make the root file-system immutable? If this is the case, I would recommend the use of optical (CD/DVD) media. Anyhow, you asked about a distro, so I should try to answer that :-). I see no reason why this couldn't be done based on CentOS, and you say it is your preferred. Whatever distro you choose get ready to use some elbow grease, because to pull this off you're going to write custom init scripts.

As a side note: I know you haven't actually said that a server is the end goal, but I'm guessing it is, so I'll issue this warning. I saw you list gcc as a desired application, but having a compiler on a server represents a slight security risk.
 
Old 09-16-2007, 01:36 AM   #3
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Original Poster
Rep: Reputation: 15
the main reason I'd like to run it from a ramdrive is to not have a hard drive running 24/7 in the server. as I said in my original post, I'm currently running brazil firewall. that extracts tar files into the ram drive before booting the system. a minute after the booting completes, the hard drive turns off making the system quieter and more reliable. the only moving parts in the system are fans. gcc would have to be on the server to compile my code for one of the daemons that will be running on it. if I have to, I can use a cd to boot from, but I need some method that will be easy to install a newer version of my software. a hard drive would make it easier to push the new code to live production for final testing and use, and would allow me to save config files permanently when needed.

if you know of any good tutorials or books that would help me do this, it would be a big help. I am far from being a kernel hacker. I'm learning as fast as I can and enjoying every minute of it.



Quote:
Originally Posted by PatrickNew View Post
I guess the biggest question is, why do you want to run from a ramdrive? It sounds like you are working on a sort of hardened-server, so I would guess that the purpose is to make the root file-system immutable? If this is the case, I would recommend the use of optical (CD/DVD) media. Anyhow, you asked about a distro, so I should try to answer that :-). I see no reason why this couldn't be done based on CentOS, and you say it is your preferred. Whatever distro you choose get ready to use some elbow grease, because to pull this off you're going to write custom init scripts.

As a side note: I know you haven't actually said that a server is the end goal, but I'm guessing it is, so I'll issue this warning. I saw you list gcc as a desired application, but having a compiler on a server represents a slight security risk.
 
Old 09-16-2007, 01:49 AM   #4
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
I suspect that you will have the best luck basing this off a minimalist distro such as DSL. I don't know anything about the specs of the machine running this, but remember that you'll have to fit the entire root file system onto this ramdrive, as well as provide actual memory to running applications. The biggest strain may come from holding whatever files you need to serve in ramdisk as well.

Might I recommend an alternative which provides equivalent results minus the elbow grease? You could instead purchase a CF-to-IDE adapter. These generally run about $20 and allow you to plug a compact flash card in as a hard drive. Then simply install to the CF "hard disk". This circumvents all advanced bootscripting, etc. You still avoid moving parts - CF has no moving parts, nor does the adapter add any. Your computer will still run quieter, cooler and more efficiently - without reducing the amount of available RAM.

The downside is, of course, that it requires you to spend more money. I don't know where your $$$ barrier lies, but at ~$20 for the adapter and ~$40 for 4GB of CF or $30 for 2GB, you may need to consider the value of the time you would put in.
 
Old 09-16-2007, 12:18 PM   #5
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Original Poster
Rep: Reputation: 15
someone reminded me the other day when we were talking about maybe using a usb flash drive, too many reads and writes to the drive and it will fry.. I really don't know how often the system will write to the drive or how long a flash drive would last. if I get rid of most of the logs in linux, there might only be 1 or 2 in my own software, but then there is mysql running on the system too. if I knew a CF would last me a few years, I would go that route.


Quote:
Originally Posted by PatrickNew View Post
Might I recommend an alternative which provides equivalent results minus the elbow grease? You could instead purchase a CF-to-IDE adapter. These generally run about $20 and allow you to plug a compact flash card in as a hard drive. Then simply install to the CF "hard disk". This circumvents all advanced bootscripting, etc. You still avoid moving parts - CF has no moving parts, nor does the adapter add any. Your computer will still run quieter, cooler and more efficiently - without reducing the amount of available RAM.
 
Old 09-16-2007, 09:18 PM   #6
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
A CF disk should, generally speaking, outlive it's hard disk counterpart. When the OLPC project wanted to increase the durability and lifespan of their laptops, the first thing they did was to scrap a hard disk in favor of flash memory. Note that I'm talking about a CF *card*, not a usb drive - I'm unsure how many assumptions you can make about the internals of an arbitrary usb drive.
 
Old 09-16-2007, 09:33 PM   #7
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Original Poster
Rep: Reputation: 15
ok, thank you. if you're right, this solution should make the project much more simpler, and I can focus more on programming the home automation software.
 
Old 09-16-2007, 09:54 PM   #8
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
Hrmm, further research confirms that there are concerns about flash memory wearing out. However, this can be helped by simply switching over to JFFS2. Essentially, I was wrong and they do wear out faster than hard drives. However, it should last several ~7-8 years, by which time everything will probably be up for an upgrade.
 
Old 09-16-2007, 10:05 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,704

Rep: Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897
Flash memory regardless of format i.e. CF, USB, camera memory sticks, solid state drives etc etc all have a limited number of write/erase cycles (there is no limit on reads). The best have about 1,000,000 cycles. Both CF and USB have built in logic that does "wear leveling" to keep from burning out individual cells to quickly. Unfortunately I do not have any actual lifespan data but it should be many years with normal usage.

I have had a USB flash drive fail but I could not say if I "burned" it out or not.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is a script, run at boot time from init.d, run with root authority? tmbrwolf53 Linux - Server 2 03-31-2007 08:15 PM
A lot of processes run automatically when I run a single process. dalvirgautam Linux - Enterprise 4 12-01-2006 06:10 PM
Cannot get NVIDIA-Linux-x86_64-1.0-6629-pkg2.run to run properly doctorwebbox Linux - Hardware 0 02-06-2005 06:18 AM
Not able to run audio Cds (not MP3) and run VCDS.. satish427 Linux - Newbie 4 09-24-2004 11:27 PM
Java applets run fine in Konqueror, but won't run in MS IE. OAnimal Linux - Software 7 12-04-2002 06:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 11:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration