How to make changes to config files permanent?

If you need some help, this should be the first place to look.

Postby tecknojunky » Mon Feb 17, 2003 10:32 pm

<font color='#0000FF'>Freesco's root file system is a static ramdrive.  If you do free, you'll see that the root file system is mounted on /dev/ram
Code: Select all
[Linux] free
        total:    used:    free:  shared: buffers:  cached:
Mem:  130965504 127913984  3051520 51314688 54349824 26595328
Swap: 133165056   106496 133058560
MemTotal:    127896 kB
MemFree:       2980 kB
MemShared:    50112 kB
Buffers:      53076 kB
Cached:       25972 kB
SwapTotal:   130044 kB
SwapFree:    129940 kB

Mounted FS:
/dev/root / ext2 rw 0 0
/proc /proc proc rw 0 0
/dev/hda1 /mnt umsdos rw 0 0

Filesystem         1024-blocks  Used Available Capacity Mounted on
/dev/ram0               2407    2087      320     87%   /
/dev/hda1            3162924 1321616  1841308     42%   /mnt
This ramdisk has multiple symlinks to a hard device that is mounted on /mnt.  If you are on a floppy, it will be /dev/fdX, and if you are on a hard drive (as in this example) it will be on /dev/hdaX.

If you do ls -l / you'll see that some of the folderes are link to another folder under /mnt/...:
Code: Select all
[Linux] ls -l /
drwxr-xr-x   2 root          root             5120 Feb 16 14:59 bin
drwxrwxr-x   2 root          root             2048 Feb 16 14:59 dev
drwxr-xr-x   4 root          root             1024 Feb 17 01:47 etc
drwxr-xr-x   2 root          root             1024 Aug 16  2000 fd
drwxr-xr-x   2 root          root             1024 Aug 16  2000 hd
drwxrwxr-x   2 root          root             1024 Feb 16 14:59 lib
drwxr-xr-x   8 root          root             4096 Feb 16 14:58 mnt
lrwxrwxrwx   1 root          root               14 Aug  3  2002 opt -> mnt/router/opt
dr-xr-xr-x   5 root          root                0 Feb 16 14:58 proc
lrwxrwxrwx   1 root          root               13 Aug  3  2002 rc -> mnt/router/rc
lrwxrwxrwx   1 root          root                3 Aug  3  2002 sbin -> bin
drwxrwxrwx   3 root          root             1024 Feb 17 22:24 tmp
drwxr-xr-x   6 root          root             1024 Feb 16 14:59 usr
drwxr-xr-x   5 root          root             1024 Feb 16 14:59 var
lrwxrwxrwx   1 root          root               14 Aug  3  2002 wwa -> mnt/router/wwa
lrwxrwxrwx   1 root          root               14 Aug  3  2002 www -> mnt/router/www
lrwxrwxrwx   1 root          root               34 Feb 16 14:59 command -> /mnt/router/packages
drwxr-xr-x   2 root          root             1024 Feb 16 14:59 service

The beggist problems noobs seem to have is when they try to modify the files under the /etc folder.  When they do, they then realize that the changes are lost after a reboot.  This is due to the fact that all the files in /etc are copied from /mnt/router/etc at boot.  So if you modify the files in /etc, it will be lost after a reboot.

The trick is to instead modify the files in /mnt/router/etc and (optionaly) then copy this file in /etc so that the folder is in sync.  Doing so, when Freesco reboots, it will (like it always do) copy the files from /mnt/router/etc in /etc and you'll then notice that your new files (modified or new) will end up in /etc.</font>
<b>TJ</b><br><br><i><b></b> is <a href='' target='_blank'>up for grab</a>.</i>
User avatar
Advanced Member
Posts: 220
Joined: Wed Dec 19, 2001 8:04 am
Location: Montréal, Qc

Postby dingetje » Thu Mar 27, 2003 12:20 pm

The fact that files are copied from /mnt/router/etc to /etc @ boottime is one reason changes in /etc only are lost,
but /etc lives in ramdisk, and what happens to a ramdisk @ reboot? Right! It gets erased :exclamation: :exclamation: :butbut:

This story is also true for 03x but there the paths are a bit different:

<span style='font-family:Courier'>
Filesystem? ? ? ?  1024-blocks? Used Available Capacity Mounted on
/dev/ram0? ? ? ? ? ? ?  2901? ? 1818? ?  1083? ?  63%?  /
/dev/hda1? ? ? ? ? ?  523856? 187784?  336072? ?  36%?  /mnt/bootdev

Some file in /etc on 03x are mapped to /mnt/bootdev/router/pkg/etc
which is (as you can see above) on the harddisk. An example is the '/etc/services' file.
So on 03x when you think you're editing /etc/services you are in fact editing /mnt/bootdev/router/pkg/etc/services
No need to copy therefore!
Other files behave just like on 027, so changes in /etc are lost, changes in /boot/etc are safe.

Update (thanks for the tips Lightning)
03x offers a few symbolic links that are created in the root to save you from typing those long names,
it's also a very flexible way to handle the different boot devices. It's therefore better to use these
symbolic links, rather than the full path. So instead of /mnt/bootdev/router use /boot.
For a full list of these handy links, symply type the command ls -la /


/etc = ramdisk
/boot/etc = safe version on harddisk (or floppy)
/pkg/etc = pkg specific etc files on harddisk (or floppy)

Return to FAQ - Frequently Asked Questions

Who is online

Users browsing this forum: No registered users and 3 guests