새로 포맷한 USB 저장장치를 마운트할 수 없습니다.

새로 포맷한 USB 저장장치를 마운트할 수 없습니다.

방금 구입한 값싼 USB 드라이브에 문제가 있습니다. 이것이 제가 지금까지 한 일입니다.

먼저 기기 ID를 확인한 후 기기를 지웠습니다.

$ sudo dd status=progress if=/dev/zero of=/dev/sdi
4027441664 bytes (4.0 GB, 3.8 GiB) copied, 1334 s, 3.0 MB/s    
dd: writing to '/dev/sdi': No space left on device
7866369+0 records in
7866368+0 records out
4027580416 bytes (4.0 GB, 3.8 GiB) copied, 1462.23 s, 2.8 MB/s

그런 다음 위에 파티션을 만들었습니다.

$ sudo fdisk /dev/sdi

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xd899fea4.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (1-4, default 1): 
First sector (2048-7866367, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-7866367, default 7866367): +2G

Created a new partition 1 of type 'Linux' and of size 2 GiB.

그런 다음 FAT로 변환합니다.

Command (m for help): t
Selected partition 1
Partition type (type L to list all types): c
Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

Command (m for help):

그런 다음 두 번째 파티션을 만들었습니다.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (2-4, default 2): 
First sector (4196352-7866367, default 4196352): 
Last sector, +sectors or +size{K,M,G,T,P} (4196352-7866367, default 7866367): 

Created a new partition 2 of type 'Linux' and of size 1.8 GiB.

그런 다음 FAT로도 변환했습니다.

Command (m for help): t
Partition number (1,2, default 2): 
Partition type (type L to list all types): c

Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

그런 다음 두 번째 파티션을 부팅 가능하게 만들었습니다.

Command (m for help): a
Partition number (1,2, default 2): 

The bootable flag on partition 2 is enabled now.

그런 다음 모든 것이 정상인지 확인한 후 저장합니다.

Command (m for help): p
Disk /dev/sdi: 3.8 GiB, 4027580416 bytes, 7866368 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: 0xd899fea4

Device     Boot   Start     End Sectors  Size Id Type
/dev/sdi1          2048 4196351 4194304    2G  c W95 FAT32 (LBA)
/dev/sdi2  *    4196352 7866367 3670016  1.8G  c W95 FAT32 (LBA)

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

그런 다음 파일 시스템을 만들었습니다.

$ sudo mkfs.vfat /dev/sdi1
mkfs.fat 4.1 (2017-01-24)
$ sudo mkfs.vfat /dev/sdi2
mkfs.fat 4.1 (2017-01-24)

그런 다음 설치를 시도했는데 여기서 문제가 발견되었습니다.

$ sudo mount /dev/sdi1 /mnt/1
$ sudo mount /dev/sdi2 /mnt/2
mount: wrong fs type, bad option, bad superblock on /dev/sdi2,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

보시다시피 두 번째 파티션을 마운트할 수 없습니다. 먼저 /mnt/2가 실제로 존재하는지 확인합니다.

$ tree /mnt
/mnt
├── 1
├── 2
├── 3
└── laura

4 directories, 0 files

그런 다음 부팅 가능 플래그를 다시 변경해 보았지만 소용이 없었습니다.

$ sudo fdisk /dev/sdi

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): a
Partition number (1,2, default 2): 

The bootable flag on partition 2 is disabled now.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

$ sudo umount /mnt/1
$ sudo partprobe
$ sudo mount /dev/sdi1 /mnt/1
$ sudo mount /dev/sdi2 /mnt/2
mount: wrong fs type, bad option, bad superblock on /dev/sdi2,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

다음으로 파티션 유형을 변경해 보았습니다.

$ sudo umount /mnt/1
$ sudo fdisk /dev/sdi

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): t
Partition number (1,2, default 2): 
Partition type (type L to list all types): 83

Changed type of partition 'W95 FAT32 (LBA)' to 'Linux'.

Command (m for help): t
Partition number (1,2, default 2): 1
Partition type (type L to list all types): 83

Changed type of partition 'W95 FAT32 (LBA)' to 'Linux'.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

ext4 파일 시스템을 만들었습니다.

$ sudo mkfs.ext4 /dev/sdi1
mke2fs 1.43.4 (31-Jan-2017)
/dev/sdi1 contains a vfat file system
Proceed anyway? (y,N) y
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: 25ddfdac-d7eb-4c00-b0fe-c58a46cfac17
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912

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

$ sudo mkfs.ext4 /dev/sdi2
mke2fs 1.43.4 (31-Jan-2017)
/dev/sdi2 contains `ISO-8859 text, with very long lines, with no line terminators' data
Proceed anyway? (y,N) y
Creating filesystem with 458752 4k blocks and 114688 inodes
Filesystem UUID: 5cdf13ed-453a-4947-9a5e-84b32a426648
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 

/dev/sdi2에는 vfat 파일 시스템이 아니라 "긴 줄이 있고 줄 종결자 데이터가 없는 ISO-8859 텍스트"가 포함되어 있는 것으로 보고되었습니다.

파티션을 마운트하려고 할 때 그 중 아무 것도 작동하지 않습니다.

$ sudo mount /dev/sdi1 /mnt/1
mount: wrong fs type, bad option, bad superblock on /dev/sdi1,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

$ sudo mount /dev/sdi2 /mnt/2
mount: wrong fs type, bad option, bad superblock on /dev/sdi2,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

그래서 나는 그들의 크기를 바꾸기로 결정했습니다. 이를 위해 파티션을 삭제하고 다른 크기로 다시 생성했습니다.

$ sudo fdisk /dev/sdi

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): d
Partition number (1,2, default 2): 

Partition 2 has been deleted.

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (1-4, default 1): 
First sector (2048-7866367, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-7866367, default 7866367): +128M

Created a new partition 1 of type 'Linux' and of size 128 MiB.
Partition #1 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: y

The signature will be removed by a write command.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (2-4, default 2): 
First sector (264192-7866367, default 264192): 
Last sector, +sectors or +size{K,M,G,T,P} (264192-7866367, default 7866367): 

Created a new partition 2 of type 'Linux' and of size 3.6 GiB.

Command (m for help): p
Disk /dev/sdi: 3.8 GiB, 4027580416 bytes, 7866368 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: 0xd899fea4

Device     Boot  Start     End Sectors  Size Id Type
/dev/sdi1         2048  264191  262144  128M 83 Linux
/dev/sdi2       264192 7866367 7602176  3.6G 83 Linux

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

이제 ext4 파일 시스템을 만들었습니다.

$ sudo mkfs.ext4 /dev/sdi1
mke2fs 1.43.4 (31-Jan-2017)
Creating filesystem with 131072 1k blocks and 32768 inodes
Filesystem UUID: 6ddbd9b9-590d-4566-9bd7-542fe208d3e3
Superblock backups stored on blocks: 
    8193, 24577, 40961, 57345, 73729

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

$ sudo mkfs.ext4 /dev/sdi2
mke2fs 1.43.4 (31-Jan-2017)
/dev/sdi2 contains `Lotus unknown worksheet or configuration, revision 0x0' data
Proceed anyway? (y,N) y
Creating filesystem with 950272 4k blocks and 237568 inodes
Filesystem UUID: 496ff913-1af7-4b9f-942a-29ae431cc9b2
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736

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

/dev/sdi2 보고서에 "Lotus 알 수 없는 워크시트 또는 구성, 개정 0x0 데이터"가 어떻게 포함되어 있는지 다시 한 번 확인하세요.

파티션을 마운트하려고 할 때에도 동일한 문제가 발생합니다.

$ sudo mount /dev/sdi1 /mnt/1
$ sudo mount /dev/sdi2 /mnt/2
mount: wrong fs type, bad option, bad superblock on /dev/sdi2,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

그런 다음 유형을 다시 FAT로 변경하고 뚱뚱한 파일 시스템을 만들어 보았습니다.

$ sudo umount /mnt/1
$ sudo fdisk /dev/sdi

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): t
Partition number (1,2, default 2): 1
Partition type (type L to list all types): c

Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

Command (m for help): t
Partition number (1,2, default 2): 
Partition type (type L to list all types): c

Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

$ sudo mkfs.vfat /dev/sdi1
mkfs.fat 4.1 (2017-01-24)
$ sudo mkfs.vfat /dev/sdi2
mkfs.fat 4.1 (2017-01-24)

그런 다음 설치하려고 하면 다음과 같이 추측됩니다.

$ sudo mount /dev/sdi1 /mnt/1
$ sudo mount /dev/sdi2 /mnt/2
$ echo "hello" | sudo tee /mnt/2/hi
hello
$ cat /mnt/2/hi
hello

다다! 효과가있다!

그러나 파티션은 원래 크기여야 합니다. 어떤 아이디어가 있나요? 하드웨어 문제인가요? 이 USB는 너무 쓰레기인가요?

답변1

자체 용량을 과장해서 생각하는 불량 USB가 아닐까 의심됩니다. 여러 논리적 블록이 동일한 물리적 블록에 매핑되지 않는지 확인하기 위해 이를 테스트하는 프로그램을 구하십시오.

불행히도 대부분은 Windows 프로그램인 것 같습니다.

https://www.raymond.cc/blog/test-and-Detect-fake-or-counterfeit-usb-flash-drives-bought-from-ebay-with-h2testw/

하지만 그것은 빠른 Google을 통해서였습니다. 나는 이것을 보았지만 아직 시도하지는 않았습니다.

https://fixfakeflash.wordpress.com/2010/08/20/linux-h2testw-alternative-program-known-f3-by-michel%C2%A0machado/

답변2

설치했습니다F3 도구미셸 마차도. 저는 Arch Linux를 사용할 때 다음을 수행합니다.

$ cd /tmp
$ git clone https://aur.archlinux.org/f3.git
$ cd f3
$ makepkg -si

그런 다음 f3probe를 사용하여 USB 디스크가 실제로 가짜인지 테스트했습니다.

$ sudo f3probe /dev/sdi
F3 probe 6.0
Copyright (C) 2010 Digirati Internet LTDA.
This is free software; see the source for copying conditions.

WARNING: Probing normally takes from a few seconds to 15 minutes, but
         it can take longer. Please be patient.

Probe finished, recovering blocks... Done

Bad news: The device `/dev/sdi' is a counterfeit of type limbo

You can "fix" this device using the following command:
f3fix --last-sec=473913 /dev/sdi

Device geometry:
             *Usable* size: 231.40 MB (473914 blocks)
            Announced size: 3.75 GB (7866368 blocks)
                    Module: 4.00 GB (2^32 Bytes)
    Approximate cache size: 1.00 MB (2048 blocks), need-reset=no
       Physical block size: 512.00 Byte (2^9 Bytes)

Probe time: 42.34s

이것은 :(감사합니다밥 아이거나에게 올바른 방향을 알려줬어요! 또한보십시오이 관련 질문.

관련 정보