tri*_*iwo 7 linux permissions embedded mount busybox
如何以读写方式重新安装特定的设备安装?(一个文件夹)该文件是“只读文件系统”,rw-rr,所以不允许更改权限。我需要替换该文件,然后将权限改回只读。我知道命令
mount -o rw,remount [destination folder]
Run Code Online (Sandbox Code Playgroud)
我知道这种方法不稳定,可能会导致并发症(每次安装都会改变)。所以我必须确保这将重新挂载为只读specific destination folder,而不是设备的每个挂载。我需要在运行系统上执行此操作,而不是测试环境。嵌入式linux系统。那可能吗?
文件夹路径:/etc/foo/bar我需要重新安装/bar文件夹。
编辑:
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)
Run Code Online (Sandbox Code Playgroud)
cat /proc/mounts 的输出
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
Run Code Online (Sandbox Code Playgroud)
重新挂载命令
<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
Run Code Online (Sandbox Code Playgroud)
我找到了一种编辑配置文件的方法/etc/fstab,以便您可以创建绑定安装:
/my/real/dir /to/mount/dir <filesystem> rw,bind 0 0
| 归档时间: |
|
| 查看次数: |
106805 次 |
| 最近记录: |