LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-04-2012, 09:48 PM   #1
adamforum
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Rep: Reputation: Disabled
How to install Slackware so the entire OS boots to and executes entirely in RAM?


Hello all,

I have an "Embedded Box IPC" that I want to use for executing a handful of simple, recurring automation tasks. In case you are curious, the specific device I am using is: http://www.advantech.com/products/AR...1C638B492.aspx

Please note that while this device is a pile of garbage by today's standards, it is actually overkill for the automation purposes I am using it for.

Device specs: 2 GB SD Flash Memory (Hard disk), 64 MB RAM, 150 MHz processor

I've messed around with several flavors of Linux and Slackware 12 is the best one I have found that works with this device (shell only, no UI stuff)

As the device uses a SD Flash card for the hard disk, I want to minimize read/writes to it. Googling, I think what I want is a "Ram disk"?

I envision the system booting, loading from the SD Flash card into RAM. After the files are loaded to RAM, everything executes from RAM (no reads or writes to the SD Flash card for /tmp, or other files.

A bare bones configuration is preferred. I need to maintain network support (the tool I wrote for issuing the automation commands requires tcp/ip) as does the SSH Daemon I use to configure the device.

Any suggestions or advice on how to accomplish this?

Thanks,

Adam
 
Old 01-04-2012, 10:30 PM   #2
Konphine
Member
 
Registered: Jul 2011
Location: Phoenix, New York
Distribution: Slackware 13.37
Posts: 376

Rep: Reputation: 11
I believe you can edit your /etc/fstab to run the parts of your computer in RAM.
 
1 members found this post helpful.
Old 01-05-2012, 12:31 AM   #3
piratesmack
Member
 
Registered: Feb 2009
Distribution: Slackware, Arch
Posts: 519

Rep: Reputation: 143Reputation: 143
I think the easiest way to do that is to put the entire rootfs inside an initrd/initramfs.

Slackware would have to be stripped down pretty good to run inside 64 MB of RAM though.
Maybe you can start with initrd.img from the installer and add what you need to it.

Last edited by piratesmack; 01-05-2012 at 12:33 AM.
 
1 members found this post helpful.
Old 01-05-2012, 12:38 AM   #4
adamforum
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Konphine View Post
I believe you can edit your /etc/fstab to run the parts of your computer in RAM.
Thanks for that tip.
 
Old 01-05-2012, 12:47 AM   #5
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,124

Rep: Reputation: 4198Reputation: 4198Reputation: 4198Reputation: 4198Reputation: 4198Reputation: 4198Reputation: 4198Reputation: 4198Reputation: 4198Reputation: 4198Reputation: 4198
I think 64Mb of RAM are needed to *run* a barebone slack, it surely won't be room enough to load also an image of the OS.

If you are interested in reducing the I/O on the drive, have a look at this article, it's written for debian but most of the things apply also to slack.

http://www.cyrius.com/debian/nslu2/linux-on-flash.html
 
1 members found this post helpful.
Old 01-05-2012, 12:57 AM   #6
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
I think the only parts of the file system that need to be writable are /var and /tmp the rest of it should be able to mounted read only and thus avoid excessive writes to the flash card.

/tmp can just be mounted at boot time via fstab as it is considered to be an unsafe storage area between reboots
/var is the hard one as it requires state data to be maintained across reboots

So you can either go with the easy method and start the system with a default /var from install or you can edit the scripts some more and save /var over the reboot to maintain the state data.

EDIT: Memory and Slackware 12.0, 64MB is quite a lot so this should work.
 
1 members found this post helpful.
Old 01-05-2012, 04:40 AM   #7
jimmy_page_89
Member
 
Registered: Sep 2010
Location: Turin (Italy)
Distribution: Slackware 14.2
Posts: 51

Rep: Reputation: 4
You can compresso all your slackware on a squashfs image, that you mount on ram.
only you have to create an initrd at boot.
 
Old 01-05-2012, 06:39 AM   #8
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486
Blog Entries: 4

Rep: Reputation: 282Reputation: 282Reputation: 282
I did it with an old version of slack. I installed just the A set then I think a few packages from N and such. I did as you and googles linux ramdrive then set that up early. So I would just find the init script where root was remounted r/w and remark that line then reboot and watch to see where it failed then mount my flash card in another system and remark out that line.
A few things I wanted like /var/log/messages I would just link to the ram drive so I had to touch the files right after creating the ramdrive so the links would be valid.
I probably still have that flash card laying in my drawer, will have to look.
 
Old 01-06-2012, 10:55 AM   #9
gargamel
Senior Member
 
Registered: May 2003
Distribution: Slackware, OpenSuSE
Posts: 1,839

Rep: Reputation: 242Reputation: 242Reputation: 242
I cannot really contribute with any hints or tips, how to do it, but you might have a look at a live distro and see, how they do it. Good examples with relatively small footprint appear to be Puppy, Tiny Core and SLAX. New, but possibly also interesting is Porteus.

SLAX and Porteus are based on Slackware, so they might be the first to look at.

Good luck!

gargamel
 
  


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
Can the entire MTD be used as RAM? chaz_bro1972 Linux - Embedded & Single-board computer 0 12-06-2008 02:05 AM
How can I make an entire slackware install run from a USB? Romanus81 Slackware 6 11-11-2008 05:34 PM
redhat enterprise linux 4 boots slow with 2 GB RAM , boots fast with 512MB robinsingh Linux - Hardware 14 08-26-2008 11:34 PM
Wiped Entire Hard Drive and Want To Install Slackware Midnyt Slackware 3 09-04-2006 05:58 PM
Slackware 10.2 install - boots from CD but doesn't recognize drive irongun324 Slackware - Installation 7 03-21-2006 07:19 PM

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

All times are GMT -5. The time now is 01:38 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