更新:对于任何有类似问题的人,请阅读解决方案的评论
在我的情况下,我有一个双引导系统和一些分布在 3 个 HDD 上的分区。它们都在启动时自动安装在我的 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)
您的错误消息显示
/media/alex/Videos
,无论是哪个驱动器,都已安装为只读,请参见此处和此处。这可能是由于系统错误,或者(尽管在外部驱动器中更为普遍)驱动器由于硬件错误而锁定自身。如果是这种情况,您应该尽快备份数据,因为硬盘驱动器可能会损坏或停止运行。如果驱动器没有问题,请检查中的错误条目/etc/fstab
从评论中编辑(所以它不会被删除)
事实证明,它们是 NTFS 驱动器,其中一些安装了 Windows。OP 所说的解决方案是简单地重新登录到 Windows 并执行正确的关机,然后重新启动到 Linux。对于遇到此问题的其他人,您应确保正确关闭计算机,并禁用 Windows 快速启动,因为它会阻止您访问 Linux 并导致其他问题。