# How to replace a system read only file?



## shatou (Apr 24, 2008)

Help!!! First of all, this is the best technical support forum ever..... Shout for Linux!! Now, I have a moto razr2 V8, with MobiLinux 4.1 OS, likely i can log on the system files, using FileZilla & Command Prompet, it's something like a linux on windows platform...anyway, i'd like to know is there any possible way to replace or even edit a read only system file....such as font....:4-dontkno


----------



## lensman3 (Oct 19, 2007)

Have at it. I would do the following:

1) Make a backup of what you are editing.

2) Edit the file. You will probably have to become superuser first. Do a "ls -la <filenameToEdit>". If the permission for the file vipw are:

-rwxr-xr-x 1 root root 16344 2008-01-16 06:45 vipw

"root" owns the file and the file is in the "root" group. 
rwx - 1st - means that root can read-write-execute the file.
r-w - 2nd -- means the group root can read and execute the file, but not write to it.
r-w - 3rd --- means the world (everybody else) can just read and execute, but not write to it.

The first dash is a special file type. Usually it is a "d" to indicate a directory.

So in this case, only being the superuser (root) can you write the file back out. If you are logged in as anybody else, you will not be able to write back to the file. vipw is a program for editing the file /etc/passwd. It is different than the vi program, in that it sets an exclusive lock on the file so that two people can't be editing the passwd file at the same time.

3) Another way to get permission to write is to run the chmod command as superuser. Look at the "man" page (manual) for chmod. It has lots of options. Usually the simples is to "chmod 777 <fileToEdit>". This will make the read-write-execuable by everyone on the system: including HACKERS. So you will want to change the permissions back. Needless to say, if you are logged in as "shatou" and want to edit vipw, you need to be user "root" to change the file permissions. You CAN'T change the permissions as "shatou". 

I don't know the tool/program to edit a font. Try googling "font editors linux" to see what pops up. Can anybody else help shatou.


----------



## shatou (Apr 24, 2008)

lensman3 said:


> Have at it. I would do the following:
> 
> 1) Make a backup of what you are editing.
> 
> ...


well, your reply was really helpful, but forgive me , i am newbie, i used ls -la and i get this:
-rwxr-xr-x 1 ezx ezx 187965 Jan 1 1970 /usr/language/fonts/AMCSL.TTF

what does this mean?? & what should i do know?:4-dontkno

Note: the chmod didn't help, it gives me "Read Only File System"...:sigh:


----------



## lensman3 (Oct 19, 2007)

This means:

-rwxr-xr-x 1 ezx ezx 187965 Jan 1 1970 /usr/language/fonts/AMCSL.TTF

The file "/usr/language/fonts/AMCSL.TTF" which by its ending if a True-Type-Font name AMCSL.

The first ezx if the files owner. The second ezx if the files group. Whoever 'ezx' is?

The '1' by itself in the second field means hard link. There is only name for the file on the computer and it is referenced by AMCL.TTF. If the file had another name or the same name in another directory that number would be 2. When the 'reference count' reaches zero, the file will be deleted. 

The rwxr-xr-x means: the first rwx means ezx has read, write and execute privileges on the file. the second r-x means the group `ezx` only has read and execute privileges. The third r-x means that the 'world` has read, write and execute privileges. None of this helps because the File system is Read Only.

A Read Only files system, essential means your "screwed". The True Type Font resides probably in read only memory. I had to look up what a razr2 V8 was and it is a very sophisticated phone. The file is probably in flash memory, so you will have to flash it, somehow!!!! 

If 'ls' worked, try 'df /usr/language/fonts/AMCSL.TTF' without the quotes. The 'df' command tells you file system usage. When you add a file name, it tells you what file system the file resides on. From that info, see if the phone has a file call '/etc/fstab' This is the file that tell Linux where the mount points are for the various file systems.

Where we are going with this is: with the mount command you should be able to remount the read only file system as read-write. This should make the changes to the memory and you can add a new font. Or you could trash your phone and you will have a very expense paper-weight. 

If the font is in read-only memory, there is nothing probably could do to change it. It is like trying to change a file on a CD or DVD. There is no 'extend CD' command!


----------

