Ubuntu文件挂载时报错“linux_raid_member”
Admin
本站
点击:100 次
今天在一台Ubuntu服务器上进行挂载硬盘时报错提示“linux_raid_member”
下面看下解决办法。

首先查看下原有设备。
root@file:/home/file# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 89.1M 1 loop /snap/core/8268 sda 8:0 0 477G 0 disk ├─sda1 8:1 0 1M 0 part └─sda2 8:2 0 477G 0 part / sdb 8:16 0 7.3T 0 disk
开始分区、挂载
root@file:/home/file# parted /dev/sdb GNU Parted 3.2 Using /dev/sdb Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) p Model: ATA ST8000NM000A-2KE (scsi) Disk /dev/sdb: 8002GB Sector size (logical/physical): 512B/4096B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags (parted) mklabel gpt Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? y (parted) mkpart Partition name? []? File system type? [ext2]? ext4 Start? 0 End? -1 Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? Ignore/Cancel? i (parted) exit
感觉哪里不对,之前挂载没有这些提示啊,继续挂载
root@file:/home/file# mount /dev/sdb1 /data mount: /data: unknown filesystem type 'linux_raid_member'.
问题来了,格式化一下,依然报错
root@file:/home/file# mkfs.ext4 /dev/sdb1 mke2fs 1.44.1 (24-Mar-2018) /dev/sdb1 contains a linux_raid_member file system labelled 'file-System-Product-Name:0' Proceed anyway? (y,N) y /dev/sdb1 is apparently in use by the system; will not make a filesystem here!
这时才想起来,原来这块硬盘是之前做过软raid,好了问题找到了,我们删除下raid信息
root@file:/home/file# dmsetup status No devices found root@file:/home/file# cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md127 : inactive sdb1[1](S) 7813893495 blocks super 1.2 unused devices: <none> root@file:/home/file# mdadm -S /dev/md127mdadm: stopped /dev/md127 root@file:/home/file# cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] unused devices: <none>
再次格式化
root@file:/home/file# mkfs.ext4 /dev/sdb1 mke2fs 1.44.1 (24-Mar-2018) /dev/sdb1 contains a linux_raid_member file system labelled 'file-System-Product-Name:0' Proceed anyway? (y,N) y /dev/sdb1 alignment is offset by 3072 bytes. This may result in very poor performance, (re)-partitioning suggested. Creating filesystem with 1953506397 4k blocks and 244191232 inodes Filesystem UUID: 1d2d1374-ca5e-42ad-87bd-6d8cdb7279b1 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848, 512000000, 550731776, 644972544, 1934917632 Allocating group tables: done Writing inode tables: done Creating journal (262144 blocks): done Writing superblocks and filesystem accounting information: done
挂载没问题。
root@file:/home/file# mount /dev/sdb1 /data
查看下,容量出来了
root@file:/home/file# df -h /data Filesystem Size Used Avail Use% Mounted on/dev/sdb1 7.3T 93M 6.9T 1% /data
添加到 /etc/fstab 文件末尾,保存退出 实现开机自动挂载
root@file:/home/file# vim /etc/fstab /dev/sdb1 /data ext4 defaults 0 0