我有两个外部硬盘,我想读取/写入它们,所以我使用了它们,chmod 777 -R "the folder"
但什么也没发生,所以我查看了一下,发现硬盘的用户是 root,而不是我使用的。然后我使用了它们,chown -R "username_youwant" path_to_folder/folder_name
但只得到了不允许操作的结果,然后我使用命令,su
所以我成为 root,并执行与之前相同的 chown,但得到了不允许的相同操作。让我无法理解的奇怪部分是,我对其中一个硬盘有读/写权限,但没有我想要添加一些文件的硬盘。现在我不知道下一步该尝试什么。总结一下我所做的:
chmod 777 -R "the folder"
chown -R "username_youwant" path_to_folder/folder_name
su
+chown -R "username_youwant" path_to_folder/folder_name
答案1
了解如何path_to_folder
通过 安装mount | grep path_to_folder
。
阅读man 8 mount
。其中部分内容如下:
The non-superuser mounts.
Normally, only the superuser can mount filesystems. However,
when fstab contains the user option on a line, anybody can mount
the corresponding filesystem.
Thus, given a line
/dev/cdrom /cd iso9660 ro,user,noauto,unhide
any user can mount the iso9660 filesystem found on an inserted
CDROM using the command
mount /dev/cdrom
or
mount /cd
For more details, see fstab(5). Only the user that mounted a
filesystem can unmount it again. If any user should be able to
unmount it, then use users instead of user in the fstab line.
The owner option is similar to the user option, with the
restriction that the user must be the owner of the special file.
This may be useful e.g. for /dev/fd if a login script makes the
console user owner of this device. The group option is similar,
with the restriction that the user must be member of the group
of the special file.
也看一下remount
选项。