如何修改linux中的只读文件系统?

Ali*_*ehi 2 linux permissions elementary-os

假设我的 Linux(基本操作系统)中安装了一个产品:

\n
\n

名称=“基本操作系统”版本=“6.1 J\xc3\xb3lnir”

\n
\n

我的系统中还安装了 Windows 10(双启动),我想对源代码进行一些更改,但我不断收到此错误:

\n
chmod: changing permissions of \'filename\': Read-only file system\n
Run Code Online (Sandbox Code Playgroud)\n

它恰好发生在这个文件/目录上。

\n

我尝试过的事情:

\n
    \n
  • chmod 777 文件
  • \n
  • mount -o remount,rw \'/myfile/directory\' : which returns no error
  • \n
  • chown -R root:root /mydir
  • \n
  • 在 Windows 上禁用快速启动(这会破坏我的操作系统,我不知道为什么)
  • \n
  • 我试过这个
  • \n
\n

但它们都不起作用。看起来该产品锁定了自己的源文件(这是我的最佳猜测)。

\n

那么我该如何解决这个问题呢?

\n

编辑1:

\n

这是一些实际的终端输出:

\n
root@qwxp# chmod g+rw current\n
Run Code Online (Sandbox Code Playgroud)\n
\n

chmod:更改“当前”的权限:只读文件系统

\n
\n
root@qwxp# mount -o remount,rw /snap/pycharm-professional/current /`\n
Run Code Online (Sandbox Code Playgroud)\n

mount 命令没有输出,只有当我不给它一个安装点时它才会返回:

\n
\n

mount: /snap/pycharm-professional/271: 无法重新挂载 /dev/loop6 读写,已被写保护。

\n
\n
root@qwxp# chmod g+rw current\n
Run Code Online (Sandbox Code Playgroud)\n
\n

chmod:更改“当前”的权限:只读文件系统

\n
\n
root@qwxp# ls -al\n\ntotal 8\n\ndrwxrwxrwx  3 root root 4096 Mar  5 05:46 .\n\ndrwxr-xr-x 13 root root 4096 Mar  5 06:24 ..\n\ndrwxr-xr-x 11 root root  239 Jan 27 18:52 271\n\nlrwxrwxrwx  1 root root    3 Mar  5 05:11 **current -> 271**\n\n-rw-r--r--  1 root root    0 Mar  5 05:46 hi.txt\n\n
Run Code Online (Sandbox Code Playgroud)\n

use*_*489 5

如果你运行df -hT /snap/pycharm-professional/current你可能会发现这是一个类型的文件系统squashfs

Squashfs 文件系统在设计上是只读的,没有内置方法来修改文件系统的任何部分。

这似乎是一个快速安装的应用程序。从您的问题中不清楚您为什么要修改应用程序的部分内容。可能有一种更简单的方法可以完成您正在尝试的操作,但您没有提供足够的详细信息来确定这一点。

  • 没有直接的方法可以编辑 squashfs 中的文件,您无法更改文件类型。你试图解决错误的问题。您到底想实现什么目标? (3认同)