Mounting directories in RAM to load apps instantly

I saw this on the gentoo forums.
http://forums.gentoo.org/viewtopic-t-296892.html
Can we do anything like this in arch? I've got 4gigs of ram, so plenty to spare.
I'm also pretty nooby, so please be specific if you can about what commands to run and whatnot.
Here's the original text copied:
I figured this out based on this post:
So you want to mount / in RAM for a super-speedy system?
Here's what you need to make your gentoo FLY
/usr must be on it's own partition
/home must be on it's own partition if it's large or you use it for storage
/root must be on it's own partition if you're putting anything big in it
/var on it's own partition (so we don't fill up the RAM drive with logs/portage cache)
an empty directory called /newroot
You must have a partition to store the tarballs on (I use the same partition that ends up being /root) and it can't be /usr.
Maybe use the partition that was / during the install
computer must have a spare 176MB of RAM or so.
(Depends how much you want to load into RAM)
You need to have ramdisk, initial ramdisk, loopback device support in the kernel, not as modules.
These choices can be found under block devices, which is under device drivers.
The amount of performance boost in order of magnitude, by which is loaded into RAM seems to be
/usr/lib
/lib
/usr/bin
/bin
/usr/sbin & /sbin
Step 1
Install as normal
Step 2
generate the tarballs that will populate our RAM drives
put this in /sbin so you can run it should you update your system (make sure STORE is mounted first if applicable!):
Code:
echo /sbin/update-balls >> /etc/conf.d/local.stop
chmod +x /sbin/update-balls
cat /sbin/update-balls
#!/bin/sh
CURRDIR=`/bin/pwd`
STORE="root"
cd /
#Exclude anything that's on it's own partition here
tar cfp ${STORE}/fs.tar * --exclude=usr/* --exclude=root/* --exclude=home/* \
        --exclude=proc/* --exclude=sys/* --exclude=tmp/* --exclude=var/*  \
        --exclude=opt/*
cd /usr/
# rm -fr /usr/bin /usr/sbin /usr/lib
# cp -a /usr/.bin /usr/bin
# cp -a /usr/.sbin /usr/sbin
# cp -a /usr/.lib /usr/lib
cd bin && tar cfp /${STORE}/usr_bin.tar *
cd ../sbin && tar cfp /${STORE}/usr_sbin.tar *
cd ../lib && tar cfp /${STORE}/usr_lib.tar *
# rm -fr /usr/bin /usr/sbin /usr/lib
# mkdir /usr/bin /usr/sbin /usr/lib
cd $CURRDIR
Step 3
Now we have to make an initrd to perform the population of our RAM drive before we load init:
Code:
mount /boot #If necessary
touch /boot/initrd
dd if=/dev/zero of=/boot/initrd bs=1024k count=8
losetup /dev/loop0 /boot/initrd
mke2fs /dev/loop0
Now we have loop0 mounted as the initrd. Time to populate it:
Code:
mkdir /mnt/initrd
mount /dev/loop0 /mnt/initrd
cd /mnt/initrd
mkdir etc dev lib bin proc new store
touch linuxrc etc/mtab etc/fstab
chmod +x linuxrc
for I in sh cat mount umount mkdir chroot tar; do cp /bin/$I bin/; done
cp /sbin/pivot_root bin/
We need a /newroot directory to hold the initrd after the system's booted.
Code:
mkdir /newroot
Now we have to copy the libraries that each of these binaries needs. You can determine this a la:
Code:
ldd /bin/sh
linux-gate.so.1 =>  (0xffffe000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7fe2000)
        libc.so.6 => /lib/tls/libc.so.6 (0xb7eca000)
        /lib/ld-linux.so.2 (0xb7feb000)
means we need /lib/libdl.so.2 /lib/tls/libc.so.6, lib/ld-linux.so.2
Here's what I needed in total:
Code:
ls -R lib
lib:
ld-linux.so.2  libblkid.so.1  libdl.so.2  libuuid.so.1  tls
lib/tls:
libc.so.6  libpthread.so.0  librt.so.1
Please check each of your binaries in case you need something I don't. Then we need to write the linuxrc script that does the dirty work:
Code:
cat /mnt/initrd/linuxrc
#!/bin/sh
export PATH=/bin
STOREDEV=/dev/hda10
STORE=/store
ROOTSIZE=128m
# Get kernel CMDLINE
mount -t proc none /proc
CMDLINE=`cat /proc/cmdline`
umount /proc
mount $STOREDEV $STORE
# Mount root and create read-write directories
mount -t tmpfs -o size=$ROOTSIZE none /new/ > /dev/null 2>&1
cd /new/ && tar xpf $STORE/fs.tar > /dev/null 2>&1
umount $STOREDEV
# Pivot root and start real init
cd /new
pivot_root . newroot
exec chroot . /bin/sh <<- EOF >dev/console 2>&1
exec /sbin/init ${CMDLINE}
EOF
Once that's done, we need to make the device nodes that this will use:
Code:
mknod /mnt/initrd/dev/console c 5 1
mknod /mnt/initrd/dev/null c 1 3
mknod /mnt/initrd/dev/hda b 3 0
mknod /mnt/initrd/dev/hda4 b 3 4
mknod /mnt/initrd/dev/hda10 b 3  10
You only need the nodes for the mounts that the linuxrc script uses (see /usr/src/linux/Documentation/devices.txt)
And that's it for the initrd
Code:
umount /mnt/initrd
Step 4
Modify /etc/init.d/localmount
Code:
start() {
        USRBINSIZE=32m
        USRSBINSIZE=2m
        USRLIBSIZE=256m
        # Mount local filesystems in /etc/fstab.
        ebegin "Mounting local filesystems"
        mount -at nocoda,nonfs,noproc,noncpfs,nosmbfs,noshm >/dev/null
        eend $? "Some local filesystem failed to mount"
        ebegin "Mounting RAM filesystems"
        mount -t tmpfs -o size=$USRBINSIZE none /usr/bin > /dev/null 2>&1
        mount -t tmpfs -o size=$USRSBINSIZE none /usr/sbin > /dev/null 2>&1
        mount -t tmpfs -o size=$USRLIBSIZE none /usr/lib > /dev/null 2>&1
        cd /usr/bin && tar xpf /root/usr_bin.tar > /dev/null 2>&1
        cd /usr/sbin && tar xpf /root/usr_sbin.tar > /dev/null 2>&1
        cd /usr/lib && tar xpf /root/usr_lib.tar > /dev/null 2>&1
        eend $? "Some RAM filesystems did not mount"
Step 5
Modify the bootloader
Code:
cat /boot/grub/grub.conf
timeout 3
default 0
# For booting GNU/Linux from an existing install (rescue)
title  Gentoo
root (hd0,0)
kernel /bzImage root=/dev/ram0 rw init=linuxrc video=vesafb:ywrap,pmipal,1024x768-16@70
initrd /initrd
Step 6
If you find that /usr/lib is too big to make a reasonable RAM drive, perhaps move some things to /usr/local/lib/ and link them, eg:
Code:
cd /usr/lib
for I in perl5 python2.3 portage modules gcc gcc-lib; do
mv $I ../local/lib/
ln -s ../local/lib/$I $I
done
Putting portage in the RAM drive sure is a nice speedup, tho.
Code:
time /usr/bin/emerge -s mozilla
real    0m3.680s
user    0m2.978s
sys     0m0.131s
Step 7
Finalizing
Code:
mv /usr/sbin /usr/.sbin
mv /usr/bin /usr/.bin
mv /usr/lib /usr/.lib
reboot
###########Aside##########
If you just want to load certain applications from a RAM disk, you can do something like the following
Code:
##do this in advance
tar cpf /root/preload.tar /usr/bin/firefox /lib/and /lib/all /usr/lib/of /usr/lib/the /lib/raries/ it's/dependent /lib/on
##replace all the original bins and libraries with links to /preload/whatever
##Then put this in /etc/conf.d/local.start
mount -t tmpfs -o size=128m none /preload > /dev/null 2>&1
cd /preload && tar xfp /root/preload.tar

Being honest, although it is possible, the use of RAMdisks is no longer needed on modern hardware as the speed of physical disks has improved significantly over recent years.  Its use is most beneficial in embedded systems or older hardware where your drive speed is quite low. Don't forget that the OS caches all operations to disk anyway, run xosview (if you have it installed - which you should, it's cool ) and have a look at what is going on.  The vast majority of your  memory usage will be cached.  This is all the apps/files you have opened previously, so when you run something chances are you aren't running it from disk, but rather from RAM anyway.

Similar Messages

  • New loaded apps are working but the app button shows only grey - please help

    New loaded apps are working but the app button shows only grey - please help...I have this problem since 3 days ago. I have synchronized and restart my iPad but the matter didn't changed

    well in thatcase, i need another help .
    thanks for your instant reply.
    i have currently bought a new laptop (windows 8) and my iphone is not being recognized by itunes.
    because i have no backup on my previous laptop, i downloaded touchcopy but even touch copy is not recognizing my iphone.

  • Ever since I updated to Maverick my MacBook is slow to load apps

    Since I updated to Maverick my MacBook is slow to boot up after being shut down and is slow to load apps (excessive bounce, etc.). Is there a solution?

    Your model is right at the cutoff of models that can handle Mavericks, so you need to keep that in mind: an older machine and less powerful processor. Aside from that, you should really have a minimum of 4 GB of RAM for Mavericks to run reasonably well - how much RAM do you have? The 2 GB minimum published does not work that well unless you only use one app at a time.
    So, if you've maxed out the RAM, make sure you don't run too many apps at the same time, especially if dealing with photo editing or movie apps and quit one before starting another. Also make sure you have plenty of empty hard drive space at all times.

  • My iPhone 4S will not connect to the internet properly. It says that it is connected, the App Store won't load apps and I can't get on my face book app. I have tried wifi and my cellular data, neither work. What are some ways to fix this?

    My iPhone will
    not connect to the internet properly. It says that it is connected, the App Store won't load apps and I can't get on my face book app. I have tried wifi and my cellular data, neither work. What are some ways to fix this?

    Try resetting your network settings.
    Settings>Genenal>Reset>Reset Network Settings.

  • My new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help

    my new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help
    my iphone4 is 10 times faster
    i have backed up on itunes and restored but still no luck
    even siri is lagging

    my new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help
    my iphone4 is 10 times faster
    i have backed up on itunes and restored but still no luck
    even siri is lagging

  • Loading Apps and PDFs to multiple iPads with different Apple IDs

    Hello,
    We are deploying 200+ iPads to our business and we are configuring each of the devices individually on-sight. We have received each employee's Apple ID and password for these corporate devices.
    We want to load 7 free apps to each iPad and a variety of PDFs to iBooks before we deploy the devices. We have experimented with Apple Configurator for the Apps and iTunes for the PDFs and run into a few problems.
    Apps:
    When we loaded these 7 free apps using Apple Configurator from a Macbook Pro to an iPad with a different Apple ID, we had no problem. The iPad user was able to download other apps using their own Apple ID without any issues. The problem came when we tried to update these originally loaded apps. When the user is prompted to update, the Macbook Pro user's Apple ID showed up with the update and there was no way to get around that even though the device was logged into the iPad owner's Apple ID in the settings.
    Is there a way to push multiple apps from one device to another without have two different Apple IDs sitting on the one device?
    PDFs:
    A similar problem happened with iTunes and iBooks. When we pushed PDFs from the Macbook owner's iTunes to the iPad, there was no problem. When the iPad user tried to upload some of her own PDFs from her Apple ID in iTunes, the originally loaded PDFs were wiped.
    Is there a way for both sets of PDFs to stay on the device in iBooks without either getting wiped?

    I don't really have any solutions other than uploading the files to cloud storage such as drop box, google, or skydrive and then sharing them to all the users.
    You can try these links however:
    Mobile Device Management
    Amtelnet MDM
    http://www.amtelnet.com/mdm/mobile-device-management.php
    Meraki MDM
    http://www.meraki.com/products/systems-manager/
    Here's information regarding rolling out iOS devices across an organization, business or educational establishment:
    http://www.apple.com/support/ipad/enterprise/
    And here's about bulk app purchasing:
    http://www.apple.com/business/vpp/

  • How do I delete a down loaded app from my Iphone?

    How do I delete a down loaded app from my iphone?
    I'm new to the iphones and still learning. We don't use our phones that much as we still have a land line. My husband and I are both in our seventies and are slow learners. We bought the phone to use in the car for the GPS and what ever.  I down loaded some games but after looking at them I don't like them, and would like to take them off. If any one can help Thank you.
                                                                                                                    Gr8grandma

    Tap and hold on the app until it juggles and displays a red X. Tap on the X to delete the app.

  • TS1702 My 3G iphone only loads few apps since I updated and the camera doen't work anymore, what now. Tried to reset to original settings and now it won't load apps, even old ones.

    My 3G iphone only loads few apps since I updated and the camera doen't work anymore, what now. Tried to reset to original settings and now it won't load apps, even old ones.

    What model iPod do you have? If yo have a 2G iPod. many developers when they updated their apps to support iOS 5 and 6 dropped compatibility for iOS 4.2.1 and earlier.

  • Can't load App Store on my macBook Pro.  Error is; You cannont open the application "App Store" because it is not supported on this system.  How can I upgrade App Store or download new version?

    Can't load App Store on my macBook Pro.  Error is; You cannont open the application "App Store" because it is not supported on this system.  How can I upgrade App Store or download new version?

    Problem now resolved as I upgraded to Snow Leopard 10.6.  Seems App Store doesn't like anything previous to 10.6.

  • Slow loading apps

    after this his update some my apps (Instagram) are slow to load Over wifi. Anyone else having this issue?

    HI Shal!
    I want you to have a great experience with your apps! I'd like to ask if you have any issues loading apps over the VZW network? A suggestion for Wifi is to "fotget" the Wifi connection, then reconnect with the Wifi network and use the password to see if that helps.
    ChristinaB_VZW
    Follow us on Twitter @VZWSupport
    If my response answered your question please click the �Correct Answer� button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

  • How do I load apps after bypassing activation​?

    I ran the activation bypass tool (developer.palm.com/index.php?option=com_content&v​iew=article&id=2051) on my Pixi to use the handset as a WiFi-only device for now.  I can enable WiFi and connect to the Internet, as well as email and online calendars.  However, when I select the App Catalog, I get a message saying 'The action could not be completed.  Try again later.'  Is this because it has not yet registered my device? 
    How can I get around this?  I would like to load apps and backup the device. 
    Post relates to: Pixi Plus p121vzw (Verizon)

    You need to update the iOS.  It appears you hav a first first generation iPod.  That iPod can go to 3.1.3.  You can get that update (a paid one) by going to this link.  You may have to ue a different browser to get the sublink to work.
    Purchasing iOS 3.1 Software Update for iPod touch (1st generation)

  • Apps wont install.  Says loading, never do.  Can't delete loading apps.

    I am attempting to down load apps, but they just say loading or paused.  These apps that haven't yet installed have been sitting there for weeks. How do I install?  I also can't delete them in that mode.

    Have you tried a reset to see if they resume after the iPad has restarted ? Press and hold both the sleep and home buttons for about 10 seconds, after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.
    An alternative to try is to download them to your computer's iTunes and then try dragging them over onto the iPad in iTunes

  • Re-load apps after upgrade

    Did software upgrade that took over an hour, all purchased apps on computer, but gone from Iphone 3G. Followed instructions to "restore" but the restore point date was over a year old. How do I re-load apps from computer back to Iphone?

    Under the apps tab in iTunes, is sync apps checked? Checks in the boxes for the apps you want to sync to your phone?

  • Is it possible to load apps on the apple TV?

    I'm interested in something like the TV Guardian product to filter content.
    My 2 kids, 10 and 7 are picking up language from dvd's we would not like
    them to pick up. I understand that some cable companies are licensing the
    product for their networks...
    http://tvguardian.com/gshell.php?page=LICENSING
    Is it possible to load apps on the apple tv to read the closed caption and
    mute the audio?
    Thanks,
    Patrick

    Welcome to the  Discussion Forums.
    Unfortunately the tv doesn't officially allow modifications.

  • Can't load apps from appstore

    On my iPhone5, when trying to load apps from appstore, after entering Apple-ID and password, download does not start, after a few seconds I am returned to the app download screen. Apple-ID and password have been verified via Apple website and are OK.
    There are no iTunes downloads stuck either.
    Any idea?
    Thanks inadvance,
    -georg-

    Hello Georg Kupka,
    I'm sorry to hear you are having these issues with the iTunes iOS App Store. If you are unable to purchase or download apps (no error, just failing silently), you may find the troubleshooting steps outlined in the following articles helpful (they are primarily aimed at issues accessing the iTunes Stores in general, but may also be applicable for specific download issues as well):
    Can't connect to the iTunes Store - Apple Support
    iTunes: Advanced iTunes Store troubleshooting - Apple Support
    Sincerely,
    - Brenden

Maybe you are looking for