无法在启动时挂载我的 ntfs 格式的外部 USB 磁盘

无法在启动时挂载我的 ntfs 格式的外部 USB 磁盘

我有一个新的外部 USB 磁盘,我想将其与 ntfs 一起使用,因为我需要将它与大文件一起使用,并且与一些无法识别 Linux ext 分区的设备一起使用。
我收到“传输端点未连接”错误,因此我搜索了 Google,但找不到解决方案。

错误:

fmf@kodi:~$ df -h
df: /media/library: Transport endpoint is not connected
Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           386M  6.2M  380M   2% /run
/dev/sda1        88G   29G   55G  35% /
tmpfs           1.9G  4.0K  1.9G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/sdd1       917G  812G   59G  94% /media/Tera
cgmfs           100K     0  100K   0% /run/cgmanager/fs
/dev/sdb1       917G  205G  667G  24% /media/Cloud
tmpfs           386M     0  386M   0% /run/user/1000
fmf@kodi:~$  

现在我的配置:

fmf@kodi:~$sudo fdisk -l
Disk /dev/sda: 93.2 GiB, 100030242816 bytes, 195371568 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000a04b2

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *         2048 187211775 187209728 89.3G 83 Linux
/dev/sda2       187213822 195371007   8157186  3.9G  5 Extended
/dev/sda5       187213824 195371007   8157184  3.9G 82 Linux swap / Solaris


Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: BACF5A78-71A6-4A24-8A4A-1D65DBC67DCA

Device     Start        End    Sectors   Size Type
/dev/sdb1   2048 1953523711 1953521664 931.5G Linux filesystem


Disk /dev/sdc: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x01bea14b

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdc1        2048 1953521663 1953519616 931.5G  7 HPFS/NTFS/exFAT


Disk /dev/sdd: 931.5 GiB, 1000202043392 bytes, 1953519616 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2AE9D03B-6A9D-4259-A5AC-03EC79EB40EF

Device     Start        End    Sectors   Size Type
/dev/sdd1   2048 1953517567 1953515520 931.5G Linux filesystem
fmf@kodi:~$

blkid 输出:

fmf@kodi:~$ sudo blkid
/dev/sda1: UUID="9fab4895-7ccb-4415-b26d-311a17036cda" TYPE="ext4" PARTUUID="000a04b2-01"
/dev/sda5: UUID="7b158f58-e4c1-4717-aa5f-dbeaa79ab93c" TYPE="swap" PARTUUID="000a04b2-05"
/dev/sdd1: LABEL="Tera" UUID="f9079f52-7661-48ad-9bc4-0d2452be66af" TYPE="ext2" PARTLABEL="primary" PARTUUID="7ba0b94d-b0c6-4e5d-9870-af445dd53358"
/dev/sdb1: LABEL="Cloud" UUID="fb1f92ee-54f5-44f8-ba92-544e90e6dfeb" TYPE="ext2" PARTLABEL="primary" PARTUUID="35d67138-5a9a-46ff-8133-829e93d310a4"
/dev/sdc1: LABEL="library" UUID="72ACD728ACD6E61F" TYPE="ntfs" PARTUUID="01bea14b-01"
fmf@kodi:~$

我的 fstab:

fmf@kodi:~$sudo cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=9fab4895-7ccb-4415-b26d-311a17036cda /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=7b158f58-e4c1-4717-aa5f-dbeaa79ab93c none            swap    sw              0       0


#UUID=72ACD728ACD6E61F  /media/library  ntfs-3g  auto,users,uid=1000,gid=100,umask=0022,utf8  0  0
UUID=72ACD728ACD6E61F   /media/library  ntfs-3g auto,users,rw   0   0

UUID=f9079f52-7661-48ad-9bc4-0d2452be66af   /media/Tera ext2    defaults,nofail 0   0
UUID=fb1f92ee-54f5-44f8-ba92-544e90e6dfeb   /media/Cloud    ext2    defaults,nofail 0   0
fmf@kodi:~$

我无法访问挂载点:

fmf@kodi:~$ ll /media/
ls: cannot access '/media/library': Transport endpoint is not connected
total 48
drwxr-xr-x 13 root root 4096 Sep  8 11:07 ./
drwxr-xr-x 24 root root 4096 Sep  8 11:51 ../
drwxr-xr-x  4 fmf  fmf  4096 Jul  4 17:44 Cloud/
d?????????  ? ?    ?       ?            ? library/
drwxrwxr-x  6 fmf  fmf  4096 Jul  4 17:23 Tera/
fmf@kodi:~$

但是如果我通过 sudo 卸载磁盘,然后以用户身份重新挂载它,它就可以工作(请注意库目录的不同权限):

fmf@kodi:~$ sudo umount /media/library
fmf@kodi:~$ ll /media/
total 52
drwxr-xr-x 13 root root 4096 Sep  8 11:07 ./
drwxr-xr-x 24 root root 4096 Sep  8 11:51 ../
drwxr-xr-x  4 fmf  fmf  4096 Jul  4 17:44 Cloud/
drwxr-xr-x  2 fmf  fmf  4096 Sep  6 21:30 library/
drwxrwxr-x  6 fmf  fmf  4096 Jul  4 17:23 Tera/
fmf@kodi:~$
fmf@kodi:~$ mount /media/library/
fmf@kodi:~$ ll /media/
total 52
drwxr-xr-x 13 root root 4096 Sep  8 11:07 ./
drwxr-xr-x 24 root root 4096 Sep  8 11:51 ../
drwxr-xr-x  4 fmf  fmf  4096 Jul  4 17:44 Cloud/
drwxrwxrwx  1 fmf  fmf  4096 Sep  8 11:46 library/
drwxrwxr-x  6 fmf  fmf  4096 Jul  4 17:23 Tera/
fmf@kodi:~$

我可以看到(空)磁盘:

fmf@kodi:~$ ll /media/library/
total 160
drwxrwxrwx  1 fmf  fmf    4096 Sep  8 11:46 ./
drwxr-xr-x 13 root root   4096 Sep  8 11:07 ../
fmf@kodi:~$

我觉得是 fstab 无法挂载磁盘,因为运行该命令的用户不被允许。但我甚至不知道 fstab 是否以用户身份运行,所以也许我的想法是错误的。

相关内容