Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: Mount / in RAM and load apps instantly
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Redmumba
n00b
n00b


Joined: 25 Aug 2008
Posts: 14

PostPosted: Wed Apr 22, 2009 12:38 am    Post subject: Reply with quote

I've read through all the posts, and tried some tweaking of my own, but it doesn't seem like I'm able to mount my initrd image. I'm receiving the same "linuxrc failed" reported earlier, but I'm actually not able to access ANY of the executables. But its saying that the ramdisk *is* being mounted on 1:0... booting back into my normal install, I mount the initrd image and all the files are there and have correct permissions.

Is there any reason why my initrd image wouldn't be loading, but say it is? Ramdisk and Initial Ramdisk support are _all_ built into the kernel, so I'm not sure what would be causing this...

Andrew


grub.conf
Quote:

title Gentoo Linux 2.6.29-r1 (w/ RAM disk!)
root (hd0,0)
kernel /gentoo-2.6.29-r1 root=/dev/ram0 rw init=linuxrc video=uvesafb:1440x900-32,mtrr:3,ywrap
initrd /initrd
Back to top
View user's profile Send private message
slick
Bodhisattva
Bodhisattva


Joined: 20 Apr 2003
Posts: 3495

PostPosted: Fri Jul 03, 2009 5:05 pm    Post subject: Reply with quote

Why dont try the simplest way:

- create a ramdisk (greater than du -sh /usr/lib), i.E.: mount none -t tmpfs /mnt/ramdisk
- copy all files from /usr/lib to the ramdisk, i.E.: cp -a /usr/lib/* /mnt/ramdisk
- mount the ramdisk to /usr/lib, i.E: mount -o bind /mnt/ramdisk/ /usr/lib/
- if you like to update your system, just umount /usr/lib and /mnt/ramdisk, update the system and do the stuff above again

(this can simple do in the background in /etc/conf.d/local.start)

Now OpenOffice and other big apps starts in <1 sec. and no extra modification on systemfiles are necessary, you probably need a little bit more ram (in my case ~ 1.2 GB only for the ramdisk )

;)

(sorry for my bad english)
Back to top
View user's profile Send private message
aych
Guru
Guru


Joined: 20 May 2004
Posts: 304

PostPosted: Fri Jan 01, 2010 5:26 am    Post subject: Reply with quote

what would the effect of this be, I presume the bootup times will suffer significantly..

I was thinking what would happen if it was a rc script on startup which allows for normal bootup from hard drive and standard usage. After normal loading then it will being populating a tmpfs with predefined folders etc, then after the tmpfs is setup mount the tmpfs over the existing /lib. would it cause system instability swapping over half way during normal usage?
Back to top
View user's profile Send private message
PhoeniXII
n00b
n00b


Joined: 23 Jun 2005
Posts: 29
Location: Holland aka "the flat country"

PostPosted: Sun Jan 30, 2011 2:23 pm    Post subject: Reply with quote

thanks for the great tip,

even though it ads approx 40 sec to my boot-up time,
since I put the whole /usr dir in mem,

but I never had such a responsive system before ^_^
Back to top
View user's profile Send private message
ChrisCummins
n00b
n00b


Joined: 03 Jan 2012
Posts: 7
Location: Birmingham, UK

PostPosted: Sat Jan 07, 2012 1:26 pm    Post subject: Reply with quote

I understand that this is an old thread, but it still seems relevant, so I'll just ask:

slick wrote:
Why dont try the simplest way:

...
- if you like to update your system, just umount /usr/lib and /mnt/ramdisk, update the system and do the stuff above again


Following those steps, sure enough I get the blindingly fast application load times, but I am unable to umount /usr/lib64 once I've set it up, even with --force. umount /mnt/ramdisk works but upon restart all changes to lib64 are lost. Any tips on how to unmount a stubborn tmpfs?

Regards
Chris
Back to top
View user's profile Send private message
arhenius
Tux's lil' helper
Tux's lil' helper


Joined: 19 Mar 2007
Posts: 81
Location: Portugal

PostPosted: Thu Aug 02, 2012 9:38 pm    Post subject: Reply with quote

Hello Chris

I suppose you are copying /usr/lib* to the ramdisk at boot time using a script in /etc/init.d/local.

If that is your setup, perhaps commenting those lines out, rebooting the system, doing the upgrades, uncommenting those lines and rebooting will probably work.

I'd like to do this in my laptop, has anyone tried it? How does it affect the battery life?

Cheers
Filipe
_________________
Filipe
Back to top
View user's profile Send private message
PM17E5
Apprentice
Apprentice


Joined: 10 Feb 2009
Posts: 241

PostPosted: Thu Aug 02, 2012 9:42 pm    Post subject: Reply with quote

I'm also interested. I already use fstab to mount /var/tmp /tmp /home/user/.mozilla but I wouldn't mind doing my whole system since I got 16 gigs of ram. Curious what's the best way of achieving this.
Back to top
View user's profile Send private message
arhenius
Tux's lil' helper
Tux's lil' helper


Joined: 19 Mar 2007
Posts: 81
Location: Portugal

PostPosted: Fri Aug 03, 2012 7:36 am    Post subject: Reply with quote

Quote:
I already use fstab to mount /var/tmp /tmp /home/user/.mozilla


I was thinking on doing that also, would you share your experience on how does that affect battery life and system responsiveness?

Cheers
Filipe
_________________
Filipe
Back to top
View user's profile Send private message
PM17E5
Apprentice
Apprentice


Joined: 10 Feb 2009
Posts: 241

PostPosted: Fri Aug 03, 2012 12:51 pm    Post subject: Reply with quote

Hmm to be honest I'm not sure how it effects my battery life, I have an i7 ultrabook so it's already pretty shortlived. Usually when I'm mobile and I'm not doing anything intensive I have /etc/init.d/cpufrequtils turned on. Here's what I put in my /etc/fstab:

Code:
tmpfs           /tmp                            tmpfs   nodev,nosuid,noexec                     0 0
tmpfs           /var/tmp/                       tmpfs   nodev,nosuid                            0 0
tmpfs           /home/user/.mozilla           tmpfs   nodev,nosuid,noexec                     0 0


Then I have two files in /etc/local.d:

mozilla.start:

Code:
cp -pr /home/user/.mozilla1/* /home/marker/.mozilla/


mozilla.stop:

Code:
rm -rf /home/marker/.mozilla/*


You have to make sure they're executable (chmod +x mozilla.start mozilla.stop). I've seen people make really complex scripts for all of this and have 10 page long discussions on how to do it, but I really don't get why it needs to be so complex. I don't like the idea of using tar to archive it or unarchive it every time you start up or shut down because that's just adding on more delay. I have an SSD drive so copying my mozilla forlder into ram is pretty much instantaneous. I kind of like not saving all of those 3 folders because it keeps the system a little cleaner. You can modify yours to move it back, and make occasional backups for the accidental shutdown, but I chose to just set up my browser once how I like it and have it clear every time I reboot so any browsing data/settings/accidentally added on crap/etc is gone and I have a freshly set up browser every time I reboot. The only time this kind of becomes annoying is if you get plugin updates and you have lots of plugins.

The reason I clear it at all when I shut down is incase I restart the script while it's running if I experience anything funny with my firefox profile.

But the reason I posted in this thread, is I have 16 gigs and I would actually like to eventually just throw my whole system into ram. But I'm not really sure how safe/good this solution is and what's the best way to do it.

Responsiveness? Firefox flies, loads in the blink of an eye with 0 delay. Emerging packages seems to have gotten a nice boost in speed as well. I'd gladly put in 10 times as much time as I spent setting up a couple of those things, for the increase in reponsiveness I've obtained :).
Back to top
View user's profile Send private message
Hell-Razor
Guru
Guru


Joined: 10 Jun 2004
Posts: 458

PostPosted: Mon Jun 09, 2014 2:24 am    Post subject: Reply with quote

Are people still using this? some of us poor fellows that just have norma sd dries and not SSDs may benefit. Anybody that has done this (and has for a long time) any updates?
_________________
Don't ever tell anybody anything. If you do, you start missing everybody.
Back to top
View user's profile Send private message
Petros
n00b
n00b


Joined: 28 Mar 2015
Posts: 50

PostPosted: Fri Jun 05, 2015 8:41 pm    Post subject: Reply with quote

slick wrote:
Why dont try the simplest way:

- create a ramdisk (greater than du -sh /usr/lib), i.E.: mount none -t tmpfs /mnt/ramdisk
- copy all files from /usr/lib to the ramdisk, i.E.: cp -a /usr/lib/* /mnt/ramdisk
- mount the ramdisk to /usr/lib, i.E: mount -o bind /mnt/ramdisk/ /usr/lib/
- if you like to update your system, just umount /usr/lib and /mnt/ramdisk, update the system and do the stuff above again

(this can simple do in the background in /etc/conf.d/local.start)

Now OpenOffice and other big apps starts in <1 sec. and no extra modification on systemfiles are necessary, you probably need a little bit more ram (in my case ~ 1.2 GB only for the ramdisk )

;)

(sorry for my bad english)


Why unmounting those directories? Couldn't someone just write the changes to the actual fs with sync or something? You know sync the contents of the disk with those on the ramdisk.
Back to top
View user's profile Send private message
Petros
n00b
n00b


Joined: 28 Mar 2015
Posts: 50

PostPosted: Sat Jun 06, 2015 9:36 am    Post subject: Reply with quote

Code:
#!/bin/sh
mkfs -t ext2 -q /dev/ram50 180000
[ ! -d /ramlib64 ] && mkdir -p /ramlib64
mount /dev/ram50 /ramlib64
/bin/cp -r /lib64/* /ramlib64
mount -o bind /ramlib64 /lib64


This content is under /etc/local.d/initramlib64.start

It doesn't work because Linux doesn't let to login. As soon I give the root name it prints "Login incorrect". Before that and during boot, it rants about "No space left on device" or something like this while copying (I suppose). My /lib64 is about 150MB and my ramdisk about 180M. What am I missing?
Back to top
View user's profile Send private message
Petros
n00b
n00b


Joined: 28 Mar 2015
Posts: 50

PostPosted: Sat Jun 06, 2015 12:21 pm    Post subject: Reply with quote

Petros wrote:
Code:
#!/bin/sh
mkfs -t ext2 -q /dev/ram50 180000
[ ! -d /ramlib64 ] && mkdir -p /ramlib64
mount /dev/ram50 /ramlib64
/bin/cp -r /lib64/* /ramlib64
mount -o bind /ramlib64 /lib64


This content is under /etc/local.d/initramlib64.start

It doesn't work because Linux doesn't let to login. As soon I give the root name it prints "Login incorrect". Before that and during boot, it rants about "No space left on device" or something like this while copying (I suppose). My /lib64 is about 150MB and my ramdisk about 180M. What am I missing?


I discovered that I had a directory /lib64/ramdisk/{The whole lib64 dir from previous mv}. This explaines the "No space left" message.
I tried to do this:
Code:
mkfs -t ext2 -q /dev/ram50 180000
[ ! -d /mnt/lib64 ] && mkdir -p /mnt/lib64
mount /dev/ram50 /mnt/lib64
/bin/cp -r /lib64/* /mnt/lib64
mount -o bind /mnt/lib64 /


But it whipped my /lib64. Fortunately I had a squashed backup and I restored it from my Arch.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6
Page 6 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum