User Tools

Site Tools


ram_mode

Adding RAM Mode

RAM mode will allow you to boot your system, and use read and write to RAM rather then to the user partition. Its useful for system recovery when busybox is too simple, and for general use to prevent writes to the ssd.

You will need to be root to do all this, so start with

sudo -i

First thing we need to do is create an initramfs. So first create a temporary directory.

mkdir /root/temp

Change directory into your temporary directory.

cd /root/temp

Now decompress your regular initramfs file

zcat /boot/initramfs-eeepc.img | cpio -id

Now open the init in a text editor, now find and change the text below.

if ! mount -t ext3 -o rw /dev/sda2 /mnt-user; then
    echo Error mounting user partition. Must run filesystem scan!
    exec switch_root /mnt-system /sbin/scanuser.sh
fi 

To this.

if ! mount -t tmpfs -o rw user /mnt-user; then
    echo Error mounting tmpfs user partition. 
fi 

Now create your new initramfs file

find . | cpio -o -H newc | gzip > /boot/initramfs-ram_mode.img

And clean up after yourself

cd /root
rm -r /root/temp

We need to move this onto sda1 so boot into rescue mode and mount sda1 and sda2.

mkdir /sda1
mkdir /sda2
mount -t ext2 /dev/sda1 /sda1
mount -t ext3 /dev/sda2 /sda2

Now move the file.

mv /sda2/boot/initramfs-ram_mode.img /sda1/boot/initramfs-ram_mode.img

Now use open your grub config file with vi.

vi /sda1/boot/grub/menu.lst

And add this.

title Ram Mode
	root (0x80,0)
	kernel /boot/vmlinuz-2.6.21.4-eeepc quiet rw vga=785 irqpoll root=/dev/sda1
	initrd /boot/initramfs-ram_mode.img

Finally, umount both partitions and wait at least 30 seconds (Important!). The umount steps and the waiting are there to make sure all data is written to the disk and all disk caches are flushed. If you skip these steps it might be that your data gets corrupted or you will get filesystem error.

umount /mnt-system
umount /mnt-user

Then reboot and you have it, just use F9 at boot and select it.

Some notes

  • This works best if you have a RAM upgrade.
  • Every time you boot into this mode it will act like a first time boot.

Alternative: RAM Mode with Custom Changes

The RAM mode described above are for booting with factory settings only. If you have customized your Eeepc and would like to use your custom settings in RAM mode, you can build another initramfs image in exactly the same way but with a different init as discussed in this thread: Possible to run in a "READ ONLY" state?.

Alternatively, you can download the initramfs images as built by albkwan from his webpage: http://eeepc.fire.prohosting.com/#ram4user

ram_mode.txt · Last modified: 2009/03/10 13:37 by albkwan