Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-10-2014, 02:43 PM
|
#1
|
Member
Registered: Apr 2014
Distribution: Debian
Posts: 92
Rep: 
|
Remounting as read-write a directory on device
How to remount as read-write a target directory on device? (one folder) I need to replace file, which is in "Read-only file system", not allow to change permissions. Path to folder: /etc/foo/bar. I need to remount /bar folder. Embedded Linux (busybox), Linux version 2.6.18_pro500
I tried the following, with no success:
Code:
<root@elocal:/etc/foo/bar> ls -la
total 6
drwxr-xr-x 2 root 0 98 Jan 18 2011 .
drwxrwxr-x 7 root 0 105 Feb 10 2011 ..
-rw-r--r-- 1 root 0 1052 Jan 18 2011 file1
-rw-r--r-- 1 root 0 270 Jan 18 2011 file2
-rw-r--r-- 1 root 0 1088 Jan 18 2011 file3
-rw-r--r-- 1 root 0 270 Jan 18 2011 file4
mount -o rw,remount /etc/foo/bar
mount: can't find /etc/foo/bar in /proc/mounts
output mount command:
Code:
mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
proc on /proc type proc (rw)
ramfs on /var type ramfs (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw)
/dev/mtdblock4 on /nvram type jffs2 (rw)
output of cat /proc/mounts
Code:
cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / squashfs ro 0 0
proc /proc proc rw 0 0
ramfs /var ramfs rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /dev tmpfs rw 0 0
devpts /dev/pts devpts rw 0 0
/dev/mtdblock4 /nvram jffs2 rw 0 0
|
|
|
08-10-2014, 03:09 PM
|
#2
|
Senior Member
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385
|
From the output you have shared I don't see any filesystem mounted on /bar. You don't mount directory, you mount filesystem on a directory. Also, the command that you have tried (though it will not work in this case as I don't see any filesystem mount on /bar) is incorrect. Correct syntax is:
Code:
mount -o remount,rw /filesystem
From what I can gather from your post you are trying to edit a file and you are unable to do so as it says read only file. I would suggest checking file permission as well as attributes using:
1. ls -al filename_or_directory_name
2. lsattr filename
|
|
|
08-10-2014, 03:26 PM
|
#3
|
Member
Registered: Apr 2014
Distribution: Debian
Posts: 92
Original Poster
Rep: 
|
File attributes specified in my sample code Nr 1 (-rw-r--r--)
you mean this
mount -o remount,rw /squashfs
Last edited by dorsio; 08-10-2014 at 03:33 PM.
|
|
|
08-10-2014, 03:28 PM
|
#4
|
Senior Member
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385
|
Run lsattr against any of these file and paste the output. Syntax: lsattr <filename>
|
|
|
08-10-2014, 04:27 PM
|
#5
|
Senior Member
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,828
|
Is "squashfs" the filesystem type? squashfs is inherently read-only. To make changes, you would need to install squashfs-tools, then unpack the filesystem (unsquashfs) into a directory tree somewhere writeable, make your changes, and mksquashfs a new filesystem.
More generally, while you can bind-mount a directory to a new mount point, you cannot gain any features that were not in the original mount. If the filesystem is mounted read-only, the bind-mount will also be read-only. See the "--bind" option in the mount command.
|
|
|
08-10-2014, 05:03 PM
|
#6
|
Member
Registered: Apr 2014
Distribution: Debian
Posts: 92
Original Poster
Rep: 
|
Thanks for clarifying.
Last edited by dorsio; 08-10-2014 at 05:11 PM.
|
|
|
All times are GMT -5. The time now is 06:05 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|