尽管列出了完整权限,但所有者的写入权限被拒绝

尽管列出了完整权限,但所有者的写入权限被拒绝

更新:对于遇到类似问题的人,请阅读解决方案的评论

我有一个双启动系统和几个分区,分布在 3 个硬盘上。它们都会在启动时自动挂载到我的 KDE 上,我从来没有任何删除、创建或在它们之间传输文件时出现问题,但突然我的写入权限被拒绝。考虑到ls -l我所有分区的输出仍然显示以下内容,这很奇怪:

alex@alex-ubuntu:/media/alex$ ls -l
total 148
drwxrwxrwx 1 alex alex 65536 Oct 12 18:14 Backup
drwxrwxrwx 1 alex alex  4096 Mar 30  2019 DCC68E14C68DEF58
drwxrwxrwx 1 alex alex  4096 Oct 12 18:14 Downloads
drwxrwxrwx 1 alex alex  4096 Oct 12 18:14 Games
drwxrwxrwx 1 alex alex  4096 Oct 12 18:14 Videos
drwxrwxrwx 1 alex alex  8192 Oct 12 19:11 Windows

甚至用于复制或创建文件的 sudo 命令都不再起作用:

alex@alex-ubuntu:/media/alex/Videos$ sudo touch test.txt
[sudo] password for alex: 
touch: cannot touch 'test.txt': Read-only file system
alex@alex-ubuntu:/media/alex/Videos$ 

我做了一些研究,但我发现所有类似的情况都是用户没有完全权限或root仍然拥有所有权,所以解决这个问题几乎和使用chmod或一样简单chown。我完全不知道是什么原因造成的,尤其是考虑到我的外置硬盘在连接时仍然运行正常。

输出如下mount

alex@alex-ubuntu:~$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,noexec,relatime,size=2994076k,nr_inodes=748519,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=607456k,mode=755)
/dev/sdc5 on / type ext4 (rw,relatime,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=434)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
/var/lib/snapd/snaps/core18_1885.snap on /snap/core18/1885 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/exercism_5.snap on /snap/exercism/5 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core_9993.snap on /snap/core/9993 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/gtk-common-themes_1506.snap on /snap/gtk-common-themes/1506 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/gnome-3-28-1804_145.snap on /snap/gnome-3-28-1804/145 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/discord_115.snap on /snap/discord/115 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/heroku_3993.snap on /snap/heroku/3993 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/postman_127.snap on /snap/postman/127 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/snapd_9279.snap on /snap/snapd/9279 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/vlc_1700.snap on /snap/vlc/1700 type squashfs (ro,nodev,relatime,x-gdu.hide)
/dev/sdc7 on /home type ext4 (rw,relatime)
/var/lib/snapd/snaps/snapd_9607.snap on /snap/snapd/9607 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core_10126.snap on /snap/core/10126 type squashfs (ro,nodev,relatime,x-gdu.hide)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=607452k,mode=700,uid=1000,gid=1000)
/dev/sda1 on /media/alex/Videos type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdb2 on /media/alex/Downloads type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdb1 on /media/alex/Backup type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdc2 on /media/alex/DCC68E14C68DEF58 type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdc1 on /media/alex/Windows type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdc3 on /media/alex/Games type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/fuse on /run/user/1000/doc type fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

答案1

您的错误消息表明/media/alex/Videos,无论是哪个驱动器,都以只读方式安装,请参见这里这里。这可能是由于系统错误,或者(虽然在外部驱动器中更常见)驱动器由于硬件错误而锁定自身。如果是这种情况,您应该尽快备份数据,因为硬盘驱动器可能会损坏或停止运行。如果驱动器没有问题,请检查/etc/fstab

从评论中编辑(这样就不会被删除)

事实证明,它们是 NTFS 驱动器,其中一些安装了 Windows。OP 所述的有效解决方案是简单地重新登录 Windows 并执行正确关机,然后重新启动进入 Linux。对于遇到此问题的其他任何人,您应该确保正确关闭计算机并禁用 Windows 快速启动,因为它可能会阻止您访问 Linux 并导致其他问题。

相关内容