Results 1 to 4 of 4

Thread: Free ramfs for external USB rootfs?

  1. #1

    Question Free ramfs for external USB rootfs?

    Hi,

    I have upgraded the firmware to 1.7.5.9-2,
    and plugged an USB drive as root filesystem.
    It works fine and I am wondering if we can free the memory
    used by ramfs to run more or larger applications.
    Since I have remount the USB drive as R/W,
    is the ramfs still necessary? How to do that?

    By the way, If I'd like to remount root automatically after boot,
    which init script should I modify?
    Thanks in advance.

  2. #2
    Join Date
    Feb 2004
    Posts
    103
    Although written for older firm.. this might help you
    http://wl500g.info/showthread.php?t=359

  3. #3
    Quote Originally Posted by erik_bies
    Although written for older firm.. this might help you
    http://wl500g.info/showthread.php?t=359
    Thanks for your info.
    Actually, my wl500g can successfully boot without
    using ramfs. I modified the /init/boot script to achieve
    that:

    1. remove the symlink /etc, /tmp, /var, and /usr/local.
    create real directories
    2. don't mount ramfs, but remount USB FS with writable:
    mount -o remount,rw,noatime /dev/scsi/host0/bus0/target0/lun0/part1 /
    #mount -t ramfs ramfs /mnt/ramfs
    3. change the way to initialize these directories:

    cp -dpR /ramfs/etc/* /etc
    #cp -dpR /ramfs/etc /mnt/ramfs
    cp -dpR /ramfs/var/* /var
    #cp -dpR /ramfs/var /mnt/ramfs

    rm -Rf /tmp/*
    #mkdir /mnt/ramfs/tmp
    #mkdir /mnt/ramfs/local

    I don't know if it is necessary to cp files from /ramfs/etc and /ramfs/var. From /proc/meminfo, I got at least 2MB+
    memory without using ramfs.

  4. #4
    Join Date
    Jun 2004
    Location
    Netherlands
    Posts
    3
    Quote Originally Posted by denny
    cp -dpR /ramfs/etc/* /etc
    #cp -dpR /ramfs/etc /mnt/ramfs
    cp -dpR /ramfs/var/* /var
    #cp -dpR /ramfs/var /mnt/ramfs

    rm -Rf /tmp/*
    #mkdir /mnt/ramfs/tmp
    #mkdir /mnt/ramfs/local

    I don't know if it is necessary to cp files from /ramfs/etc and /ramfs/var. From /proc/meminfo, I got at least 2MB+
    memory without using ramfs.
    You can avoid the copying altogether by moving etc and var:
    Code:
       rm /etc /var
       mv /ramfs/etc /ramfs/var /
       rmdir ramfs
    Needs only be done once. Careful with changing the system while running, I did the above on a separate Linux box.
    -jcw

Similar Threads

  1. [USB] External Storage Cases / External Harddrives
    By Antiloop in forum Reported Compatible Hardware
    Replies: 58
    Last Post: 03-03-2010, 05:18
  2. free RAM
    By kamilek in forum WL-500g Q&A
    Replies: 1
    Last Post: 25-08-2005, 11:12
  3. mtd2 (rootfs) partition
    By phedny in forum WL-500g Custom Development
    Replies: 3
    Last Post: 10-05-2005, 16:49
  4. firmware 1.9.2.7 rc 3 rootfs
    By infohunt2 in forum WL-500g Q&A
    Replies: 5
    Last Post: 10-01-2005, 11:48
  5. Replies: 1
    Last Post: 09-03-2004, 17:16

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •