我在 USB 上实时运行 Kali,并尝试访问 Windows 10 分区(因为 Windows 有一个我们忘记的密码,并且我尝试更改 SAM 文件)。在 HD 驱动器上,我只是使用mount /dev/sdX /mnt
并输入,但在 SD 驱动器上(这是我第一次使用它们),我遇到了这个文件系统错误,我不知道如何解决。这是fdisk -l
结果:
Disk /dev/mmcblk0: 29.1 GiB, 31268536320 bytes, 61071360 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: BDCC441D-C0B3-4F13-A548-025EC15FA7FE
Device Start End Sectors Size Type
/dev/mmcblk0p1 2048 534527 532480 260M EFI System
/dev/mmcblk0p2 534528 567295 32768 16M Microsoft reserved
/dev/mmcblk0p3 567296 59054079 58486784 27.9G Microsoft basic data
/dev/mmcblk0p4 59054080 61059071 2004992 979M Windows recovery environment
Disk /dev/mmcblk0boot1: 4 MiB, 4194304 bytes, 8192 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
Disk /dev/mmcblk0boot0: 4 MiB, 4194304 bytes, 8192 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
Disk /dev/sda: 3.7 GiB, 4005560320 bytes, 7823360 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: 0x17fcad22
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 64 5898239 5898176 2.8G 17 Hidden HPFS/NTFS
/dev/sda2 5898240 5899647 1408 704K 1 FAT12
Disk /dev/loop0: 2.6 GiB, 2779897856 bytes, 5429488 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
这是结果fdisk /dev/mmcblk0p3 -l
Disk /dev/mmcblk0p3: 27.9 GiB, 29945233408 bytes, 58486784 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: 0x78787878
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p3p1 2021161080 4042322159 2021161080 963.8G 78 unknown
/dev/mmcblk0p3p2 2021161080 4042322159 2021161080 963.8G 78 unknown
/dev/mmcblk0p3p3 4294932600 8589899894 4294967295 2T 78 unknown
/dev/mmcblk0p3p4 4294967295 5035196669 740229375 353G ff BBT
这是结果file -s /dev/mmcblk0p3
/dev/mmcblk0p3: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "-FVE-FS-", sectors/cluster 8, reserved sectors 0, Media descriptor 0xf8, sectors/track 63, heads 255, hidden sectors 567296, FAT (32 bit), sectors/FAT 8160, serial number 0x0, unlabeled; NTFS, sectors/track 63, physical drive 0x1fe0, $MFT start cluster 393217, serial number 02020454d414e204f, checksum 0x41462020
这是结果lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 2.6G 1 loop /lib/live/mount/rootfs/filesystem.squashfs
sda 8:0 1 3.7G 0 disk
├─sda1 8:1 1 2.8G 0 part /lib/live/mount/medium
└─sda2 8:2 1 704K 0 part /media/root/Kali Live
mmcblk0 179:0 0 29.1G 0 disk
├─mmcblk0p1 179:1 0 260M 0 part
├─mmcblk0p2 179:2 0 16M 0 part
├─mmcblk0p3 179:3 0 27.9G 0 part
└─mmcblk0p4 179:4 0 979M 0 part
mmcblk0boot0 179:256 0 4M 1 disk
mmcblk0boot1 179:512 0 4M 1 disk
mmcblk0rpmb 179:768 0 4M 0 disk
当我运行这个命令时:
mount /dev/mmcblk0p3/ /mnt
我收到以下错误:
NTFS signature is missing.
Failed to mount '/dev/mmcblk0p3': Invalid argument
The device '/dev/mmcblk0p3' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
我也尝试过这个 mount -t vfat /dev/mmcblk0p3 /mnt
,但我得到:
mount: wrong fs type, bad option, bad superblock on /dev/mmcblk0p3,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
最后这是结果cat /proc/filesystems
nodev sysfs
nodev rootfs
nodev tmpfs
nodev bdev
nodev proc
nodev cpuset
nodev cgroup
nodev cgroup2
nodev devtmpfs
nodev debugfs
nodev tracefs
nodev securityfs
nodev sockfs
nodev dax
nodev bpf
nodev pipefs
nodev ramfs
nodev hugetlbfs
nodev devpts
nodev pstore
nodev mqueue
vfat
ntfs
iso9660
nodev overlay
squashfs
nodev autofs
nodev efivarfs
nodev binfmt_misc
fuseblk
nodev fuse
nodev fusectl
导致这些错误的原因可能是什么?
答案1
根本原因是您尝试挂载嵌套分区,而 Linux 无法将它们识别为块设备。这是 GPT 表/dev/mmcblk0
:
Disk /dev/mmcblk0: 29.1 GiB, 31268536320 bytes, 61071360 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: BDCC441D-C0B3-4F13-A548-025EC15FA7FE
Device Start End Sectors Size Type
/dev/mmcblk0p1 2048 534527 532480 260M EFI System
/dev/mmcblk0p2 534528 567295 32768 16M Microsoft reserved
/dev/mmcblk0p3 567296 59054079 58486784 27.9G Microsoft basic data
/dev/mmcblk0p4 59054080 61059071 2004992 979M Windows recovery environment
第三个分区/dev/mmcblk0p3
包含 MBR 表,而不是文件系统:
Disk /dev/mmcblk0p3: 27.9 GiB, 29945233408 bytes, 58486784 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: 0x78787878
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p3p1 2021161080 4042322159 2021161080 963.8G 78 unknown
/dev/mmcblk0p3p2 2021161080 4042322159 2021161080 963.8G 78 unknown
/dev/mmcblk0p3p3 4294932600 8589899894 4294967295 2T 78 unknown
/dev/mmcblk0p3p4 4294967295 5035196669 740229375 353G ff BBT
注意上面的 DOS 磁盘标签。但是,Linux 无法识别嵌套在分区中的 MBR 表。因此,MBR 分区不可用于安装:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
...
mmcblk0 179:0 0 29.1G 0 disk
├─mmcblk0p1 179:1 0 260M 0 part
├─mmcblk0p2 179:2 0 16M 0 part
├─mmcblk0p3 179:3 0 27.9G 0 part
| |-- No block devices are shown nested here.
└─mmcblk0p4 179:4 0 979M 0 part
...
解决方案
您可以使用循环挂载来挂载嵌套分区。本质上,您将创建一个指向嵌套分区的块设备,然后安装该块设备。请注意,这很难做到,并且考虑到 所示的嵌套分区的开始和结束扇区fdisk
显然不正确,我将无法提供太多指导。
基本上,您需要弄清楚嵌套分区的实际开始和结束位置,然后使用 offset 和 sizelimit 选项创建循环设备。像这样的东西:
mount /dev/mmcblk0p3 /mnt -o loop,offset=123,sizelimit=456
资源
man losetup
- 了解偏移量和大小限制- https://superuser.com/questions/83249/how-to-create-device-driver-for-nested-partitions- 类似的问题
- https://www.unix.com/filesystems-disks-and-memory/24366-can-loopback-filesystem-partitioned.html- 有关如何执行此操作的详细信息,但适用于较旧的驱动器;与气缸。