Mounting disk error "Structure needs cleaning"

Posted by itsmani1 on Sun, 01 Dec 2019 02:59:13 +0100

Step 1: view the file system


Several ways to view mounted partition and file system types


1) df-T can view the mounted partition and file system type

[root@localhost nginx]# df -T
Filesystem              Type     1K-blocks    Used Available Use% Mounted on
/dev/mapper/centos-root xfs       28289540 5970724  22318816  22% /
devtmpfs                devtmpfs    906088       0    906088   0% /dev
tmpfs                   tmpfs       917152       0    917152   0% /dev/shm
tmpfs                   tmpfs       917152   24880    892272   3% /run
tmpfs                   tmpfs       917152       0    917152   0% /sys/fs/cgroup
/dev/vda1               xfs        1038336  145756    892580  15% /boot

2) fdisk -l can display all the mounted and unmounted partitions, but not the file system type

[root@localhost nginx]# fdisk -l
Disk /dev/vda: 32.2 GB, 32212254720 bytes, 62914560 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 label type: dos
Disk identifier: 0x0009e475
   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048     2099199     1048576   83  Linux
/dev/vda2         2099200    62914559    30407680   8e  Linux LVM
Disk /dev/mapper/centos-root: 29.0 GB, 28982640640 bytes, 56606720 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/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 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

3) parted -l can view the types of unmounted file systems and those partitions that have not been formatted

[root@localhost nginx]# parted -l
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/centos-swap: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system     Flags
 1      0.00B  2147MB  2147MB  linux-swap(v1)


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/centos-root: 29.0GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system  Flags
 1      0.00B  29.0GB  29.0GB  xfs


Model: Virtio Block Device (virtblk)
Disk /dev/vda: 32.2GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  1075MB  1074MB  primary  xfs          boot
 2      1075MB  32.2GB  31.1GB  primary               lvm

5) lsblk -f can also view unmounted file system types

[root@master1 ~]# lsblk -f
NAME            FSTYPE      LABEL UUID                                   MOUNTPOINT
vda                                                                      
├─vda1          xfs               47540296-497a-4a1a-8eb5-602f3f1473e5   /boot
└─vda2          LVM2_member       N0luC7-9cMv-ZBNJ-icSN-SrJP-H0nX-JXvKK0 
  ├─centos-root xfs               407126a2-772a-4835-bebc-90cc7226bdf6   /
  └─centos-swap swap              e3bcb5e9-3e10-426c-9dd9-aa86bac03852   [SWAP]

Second, repair disk

Ext4 file system, use the command ﹣ fsck.ext4 /dev/xxx to repair,

If it is a xfs file system, use the command ‚ xfs ‚ repair - L / dev / xxx to repair

In general, it can be mounted after repair,

But if there is a problem with the disk, or if there is a problem with the array, this repair may fail, and the grid is still required when mounting, then make a decisive grid


Topics: Linux CentOS Nginx