我在 SD 卡上有 2 个分区(从 NIXOS Aarch64 映像获取),有时我在分区 2 上遇到一个非常烦人的问题:基本上,一旦我安装它并卸载它,我就无法再重新安装它,除非我重启。我收到错误:
[me@me:~]$ sudo LANG=C mount /dev/mmcblk0p2 /tmp/mmc
mount: /tmp/mmc: mount(2) system call failed: File exists.
我尝试检查mount
、fsck
和lsof
命令,但没有看到无法安装分区的任何原因。例如,这是我尝试过的记录:
[me@me:~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
[...]
mmcblk0 179:32 0 29,7G 0 disk
├─mmcblk0p1 179:33 0 30M 0 part
└─mmcblk0p2 179:34 0 29,7G 0 part
nvme0n1 259:0 0 953,9G 0 disk
[...]
[me@me:~]$ mount | grep mmcblk0
[me@me:~]$ mount | grep /tmp/
[me@me:~]$ mkdir /tmp/mmc
[me@me:~]$ sudo mount /dev/mmcblk0p2 /tmp/mmc
mount: /tmp/mmc: mount(2) system call failed: File exists.
[me@me:~]$ sudo mount /dev/mmcblk0p1 /tmp/mmc
[me@me:~]$ sudo lsof | grep mmcblk0p2
[me@me:~]$ sudo fsck /dev/mmcblk0p2
fsck de util-linux 2.33.2
e2fsck 1.45.5 (07-Jan-2020)
NIXOS_SD : récupération du journal
Définition du compteur d'i-noeuds libres à 1786283 (était 1786345)
Définition du compteur des blocs libres à 6611933 (était 6616142)
NIXOS_SD : propre, 155797/1942080 fichiers, 1170083/7782016 blocs
[me@me:~]$ sudo fsck /dev/mmcblk0p2
fsck from util-linux 2.33.2
e2fsck 1.45.5 (07-Jan-2020)
NIXOS_SD: clean, 155797/1942080 files, 1170083/7782016 blocks
[me@me:~]$ sudo mkdir /tmp/mmc2
[me@me:~]$ sudo LANG=C mount /dev/mmcblk0p2 /tmp/mmc
mount: /tmp/mmc: mount(2) system call failed: File exists.
[me@me:~]$ LANG=C umount /dev/mmcblk0p2
umount: /dev/mmcblk0p2: not mounted.
-- 编辑 -- Dmesg 给我以下错误。我还有几页调试信息,包括调用跟踪、代码、寄存器......我看到的错误是:
[76667.022409] sysfs: cannot create duplicate filename '/fs/ext4/mmcblk0p2'
[...]
[76667.022608] kobject_add_internal failed for mmcblk0p2 with -EEXIST, don't try to register things with the same name in the same directory.
[76667.022667] EXT4-fs (mmcblk0p2): mount failed