每次启动时如果不使用 e2fsck,则无法安装驱动器

每次启动时如果不使用 e2fsck,则无法安装驱动器

如果我想安装此驱动器,每次启动后都需要运行 e2fsck 或 fsck.ext4。此后所有数据都可见且可访问。

uuid 仅在“fsck.ext4”或“e2fsck”之后出现在系统列表中。“fsck.ext4”之后出现的 uuid 位于 fstab 中,在“sudo mount -a”之后,它会成功挂载。但下次启动时我必须执行“fsck.ext4”或“e2fsck”并再次挂载。

我记得我曾通过 gparted usb 意外删除过此磁盘上的一个小的第一个分区。这可能是导致此行为的原因,对吧?如何解决这个问题?

FV42JOA:~$ sudo mount /dev/sdb /mnt/wsl/hdd10 mount: /mnt/wsl/hdd10: wrong fs type, bad option, bad superblock on /dev/sdc, missing codepage or helper program, or other error.(e2fsck 之前)

lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 256G 0 disk / sdb 8:16 0 10.9T 0 disk

FV42JOA:~$ sudo fsck.ext4 /dev/sdb e2fsck 1.45.5 (07-Jan-2020) ext2fs_open2: Bad magic number in super-block fsck.ext4: Superblock invalid, trying backup blocks... Superblock needs_recovery flag is clear, but journal has data. Recovery flag not set in backup superblock, so running journal anyway. hdd4: recovering journal Pass 1: Checking inodes, blocks, and sizes ... Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information Free blocks count wrong for group #0 (30649, counted=1461). Fix<y>?

...(在“修复?”处按“a”后会出现很多数字)

Free inodes count wrong for group #0 (21, counted=0). Fix? yes Free inodes count wrong for group #1 (32, counted=0). Fix? yes Free inodes count wrong for group #2 (32, counted=0). Fix? yes Free inodes count wrong for group #3 (32, counted=7). Fix? yes Free inodes count wrong (2861045, counted=2860935). Fix? yes Padding at end of inode bitmap is not set. Fix? yes Block bitmap differences: Group 0 block bitmap does not match checksum. FIXED. hdd4: ***** FILE SYSTEM WAS MODIFIED ***** hdd4: 121/2861056 files (0.8% non-contiguous), 2923633429/2929721344 blocks

FV42JOA:~$ sudo smartctl --all /dev/sdb smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.72-microsoft-standard-WSL2] (local build) Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Vendor: WDC Product: WD121KRYZ-01W0RB Revision: 01.0 User Capacity: 12,000,138,625,024 bytes [12.0 TB] Logical block size: 512 bytes Physical block size: 4096 bytes LU is fully provisioned Rotation Rate: 7200 rpm Form Factor: 3.5 inches >> Terminate command early due to bad response to IEC mode page A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

FV42JOA:~$ sudo skdump /dev/sdb Device: sat16:/dev/sdb Type: 16 Byte SCSI ATA SAT Passthru Size: 11444224 MiB Awake: Operation not supported ATA SMART not supported.

FV42JOA:~$ sudo df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda 263174212 3337580 246398476 2% / /dev/sdb 11716272064 11691920404 24335276 100% /mnt/wsl/hdd10(在 e2fsck 和 mount 之后)

FV42JOA:~$ sudo hdparm -I /dev/sdb /dev/sdb: SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 07 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ATA device, with non-removable media Standards: Likely used: 1 Configuration: Logical max current cylinders 0 0 heads 0 0 sectors/track 0 0 -- Logical/Physical Sector size: 512 bytes device size with M = 1024*1024: 0 MBytes device size with M = 1000*1000: 0 MBytes cache/buffer size = unknown Capabilities: IORDY not likely Cannot perform double-word IO R/W multiple sector transfer: not supported DMA: not supported PIO: pio0(在 e2fsck 和 mount 之后)

按照 heynnema 的要求,我注意到我切换到了 ubuntu live usb,并且下面的磁盘星座与上面的所有内容都不相同,我插入和拔出了一些驱动器。

在这种情况下(fdisk 在 fsck 之前),我的磁盘 /dev/sdb、/dev/sde 和 /dev/sdf 都出现了这个问题

Disk /dev/loop0: 2.1 GiB, 2160009216 bytes, 4218768 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/loop1: 55.45 MiB, 58130432 bytes, 113536 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/loop2: 219 MiB, 229638144 bytes, 448512 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/loop3: 50.98 MiB, 53432320 bytes, 104360 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/loop4: 65.1 MiB, 68259840 bytes, 133320 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/loop5: 32.3 MiB, 33865728 bytes, 66144 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: 111.81 GiB, 120034123776 bytes, 234441648 sectors
Disk model: Crucial_CT120M50
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 379DAC7C-9EF1-4077-B2C6-5828602E3F12

Device         Start       End  Sectors  Size Type
/dev/sda1       2048  39063551 39061504 18.6G Linux swap
/dev/sda2   39063552  78125055 39061504 18.6G Linux filesystem
/dev/sda3   78125056 117186559 39061504 18.6G Linux filesystem
/dev/sda4  117186560 118163455   976896  477M Linux filesystem
/dev/sda5  118163456 129882111 11718656  5.6G Linux filesystem
/dev/sda6  129882112 141600767 11718656  5.6G Linux filesystem


Disk /dev/sdg: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: ST8000DM004-2CX1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sde: 12.75 TiB, 14000519643136 bytes, 27344764928 sectors
Disk model: ST14000NM001G-2K
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: A968E824-8EEC-4F6F-9297-E0AED5A66EEF

Device     Start   End Sectors Size Type
/dev/sde1     34 32767   32734  16M Microsoft reserved

Partition 1 does not start on physical sector boundary.


Disk /dev/sdf: 10.94 TiB, 12000138625024 bytes, 23437770752 sectors
Disk model: WDC WD120EMFZ-11
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: CDD1B551-4A3D-4FDE-BD6D-08CC02D6875C


Disk /dev/sdb: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: ST8000DM004-2CX1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 296AB478-D5B3-4E6E-8EC6-1330DD7C6AD4


Disk /dev/sdc: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: ST8000DM004-2CX1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 2E53662E-3F2E-43B0-A5CA-3DA685BAF97C

Device      Start         End     Sectors  Size Type
/dev/sdc2  264192 15628052479 15627788288  7.3T Microsoft basic data


Disk /dev/sdh: 12.75 TiB, 14000519643136 bytes, 27344764928 sectors
Disk model: ST14000NM001G-2K
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sdd: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: ST8000DM004-2CX1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 12103BA4-CED8-4E6B-9B9B-DE5F407F9B77

Device      Start         End     Sectors  Size Type
/dev/sdd1      34      262177      262144  128M Microsoft reserved
/dev/sdd2  264192 15628052479 15627788288  7.3T Microsoft basic data

Partition 1 does not start on physical sector boundary.


Disk /dev/sdi: 29.74 GiB, 31914983424 bytes, 62333952 sectors
Disk model: SD  Transcend   
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: 0x7722bf23

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdi1  *     2048 62333951 62331904 29.7G  c W95 FAT32 (LBA)```

**Thank you!**

答案1

要正确地 fsck 文件系统,正确的方法如下...

  • 以“试用 Ubuntu”模式启动 Ubuntu Live DVD/USB
  • terminalCtrl+ Alt+打开窗口T
  • 类型sudo fdisk -l
  • 识别“Linux 文件系统”的 /dev/sdXX 设备名称
  • 输入sudo fsck -f /dev/sdXX,替换sdXX为您之前找到的数字
  • fsck如果有错误则重复命令
  • 类型reboot

更新#1:

备份数据。重新格式化驱动器。现在有分区了。一切又恢复正常了。

相关内容