erik_bies
03-05-2004, 00:00
Ok,
This is working for me, and may be also working for you.
The idea is to disable the ramdisk where the syslog is stored. While disabling gives you some more memory, the biggest advantage (to me) is that the syslog can grow, grow grow without the device runs out of memory.
Now, I would not reccommend this for a flashdrive, as I think a flash can only be written a few thousand times. Well, actually I don't know. At your own risk!
Step 1.
Make sure you have OLEG's firmware running, and you are booting from harddisk.
You can check it by loggin on, and type mount
If you don't see an "cramfs" entry you are running smooth from disk :cool:
Step 2 Make your drive writable after the booting.
For this step you need vi editor. In the latest version of the firmware this is build in, for older versions you need to use the 'full version' which can be found here http://files.wl500g.info/asus/wl500g/firmware/app/busybox.zip
This version might anyway be handy to have somewhere on your disk, just in case you need the extra features.
Make your drive writable after the booting.
Add a line to the "/init/boot" file (maybe make a backup of the boot file cp boot boot.org)
mount -o remount,rw,noatime "$boot_dev" /
after the two mount commands. This brings your disk in read-write mode just after booting.
Step 3 Create empty tmp dir
The original firmware always starts with empty tmp. I'm not sure if it is really needed. Anyway, it nicely cleans up any mess left behind
add the rm line just before the "mkdir /mnt/ramfs/tmp" line
rm -rf /mnt/ramfs/tmp
mkdir /mnt/ramfs/tmp
Step 4 Remove RAM disk
Continue editing the boot file, add the # in front of the mount command of the ramdisk
#mount -t ramfs ramfs /mnt/ramfs
reboot your router, and check with mount command.
you should see something like:
/dev/scsi/host0/bus0/target0/lun0/part1 on / type ext2 (rw,noatime)
none on /dev type devfs (rw)
none on /proc type proc (rw)
Ok, way to go, you have it.
You can see the available mem by typing:
~ # cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 14794752 12906496 1888256 0 425984 6336512
Swap: 0 0 0
MemTotal: 14448 kB
MemFree: 1844 kB
MemShared: 0 kB
Buffers: 416 kB
Cached: 6188 kB
SwapCached: 0 kB
Active: 3760 kB
Inactive: 4316 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 14448 kB
LowFree: 1844 kB
SwapTotal: 0 kB
SwapFree: 0 kB
If you still don't think you have enough memory you might wanna add some swap memory
do it as following:
Create an empty file (the number behind the count is the number of MB you wanna have as swap)
~ # dd if=/dev/zero of=/swp bs=1M count=32
32+0 records in
32+0 records out
(you need again the full version of the busybox)
~ # /path to your busybox/busybox mkswap /swp
Setting up swapspace version 1, size = 33550336 bytes
~ # /busybox swapon /swp
again, you can check if it is working by typing:
~ # cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 14794752 13496320 1298432 0 663552 6955008
Swap: 33546240 131072 33415168
MemTotal: 14448 kB
MemFree: 1268 kB
MemShared: 0 kB
Buffers: 648 kB
Cached: 6664 kB
SwapCached: 128 kB
Active: 2420 kB
Inactive: 6364 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 14448 kB
LowFree: 1268 kB
SwapTotal: 32760 kB
SwapFree: 32632 kB
Note: Mini "vi" editor manual.
Maybe you are struggeling with vi just as I most of the time do.
The way to edit this boot file:
/path to your full busybox/busybox vi /init/boot
scroll to the place where you want to edit, click the "insert" key. You see in the bottom left part of the screen "-- Insert --" (click once more to replace)
No modify/add the text you want to edit, after the edit is done click the "Esc" key. to delete a line type ":d"
Now write the file with the ":w" command
Close vi with the ":q" command
BTW. While experimenting to get this done, I several times booted the device without having a working tmp dir. The interesting behaviour is that some of the services did not start, or did not work. I could not log on to the box anymore with SSH, however the telnetd was each time running and accepting connections. This allowed me to fix the thing and continue.
This is working for me, and may be also working for you.
The idea is to disable the ramdisk where the syslog is stored. While disabling gives you some more memory, the biggest advantage (to me) is that the syslog can grow, grow grow without the device runs out of memory.
Now, I would not reccommend this for a flashdrive, as I think a flash can only be written a few thousand times. Well, actually I don't know. At your own risk!
Step 1.
Make sure you have OLEG's firmware running, and you are booting from harddisk.
You can check it by loggin on, and type mount
If you don't see an "cramfs" entry you are running smooth from disk :cool:
Step 2 Make your drive writable after the booting.
For this step you need vi editor. In the latest version of the firmware this is build in, for older versions you need to use the 'full version' which can be found here http://files.wl500g.info/asus/wl500g/firmware/app/busybox.zip
This version might anyway be handy to have somewhere on your disk, just in case you need the extra features.
Make your drive writable after the booting.
Add a line to the "/init/boot" file (maybe make a backup of the boot file cp boot boot.org)
mount -o remount,rw,noatime "$boot_dev" /
after the two mount commands. This brings your disk in read-write mode just after booting.
Step 3 Create empty tmp dir
The original firmware always starts with empty tmp. I'm not sure if it is really needed. Anyway, it nicely cleans up any mess left behind
add the rm line just before the "mkdir /mnt/ramfs/tmp" line
rm -rf /mnt/ramfs/tmp
mkdir /mnt/ramfs/tmp
Step 4 Remove RAM disk
Continue editing the boot file, add the # in front of the mount command of the ramdisk
#mount -t ramfs ramfs /mnt/ramfs
reboot your router, and check with mount command.
you should see something like:
/dev/scsi/host0/bus0/target0/lun0/part1 on / type ext2 (rw,noatime)
none on /dev type devfs (rw)
none on /proc type proc (rw)
Ok, way to go, you have it.
You can see the available mem by typing:
~ # cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 14794752 12906496 1888256 0 425984 6336512
Swap: 0 0 0
MemTotal: 14448 kB
MemFree: 1844 kB
MemShared: 0 kB
Buffers: 416 kB
Cached: 6188 kB
SwapCached: 0 kB
Active: 3760 kB
Inactive: 4316 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 14448 kB
LowFree: 1844 kB
SwapTotal: 0 kB
SwapFree: 0 kB
If you still don't think you have enough memory you might wanna add some swap memory
do it as following:
Create an empty file (the number behind the count is the number of MB you wanna have as swap)
~ # dd if=/dev/zero of=/swp bs=1M count=32
32+0 records in
32+0 records out
(you need again the full version of the busybox)
~ # /path to your busybox/busybox mkswap /swp
Setting up swapspace version 1, size = 33550336 bytes
~ # /busybox swapon /swp
again, you can check if it is working by typing:
~ # cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 14794752 13496320 1298432 0 663552 6955008
Swap: 33546240 131072 33415168
MemTotal: 14448 kB
MemFree: 1268 kB
MemShared: 0 kB
Buffers: 648 kB
Cached: 6664 kB
SwapCached: 128 kB
Active: 2420 kB
Inactive: 6364 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 14448 kB
LowFree: 1268 kB
SwapTotal: 32760 kB
SwapFree: 32632 kB
Note: Mini "vi" editor manual.
Maybe you are struggeling with vi just as I most of the time do.
The way to edit this boot file:
/path to your full busybox/busybox vi /init/boot
scroll to the place where you want to edit, click the "insert" key. You see in the bottom left part of the screen "-- Insert --" (click once more to replace)
No modify/add the text you want to edit, after the edit is done click the "Esc" key. to delete a line type ":d"
Now write the file with the ":w" command
Close vi with the ":q" command
BTW. While experimenting to get this done, I several times booted the device without having a working tmp dir. The interesting behaviour is that some of the services did not start, or did not work. I could not log on to the box anymore with SSH, however the telnetd was each time running and accepting connections. This allowed me to fix the thing and continue.