我有一张插入 SD 适配器的微型 SD 卡。使用 gparted,我创建了一个 ext4 分区并格式化为 ext3。当该过程完成时,我得到一个与该分区条目关联的警告图标,单击它会显示如下所示的消息。
<i>Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: 25928fdc-c49c-4782-9b0c-97fa557aa323
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 2048000
Block count: 8191744
Reserved block count: 409587
Free blocks: 8018170
Free inodes: 2047989
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1022
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
Flex block group size: 16
Filesystem created: Sun Jun 24 06:01:00 2018
Last mount time: n/a
Last write time: Sun Jun 24 06:01:00 2018
Mount count: 0
Maximum mount count: -1
Last checked: Sun Jun 24 06:01:00 2018
Check interval: 0 (<none>)
Lifetime writes: 132 MB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: 2ba00213-aba2-49cc-8134-0ba0dfbc89df
Journal backup: inode blocks</i>
<i>dumpe2fs 1.42.13 (17-May-2015)
Journal superblock magic number invalid!</i>
<i>Unable to read the contents of this file system!
Because of this, some operations may be unavailable.
The cause might be a missing software package.
The following list of software packages is required for ext4 file system support: e2fsprogs v1.41+.</i>
当我将其移除并插入系统时,出现一个带有以下消息的对话框:
Error mounting /dev/mmcblk0p1 at /media/wt/25928fdc-c49c-4782-9b0c-97fa557aa323: Command-line `mount -t "ext4" -o "uhelper=udisks2,nodev,nosuid" "/dev/mmcblk0p1" "/media/wt/25928fdc-c49c-4782-9b0c-97fa557aa323"' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on /dev/mmcblk0p1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
我还尝试使用 fdisk 创建 DOS 分区表,然后继续创建 linux 分区,然后使用 mkfs.ext4 创建 ext4 文件系统。当我将 SD 卡插入系统时,它也会显示相同的对话框,并显示上述消息。
$ sudo fdisk /dev/mmcblk0
-delete previous partition table
-create new DOS partition
-create new partition
$ sudo mkfs.ext4 /dev/mmcblk0p1
更新2018/06/26:
我使用的是无名的 10 级 32GB microSD 卡。我还使用过 10 级 Sandisk Ultra 32GB HC I。它们都给我带来了同样的问题。我应该注意,将 microSD 配置为 fat32 和 ext2 文件系统是可以的。但对于 ext3 和 ext4 则失败。
以下是使用控制台创建分区和 ext4 文件系统的步骤:
$ sudo fdisk /dev/mmcblk0
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): o
Created a new DOS disklabel with disk identifier 0xd01d80de.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-65535999, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-65535999, default 65535999):
Created a new partition 1 of type 'Linux' and of size 31.3 GiB.
Command (m for help): p
Disk /dev/mmcblk0: 31.3 GiB, 33554432000 bytes, 65536000 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: 0xd01d80de
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 2048 65535999 65533952 31.3G 83 Linux
Command (m for help): a
Selected partition 1
The bootable flag on partition 1 is enabled now.
Command (m for help): p
Disk /dev/mmcblk0: 31.3 GiB, 33554432000 bytes, 65536000 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: 0xd01d80de
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 65535999 65533952 31.3G 83 Linux
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
$ sudo mkfs.ext4 /dev/mmcblk0p1
mke2fs 1.42.13 (17-May-2015)
/dev/mmcblk0p1 contains a ext4 file system
created on Wed Jun 27 00:29:23 2018
Proceed anyway? (y,n) y
Creating filesystem with 8191744 4k blocks and 2048000 inodes
Filesystem UUID: f58e93c1-b72d-42b0-bc67-2a73beaeb1dc
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
当 SD 卡插入插槽时,我的桌面上会显示一个对话框,其中显示以下错误消息:
Error mounting /dev/mmcblk0p1 at /media/wt/f58e93c1-b72d-42b0-bc67-2a73beaeb1dc: Command-line `mount -t "ext4" -o "uhelper=udisks2,nodev,nosuid" "/dev/mmcblk0p1" "/media/wt/f58e93c1-b72d-42b0-bc67-2a73beaeb1dc"' exited with non-zero exit status 32: mount: /dev/mmcblk0p1 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/mmcblk0p1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
$ dmesg|tail
...
[38477.068800] mmc0: new high speed SDHC card at address 0001
[38477.069303] mmcblk0: mmc0:0001 USB D 31.3 GiB (ro)
[38477.071263] mmcblk0: p1
[38477.564510] JBD2: no valid journal superblock found
[38477.564516] EXT4-fs (mmcblk0p1): error loading journal