설치: /mnt/sda2에 /dev/sda2 설치 실패: 잘못된 인수

설치: /mnt/sda2에 /dev/sda2 설치 실패: 잘못된 인수

나는 후속 조치를 취하고 있다이 튜토리얼. 그런데 9단계에서 멈춰서 USB를 마운트할 수 없습니다.

USB를 마운트하려고 할 때마다 다음 오류가 발생합니다.

root@OpenWrt:~# mount /dev/sda2 /mnt/sda2
mount: mounting /dev/sda2 on /mnt/sda2 failed: Invalid argument

USB는 잘 연결되어 있는 것 같은데, 왠지 sda2(ext4) 파티션을 마운트할 수 없습니다.

파티셔닝에는 문제가 없는 것 같습니다.

root@OpenWrt:~# blkid
/dev/mtdblock2: TYPE="squashfs"
/dev/sda1: UUID="e39964e8-1b51-4b1f-b034-0147fa394eea" TYPE="swap"
/dev/sda2: UUID="157cfc0d-f33d-4103-950d-6ae01baa7177" TYPE="ext4"

이것은 내 dmesg결과입니다.

root@OpenWrt:~# dmesg | grep sda
[    9.360000] sd 0:0:0:0: [sda] 7987200 512-byte logical blocks: (4.08 GB/3.80 GiB)
[    9.370000] sd 0:0:0:0: [sda] Write Protect is off
[    9.370000] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
[    9.370000] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[    9.400000]  sda: sda1 sda2
[    9.410000] sd 0:0:0:0: [sda] Attached SCSI removable disk
[   41.850000] EXT4-fs (sda2): couldn't mount as ext3 due to feature incompatibilities
[   41.870000] EXT4-fs (sda2): couldn't mount as ext2 due to feature incompatibilities
[   41.880000] EXT4-fs (sda2): couldn't mount RDWR because of unsupported optional features (400)
[  270.660000] EXT4-fs (sda2): couldn't mount as ext3 due to feature incompatibilities
[  270.670000] EXT4-fs (sda2): couldn't mount as ext2 due to feature incompatibilities
[  270.670000] EXT4-fs (sda2): couldn't mount RDWR because of unsupported optional features (400)
[  585.040000] EXT4-fs (sda2): couldn't mount as ext3 due to feature incompatibilities
[  585.050000] EXT4-fs (sda2): couldn't mount as ext2 due to feature incompatibilities
[  585.060000] EXT4-fs (sda2): couldn't mount RDWR because of unsupported optional features (400)
[  586.540000] EXT4-fs (sda2): couldn't mount as ext3 due to feature incompatibilities
[  586.550000] EXT4-fs (sda2): couldn't mount as ext2 due to feature incompatibilities
[  586.560000] EXT4-fs (sda2): couldn't mount RDWR because of unsupported optional features (400)
[  651.570000] EXT4-fs (sda2): couldn't mount as ext3 due to feature incompatibilities
[  651.580000] EXT4-fs (sda2): couldn't mount as ext2 due to feature incompatibilities
[  651.590000] EXT4-fs (sda2): couldn't mount RDWR because of unsupported optional features (400)

이것은 내 fdisk -l결과입니다.

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 4089 MB, 4089446400 bytes
255 heads, 63 sectors/track, 497 cylinders, total 7987200 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 identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1     7987199     3993599+  ee  GPT

답변1

오류 메시지는 다음 줄에서 나옵니다 <Linux kernel source code>/fs/ext4/super.c.

        if (ext4_has_unknown_ext4_ro_compat_features(sb)) {
            ext4_msg(sb, KERN_ERR, "couldn't mount RDWR because of "
                     "unsupported optional features (%x)",
                     (le32_to_cpu(EXT4_SB(sb)->s_es->s_feature_ro_compat) &
                            ~EXT4_FEATURE_RO_COMPAT_SUPP));

오류 메시지의 숫자에 대한 자리 표시자는 이므로 %x오류 메시지의 실제 숫자 400은 16진수로 0x400입니다. 기능이 EXT4_FEATURE_RO_COMPAT_상수로 식별되면 유형입니다.

이러한 상수는 다음에서 정의할 수 있습니다 <Linux kernel source code>/fs/ext4/ext4.h.

#define EXT4_FEATURE_RO_COMPAT_METADATA_CSUM    0x0400

dir_nlinksourcejedi가 언급한 서명은 0x400이 아니라 0x20입니다.

#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK        0x0020

따라서 MR3020은 운영 체제가 ext4 메타데이터 체크섬을 처리할 수 없기 때문에 읽기/쓰기 모드로 파일 시스템을 마운트할 수 없습니다. 따라서 USB 스틱을 생성하는 데 사용하는 Linux 시스템에서 이 기능을 꺼야 합니다. USB 스틱을 시스템으로 다시 이동하고(ext4 파일 시스템을 마운트하지 않음) 다음을 실행합니다.

tune2fs -O^metadata_csum /dev/sdX2

(X를 Linux 시스템에 있는 USB 스틱의 실제 식별자로 바꾸십시오.)

이 명령을 성공적으로 실행하면 metadata_csumUSB 스틱의 ext4 파일 시스템에서 이 기능이 비활성화되고 이제 MR3020에서 이 기능을 사용할 수 있습니다.

답변2

마운트 시도는 ext4가 아닌 ext3 및 ext2만 시도하는 것 같습니다. 커널에 ext4가 있나요? (에 기재되어 있습니다 .) 기재 /proc/filesystems하셨습니까 ?/dev/sda2/etc/fstab외부 3?

답변3

TL-MR3020 v3에서도 이 문제가 발생했는데, ext4 대신 ext3 파티션을 만들어 문제를 해결하고 드라이브를 성공적으로 마운트했습니다.

제가 수행한 단계는 다음과 같습니다(OpenWRT 웹사이트의 단계에 따라 ext4를 ext3으로 교체).

root@OpenWrt:~# mkfs.ext3 /dev/sda1
mke2fs 1.44.5 (15-Dec-2018)
/dev/sda1 contains a ext4 file system
        created on Sun Sep 27 06:13:56 2020
Proceed anyway? (y,N) y
Creating filesystem with 511744 4k blocks and 128000 inodes
Filesystem UUID: 2bbb533d-925f-43fb-946a-4190fe612186
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

root@OpenWrt:~# block detect | uci import fstab
root@OpenWrt:~# uci set fstab.@mount[0].enabled='1' && uci set fstab.@global[0].anon_mount='1' && uci commit fstab
root@OpenWrt:~# /etc/init.d/fstab boot
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.5M      2.5M         0 100% /rom
tmpfs                    29.3M      1.1M     28.2M   4% /tmp
/dev/mtdblock4            3.8M      1.2M      2.5M  33% /overlay
overlayfs:/overlay        3.8M      1.2M      2.5M  33% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda1                 1.9G      3.0M      1.8G   0% /mnt/sda1
root@OpenWrt:~#

나는 이것이 오래된 질문이라는 것을 알고 있지만 아마도 누군가에게 도움이 될 것입니다.

답변4

파티션을 생성한 후 ext4로 포맷하셨나요?

mkfs.ext4 /dev/sda2

그런 다음 파일 시스템 유형을 명시적으로 지정하여 ext4를 사용하여 마운트하거나 마운트해 보십시오.mount -t ext4 /dev/sda2 /mnt/sda2

관련 정보