View Full Version : /etc file edit
maciek
17-08-2010, 03:51 PM
How can I edit files in /etc for example /etc/samba/smb.conf ? ETC is located on read only root filesystem so the problem.
try with WinSCP
http://winscp.net/eng/index.php
when you have access with it over ethernet right click on item allows you to change owner properties and has an internal editor to.
maciek
17-08-2010, 04:16 PM
The problem is that whole root filesystem is read only. Not particular directory or file. It is included in /etc/fstab:
# cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/root / auto defaults,errors=remount-ro 0 0
proc /proc proc defaults 0 0
So using winscp, filezilla, telnet console does not solve the problem.
chris217
17-08-2010, 05:25 PM
One way would be to create a root file system image, mount this (under Linux) using loop back, extract the files, edit to taste, regenerate the image and copy it back into the flash memory. This is a bit tedious and not recommended.
A possible alternative would be to copy the files from /etc onto another partition (e.g. one created on a USB memory stick) and mount this over the existing /etc. I have not tried this, but the command would be something like: "mount -t ext2 /dev/sdb1 /etc", where the writeable partition is in ext2 format on the first partition of the USB stick. (Using FAT or FAT32 is probably not a good idea for this purpose.) You can create partitions on the USB stick on the receiver using the fdisk command.
maciek
17-08-2010, 06:32 PM
I am not sure that mounting any type of filesystem to read only filesystem is possible at all. Did You tried it?
chris217
17-08-2010, 08:34 PM
I am not sure that mounting any type of filesystem to read only filesystem is possible at all. Did You tried it?
/STORAGE/HDD is on the read-only file system and is the mount point for the hard disk. If this were not possible, the system would not be able to mount anything off a read-only root file system.
maciek
17-08-2010, 08:57 PM
SOLVED!
First I formated 1 GB USB memory stick in other Linux PC. Then I just copied content of original /etc to rear USB stick and I add new plugin named ETC (with start option as "Auto"/ The plugin is located in /var/bin and the content is:
CODE
/var/bin # cat ETC
mount -t ext2 /dev/sdb /etc
Now I can edit any config files located in /etc/directory !!!
We are the champions!!!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.