Author Message

thebigslide









Joined: 23 Dec 2004

Posts: 790

Location: under a car or on top of a keyboard l33tJoined: 23 Dec 2004Posts: 790Location: under a car or on top of a keyboard

Posted: Fri Feb 18, 2005 5:16 am Post subject: HOWTO: Mount / in RAM and load apps instantly



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!):

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 /newrootYou 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 installcomputer 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 & /sbinStep 1Install as normalStep 2generate the tarballs that will populate our RAM drivesput 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

#########################



Last edited by thebigslide on Mon Mar 14, 2005 4:32 pm; edited 25 times in total

BlindSpy









Joined: 20 Mar 2004

Posts: 263

ApprenticeJoined: 20 Mar 2004Posts: 263

Posted: Fri Feb 18, 2005 9:26 pm Post subject:

_________________

Symlinks to:

xorg.conf this is probably one of the coolest things i've ever seein! I should just buy like 5 gigs of ram and have as much ram as my laptop has hdd space._________________Symlinks to:

bet1m









Joined: 04 Dec 2004

Posts: 631

Location: Kosova/Prishtine l33tJoined: 04 Dec 2004Posts: 631Location: Kosova/Prishtine

Posted: Fri Feb 18, 2005 10:18 pm Post subject:

_________________

#370559 or only /lib and /usr/lib to put in ram, Firefox will load on 0.01 sec._________________

Need4Speed









Joined: 06 Jun 2004

Posts: 497

GuruJoined: 06 Jun 2004Posts: 497

Posted: Fri Feb 18, 2005 10:38 pm Post subject: bet1m wrote: or only /lib and /usr/lib to put in ram, Firefox will load on 0.01 sec.

:drool:

I got to get more ram!! I know a guy who bought a dual opteron system with 16gigs of ram just so he could do this. :drool:I got to get more ram!!I know a guy who bought a dual opteron system with 16gigs of ram just so he could do this.

thebigslide









Joined: 23 Dec 2004

Posts: 790

Location: under a car or on top of a keyboard l33tJoined: 23 Dec 2004Posts: 790Location: under a car or on top of a keyboard

Posted: Sat Feb 19, 2005 4:57 am Post subject: Rewritten following a reinstall.

This should suite anyone with between 256MB and 1GB of RAM now.



Last edited by thebigslide on Sat Feb 19, 2005 7:33 am; edited 1 time in total

Jinidog









Joined: 26 Nov 2003

Posts: 593

Location: Berlin GuruJoined: 26 Nov 2003Posts: 593Location: Berlin

Posted: Sat Feb 19, 2005 7:24 am Post subject: Oh, how sad that /usr/lib ist as big as my RAM (1 GB).

This all brings nothing when there is something swapped.



I would rely on the caching of the kernel.

If there is RAM free, diskspace is cached, if the applications need RAM, they use it.

There is now swapping (swapping costs time).



I don't think that this will speed up anything in real life.

_________________

Just unused Microsoft-Software is good Microsoft-Software

thebigslide









Joined: 23 Dec 2004

Posts: 790

Location: under a car or on top of a keyboard l33tJoined: 23 Dec 2004Posts: 790Location: under a car or on top of a keyboard

Posted: Sat Feb 19, 2005 7:35 am Post subject: Maybe you should clean out your /usr/lib/? Mine is only 200MB and I have TONS of apps installed.

Adended howto and provided an example of precacheing 1 app.

stahlsau









Joined: 09 Jan 2004

Posts: 584

Location: WildWestwoods GuruJoined: 09 Jan 2004Posts: 584Location: WildWestwoods

Posted: Sat Feb 19, 2005 9:26 am Post subject: nice howto, thank you!

I´ll test it anyway, but do you notice some performance-boost? I´ve tried to put some files and libs on a ramdisk before, but it wasn´t faster than it was without...

thebigslide









Joined: 23 Dec 2004

Posts: 790

Location: under a car or on top of a keyboard l33tJoined: 23 Dec 2004Posts: 790Location: under a car or on top of a keyboard

Posted: Sat Feb 19, 2005 11:00 am Post subject: I am going to try this on a 29 node ltsp server this weekend. right now, if everyone opens firefox, it sits and chugs for minutes before everyone has it open. We'll see if this makes a difference.



For me, my HD is damn fast anyways. It just replaced it with a 200GB seagate. It is definately faster with the libs running off RAM (I only have 512MB), but it was pretty fast to begin with.



I like the idea of doing this with a CD booting OS so the damn disk doesn't have to keep spinning up and down, tho.

Zuti









Joined: 09 Jul 2003

Posts: 123

Location: The Netherlands Tux's lil' helperJoined: 09 Jul 2003Posts: 123Location: The Netherlands

Posted: Sat Feb 19, 2005 12:35 pm Post subject:

Dude, you are so cool.

Tnx. thebigslide, i see you often msg-ing the tweaks postsDude, you are so cool.Tnx.

COiN3D









Joined: 02 Aug 2004

Posts: 543

Location: Munich, Germany GuruJoined: 02 Aug 2004Posts: 543Location: Munich, Germany

Posted: Sun Feb 20, 2005 10:29 am Post subject: Hey there,



nice guide, but some parts are hard to understand I think.



Quote: /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)



Do you mean I should create more partitions and update my /etc/fstab, or is it okay to let these on my root-partition? Do I generally have to edit my fstab file?



Sorry if some of those questions sound stupid to you, but I'm really lookin forward to try it out

_________________

| Be free and use Do you mean I should create more partitions and update my /etc/fstab, or is it okay to let these on my root-partition? Do I generally have to edit my fstab file?Sorry if some of those questions sound stupid to you, but I'm really lookin forward to try it out_________________ e17 documentation | Be free and use Jabber as your IM! | Combine IRC and IM

paperp









Joined: 27 Feb 2004

Posts: 544

Location: Toscana , Italy GuruJoined: 27 Feb 2004Posts: 544Location: Toscana , Italy

Posted: Sun Feb 20, 2005 2:28 pm Post subject: Just an info for a non geek ; if i move lib e usr/lib on ram , usual apps like firefox , evolution and maybe X itself take a big advantage in term of speed??

float-









Joined: 31 Aug 2003

Posts: 174

ApprenticeJoined: 31 Aug 2003Posts: 174

Posted: Sun Feb 20, 2005 4:15 pm Post subject: really sweet howto

thebigslide









Joined: 23 Dec 2004

Posts: 790

Location: under a car or on top of a keyboard l33tJoined: 23 Dec 2004Posts: 790Location: under a car or on top of a keyboard

Posted: Tue Feb 22, 2005 12:52 pm Post subject: paperp wrote: Just an info for a non geek ; if i move lib e usr/lib on ram , usual apps like firefox , evolution and maybe X itself take a big advantage in term of speed??



Apps open instantly, but they don't run any faster. What this does is eliminate the bottleneck of loading the applications and their dependent libraries into RAM off the HD. Also, RAM seeks WAY faster than a HD, so if multiple instances of an app are called, the system doesn't sit and chug for 10 minutes while the hard-drive tries to do 100 things at once.



I set this up on an LTSP server with 1GB of RAM and it was quite fast with 4 clients connected. I then powered up the other 30 workstations and it ran out of RAM (because they have KDE on the silly thing) and ran horribly because it was swapping. 30 KDE desktops sure use a lot of RAM (about 40MB a piece). The RAMdisk was 512MB and had /bin, /sbin, /lib, openoffice firefox, AND most of /usr/lib on it.

odegard









Joined: 08 Mar 2003

Posts: 324

Location: Trondheim, NO GuruJoined: 08 Mar 2003Posts: 324Location: Trondheim, NO

Posted: Tue Feb 22, 2005 5:52 pm Post subject:



It should be a simple option to move programs to and from memory...



Imagine what this would do for Linux! Next time you show some friend of yours Linux, just fire up firefox/whatever and *zip* it's there. Startuptimes alone makes a huge impression.



Bravo, great work! How much work would it be to make a script that let's you pick programs already installed, create the neccessary dir's and put everything into ram upon reboot?It should be a simple option to move programs to and from memory...Imagine what this would do for Linux! Next time you show some friend of yours Linux, just fire up firefox/whatever and *zip* it's there. Startuptimes alone makes a huge impression.Bravo, great work!

rcxAsh









Joined: 03 Jul 2003

Posts: 457

Location: /etc/localtime GuruJoined: 03 Jul 2003Posts: 457Location: /etc/localtime

Posted: Tue Feb 22, 2005 10:48 pm Post subject: thebigslide wrote: Maybe you should clean out your /usr/lib/? Mine is only 200MB and I have TONS of apps installed.

Adended howto and provided an example of precacheing 1 app.

Wow, my /usr/lib is nearly 1GB as well... how would you suggest cleaning it out without breaking anything?



This RAM stuff sounds really cool.. I just wish I had more RAM to burn. Only 256MB here. Though, perhaps I may try it out with single applications later.

_________________

rcxAsh

madbiker









Joined: 12 Oct 2003

Posts: 439

Location: Victoria, BC, Canada GuruJoined: 12 Oct 2003Posts: 439Location: Victoria, BC, Canada

Posted: Wed Feb 23, 2005 1:38 am Post subject: Mine is also nearly 1 GB. It's looking like thebigslide might be the minority instead of the norm on this one.



I'll admit I have a fair number of programs installed, but I clean out old and unused packages regularily. I need everything that I have installed right now... too bad.

thebigslide









Joined: 23 Dec 2004

Posts: 790

Location: under a car or on top of a keyboard l33tJoined: 23 Dec 2004Posts: 790Location: under a car or on top of a keyboard

Posted: Wed Feb 23, 2005 5:18 am Post subject:



To those of you with large /usr/libs: did you look to see what was using the space? I'm just curious. If you use rox-filer, there's a nice count feature that tells you the total folder size for multiple selected folders. You can get a nice idea of where your disk-space is going.



Also, you can easily make a folder in /usr called preload (or whatever) and mount that in a RAM drive, link things back to /usr/lib and the silly symlinks that rely on .. to point to /usr will still work The lets you pick and choose what is loaded and what isn't loaded into RAM very eaily and could be automated with a simple bash script.



odegard:



My buddy Cory is working on one of these right now that takes the binary name as an argument and copies it and all it's dependent libraries to a tmpfs mount and links back to the original after renaming the originals .whatever. The script will soon have start and stop functions and take a config file. Might make an interesting addition to some people's init scripts.



Also, btw, I have shown this to a hard core winblowz user who swore he'd never convert to using linux on his desktop because it appears slower (even though his HTPC I made him runs KDE on gentoo on a dual AMD 1800+ box ) He was jealous.



People like me are working towards making linux easier for the windows transition crowd. Having apps startup fast is a big thing for those people (especially if they've spent a ton of $$ on a computer already so it will have acceptable performance under windows). Other projects this particular gentooer is working on include a GUI based livecd and various lightweight stage4 tarballs that can be rebuilt with -e world transparently after install, to allow people to install a working gentoo OS with under 5 minutes of interactivity (and that in a gui) along with post-stages that will add functionality in different areas as binaries and then be easily recompiled/optimized later. All use ebuild and portage. Look out for more howtos



I love Gentoo. Hmm, you guys are missing a big plus to this. By putting critical things on a RAM drive and umounting the partition that holds the tarballs and the update script, you are preventing changes to those files except when you run the script to do so. If someone were to h@><0r your b0><0r, they'd be changing things in a RAM drive that is flushed as soon as you reboot! This is also awesome fun for a honey pot running SSH with a typical password or a service with a well known vulnerability. You can see how people go about exploiting these boxes by simply diffing the filesystems and learn how to better secure your _real_ servers (which are also packing a root RAM drive for security).To those of you with large /usr/libs: did you look to see what was using the space? I'm just curious. If you use rox-filer, there's a nice count feature that tells you the total folder size for multiple selected folders. You can get a nice idea of where your disk-space is going.Also, you can easily make a folder in /usr called preload (or whatever) and mount that in a RAM drive, link things back to /usr/lib and the silly symlinks that rely on .. to point to /usr will still workThe lets you pick and choose what is loaded and what isn't loaded into RAM very eaily and could be automated with a simple bash script.odegard:My buddy Cory is working on one of these right now that takes the binary name as an argument and copies it and all it's dependent libraries to a tmpfs mount and links back to the original after renaming the originals .whatever. The script will soon have start and stop functions and take a config file. Might make an interesting addition to some people's init scripts.Also, btw, I have shown this to a hard core winblowz user who swore he'd never convert to using linux on his desktop because it appears slower (even though his HTPC I made him runs KDE on gentoo on a dual AMD 1800+ box) He was jealous.People like me are working towards making linux easier for the windows transition crowd. Having apps startup fast is a big thing for those people (especially if they've spent a ton of $$ on a computer already so it will have acceptable performance under windows). Other projects this particular gentooer is working on include a GUI based livecd and various lightweight stage4 tarballs that can be rebuilt with -e world transparently after install, to allow people to install a working gentoo OS with under 5 minutes of interactivity (and that in a gui) along with post-stages that will add functionality in different areas as binaries and then be easily recompiled/optimized later. All use ebuild and portage. Look out for more howtosI love Gentoo.



Last edited by thebigslide on Wed Feb 23, 2005 5:27 am; edited 3 times in total

thebigslide









Joined: 23 Dec 2004

Posts: 790

Location: under a car or on top of a keyboard l33tJoined: 23 Dec 2004Posts: 790Location: under a car or on top of a keyboard

Posted: Wed Feb 23, 2005 5:22 am Post subject: failcase wrote: Hey there,



nice guide, but some parts are hard to understand I think.



Quote: /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)



Do you mean I should create more partitions and update my /etc/fstab, or is it okay to let these on my root-partition? Do I generally have to edit my fstab file?



Sorry if some of those questions sound stupid to you, but I'm really lookin forward to try it out Do you mean I should create more partitions and update my /etc/fstab, or is it okay to let these on my root-partition? Do I generally have to edit my fstab file?Sorry if some of those questions sound stupid to you, but I'm really lookin forward to try it out



Sorry I missed your post earlier.

You must have any large folder on it's own physical partition on the disk.

You will have to edit fstab if you'd like the partitions mounted by gentoo automatically.

/var especially must be on it's own partition or someone can DoS your logger and maybe other things by making it fill up the RAM drive.

stahlsau









Joined: 09 Jan 2004

Posts: 584

Location: WildWestwoods GuruJoined: 09 Jan 2004Posts: 584Location: WildWestwoods

Posted: Wed Feb 23, 2005 7:12 am Post subject: nah, i´ve tried to try it, but i´ve failed with the common "kernel panic: unable to find init. Try passing init= at the kernel line".

Initrd is found, kernel boots fine, then this error. But:

-i HAVE linuxrc

-i HAVE passed the option



dunno. I remember having this probling when i built my own stage4-livedvd, and i fixed it, but i can´t remember how.

And i´ve read almost any post on this forum that´s related to this.

K, some description:

-linuxrc is on / in my initrd

-line from grub: Code: kernel /bzImage root=/dev/ram0 rw init=/linuxrc ramdisk=32768

-i also changed the init= to every path i could think of and copied the file everywhere, no go.



Any ideas anyone?

thebigslide









Joined: 23 Dec 2004

Posts: 790

Location: under a car or on top of a keyboard l33tJoined: 23 Dec 2004Posts: 790Location: under a car or on top of a keyboard

Posted: Wed Feb 23, 2005 9:41 am Post subject: is linuxrc executable?

What are it's contents?

You can try setting init=/bin/sh in grub and then enter your initrd line by line, also.

asph









Joined: 25 Aug 2003

Posts: 741

Location: Barcelona, Spain l33tJoined: 25 Aug 2003Posts: 741Location: Barcelona, Spain

Posted: Wed Feb 23, 2005 12:34 pm Post subject: great idea and howto, thanks

_________________

gentoo sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep

stahlsau









Joined: 09 Jan 2004

Posts: 584

Location: WildWestwoods GuruJoined: 09 Jan 2004Posts: 584Location: WildWestwoods

Posted: Wed Feb 23, 2005 2:02 pm Post subject:

@thebigslide:

linuxrc is executable, works if i start it by hand, and if i set init=/bin/bash i get a shell and can do my job.

Only if i call linuxrc it doesn´t work, even if i copy it to /bin and call init=/bin/linuxrc from grub. Dunno.



Thanks for the help, maybe s/o has another answer for me



Another one:

if i call "pivot_root . newroot" it tells me "no such device...". It only works for me if i set newroot to some available directory.





Now a tip from me:

I don´t use your tar-solution for /bin, /sbin etc. Instead i use my old root-partition which i mount in /store. Then i copy over /bin, /etc, /sbin, ... to my root-ramdrive (~50mb), unmount /store and proceed. So i don´t need to modify localmount and don´t need to untar (takes too much time for me)





for backing up my files before reboot/halt, i use this lil script:

hi,@thebigslide:linuxrc is executable, works if i start it by hand, and if i set init=/bin/bash i get a shell and can do my job.Only if i call linuxrc it doesn´t work, even if i copy it to /bin and call init=/bin/linuxrc from grub. Dunno.Thanks for the help, maybe s/o has another answer for meAnother one:if i call "pivot_root . newroot" it tells me "no such device...". It only works for me if i set newroot to some available directory.Now a tip from me:I don´t use your tar-solution for /bin, /sbin etc. Instead i use my old root-partition which i mount in /store. Then i copy over /bin, /etc, /sbin, ... to my root-ramdrive (~50mb), unmount /store and proceed. So i don´t need to modify localmount and don´t need to untar (takes too much time for me)for backing up my files before reboot/halt, i use this lil script: Code: #!/bin/sh

cd /

mount /dev/hda3 /hdd

rsync -auv --delete /bin /etc /sbin /lib /root /hdd/

echo "Backup complete."

umount /hdd

just put it into /etc/conf.d/local.stop.

thebigslide









Joined: 23 Dec 2004

Posts: 790

Location: under a car or on top of a keyboard l33tJoined: 23 Dec 2004Posts: 790Location: under a car or on top of a keyboard

Posted: Wed Feb 23, 2005 4:37 pm Post subject: stahlsau wrote:

Another one:

if i call "pivot_root . newroot" it tells me "no such device...". It only works for me if i set newroot to some available directory.

[/code]

j



you need to mkdir /newroot on your root filesystem before tarring it up /newroot is the path that the initrd will reside at following the pivotroot so it must exist for the command to be executed. you need to mkdir /newroot on your root filesystem before tarring it up/newroot is the path that the initrd will reside at following the pivotroot so it must exist for the command to be executed.

stahlsau









Joined: 09 Jan 2004

Posts: 584

Location: WildWestwoods GuruJoined: 09 Jan 2004Posts: 584Location: WildWestwoods

Posted: Wed Feb 23, 2005 7:01 pm Post subject: Quote: you need to mkdir /newroot on your root filesystem before tarring it up Wink /newroot is the path that the initrd will reside at following the pivotroot so it must exist for the command to be executed.

yeah, i noticed this



Anyway, ´til now there´s no great speed gain. Not that i would notice it, at least. I´ll try moving some of the "most-wanted" libs to the ramdisk, maybe things´ll change then. All of ´em won´t work since my /lib is 1.5G...

Any ideas what else could help speeding things up? I´ve got ~550mb ram free yeah, i noticed thisAnyway, ´til now there´s no great speed gain. Not that i would notice it, at least. I´ll try moving some of the "most-wanted" libs to the ramdisk, maybe things´ll change then. All of ´em won´t work since my /lib is 1.5G...Any ideas what else could help speeding things up? I´ve got ~550mb ram free