SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How would I install all of Slackware to a RAM disk, not just the kernel and modules with mkinitrd?
I know Porteus has an option which essentially seems to copy the root, "/", to a RAM disk. How does it do it?
Would I just need to make a huge initrd image? If so, how would I do that?
Specifically: What I would like to do is boot off the Slackware ISO, mount a RAM disk, run the Slackware installer to install to the RAM disk, and then pack the entire RAM disk into an initrd image. How would I do this?
thanks
Last edited by Geremia; 12-13-2014 at 04:17 PM.
Reason: added more detail into a "specifically" section
Just an addendum: Checking the Linux source code, initramfs.c appears to error out unless the initrd file is, very specifically, a "newc" (SRV4 sans CRC) formatted file, optionally compressed.
/usr/src/linux-3.10.17/init/initramfs.c on my machine, line 231. Haven't checked newer kernels to see if they've expanded to accept other formats for initramfs.
That's specific to the initramfs method; using the initrd method, a filesystem image may be used instead, formatted to any filesystem supported in the kernel (ext2, ext3, fat, etc).
http://en.wikipedia.org/wiki/Initrd does a pretty good job of explaining the differences between initramfs method (used by Slackware) and initrd method.
installpkg --root /tmp/initrd <list of /paths/to/the/packages>
What I would like to do is boot off the Slackware ISO, mount a RAM disk, run the Slackware installer to install to the RAM disk, and then pack the entire RAM disk into an initrd image. How would I do this? thanks
What I would like to do is boot off the Slackware ISO, mount a RAM disk, run the Slackware installer to install to the RAM disk, and then pack the entire RAM disk into an initrd image. How would I do this? thanks
That's what you stated in your first post. But re-reading it I don't understand what you mean by "mount a RAM disk". Could you give an example? I'm puzzled because somehow, once loaded in memory the initrd from the installer (file /syslinux/initrd.gz) is a RAM disk, or I misunderstand what a RAM disk is (which is very possible). Why would you need another one?
Also, out of curiosity: why do you want to do all that?
PS Having seen a similar thread you created, I assume you want to speed up you Slackware. Then you can just do this:
Then write for instance a relevant file isolinux.cfg in /ram alongside a kernel then use the mkisofs command to write a bootable iso file with the content of /ram and make it bootable off USB using the isohybrid command.
PS Bear in mind that as soon as you reboot or shutdown all will be lost
Last edited by Didier Spaier; 12-13-2014 at 06:36 PM.
That's what you stated in your first post. But re-reading it I don't understand what you mean by "mount a RAM disk". Could you give an example? I'm puzzled because somehow, once loaded in memory the initrd from the installer (file /syslinux/initrd.gz) is a RAM disk, or I misunderstand what a RAM disk is (which is very possible). Why would you need another one?
Also, out of curiosity: why do you want to do all that?
To speed things up
Quote:
Originally Posted by Didier Spaier
PS Having seen a similar thread you created, I assume you want to speed up you Slackware. Then you can just do this:
Then write for instance a relevant file isolinux.cfg in /ram alongside a kernel then use the mkisofs command to write a bootable iso file with the content of /ram and make it bootable off USB using the isohybrid command.
PS Bear in mind that as soon as you reboot or shutdown all will be lost
I think you have misunderstood my question. I don't want to store an initrd on a RAM disk. By "mount a RAM disk" I mean use some of my RAM as a filesystem (e.g., as described here, although I don't know how he mounts a RAM disk is the best way in Slackware). I want to copy the contents of the RAM disk (not the initrd image) to my hard disk whenever the machine reboots or shuts down. So, your script above should read something like this:
OK, then just follow the answers to the post you linked to.
You'll have to find by yourself what are the appropriate places to insert the codes snippets in the Slackware init scripts.
But I strongly advise you against doing that, as if your systems hangs or halt without executing the shutdown script for any reason - and believe me, things like that happen -, all you'll have done in RAM will be lost. The speed gain is not worth the risk, IMO.
I have to second what Didier says. The likelihood of you losing something is quite high. Also, the copy process on startup/shutdown would be enormous if you're copying several GBs worth of data from hard drive to the RAM or vice versa. And unless you have a lot of RAM, you could be limiting the available RAM to Slackware, which could seriously hinder your performance.
A better option is probably spending some money on a decent SSD (if you want to go even faster, you could get a second drive and use RAID) and then selectively mounting certain things into RAM, like the /tmp directory, or your firefox profile.
However, I am more than willing to give you the warnings to not shoot yourself in the foot, and then hand you the gun... If you really want to look at doing this, you could probably use the basics of loading the firefox profile into RAM and branch out from there. They cover using rsync to sync things with the hard drive to minimize loss. Hopefully you can pull it off without losing any toes
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.