天天看點

linux 挂載_UBUNTU挂載硬碟時報錯LINUX_RAID_MEMBER

今天在一台Ubuntu伺服器上進行挂載硬碟時報錯提示“linux_raid_member”

下面看下解決辦法。

linux 挂載_UBUNTU挂載硬碟時報錯LINUX_RAID_MEMBER

UBUNTU挂載硬碟時報錯LINUX_RAID_MEMBER

首先檢視下原有裝置。

[email protected]:/home/file# lsblkNAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTloop0    7:0    0 89.1M  1 loop /snap/core/8268sda      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            

開始分區、挂載

[email protected]:/home/file# parted /dev/sdbGNU Parted 3.2Using /dev/sdbWelcome to GNU Parted! Type 'help' to view a list of commands.(parted) p                                                                Model: ATA ST8000NM000A-2KE (scsi)Disk /dev/sdb: 8002GBSector size (logical/physical): 512B/4096BPartition Table: gptDisk 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           

感覺哪裡不對,之前挂載沒有這些提示啊,繼續挂載

[email protected]:/home/file# mount /dev/sdb1 /datamount: /data: unknown filesystem type 'linux_raid_member'.           

問題來了,格式化一下,依然報錯

[email protected]:/home/file# mkfs.ext4 /dev/sdb1mke2fs 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資訊

[email protected]:/home/file# dmsetup statusNo devices [email protected]:/home/file# cat /proc/mdstatPersonalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md127 : inactive sdb1[1](S)      7813893495 blocks super 1.2unused devices: [email protected]:/home/file#  mdadm -S /dev/md127mdadm: stopped /dev/[email protected]:/home/file#   cat /proc/mdstatPersonalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] unused devices:            

再次格式化

[email protected]:/home/file# mkfs.ext4 /dev/sdb1mke2fs 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 inodesFilesystem UUID: 1d2d1374-ca5e-42ad-87bd-6d8cdb7279b1Superblock 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, 1934917632Allocating group tables: done     Writing inode tables: done  Creating journal (262144 blocks): doneWriting superblocks and filesystem accounting information:            done           

挂載沒問題。

[email protected]:/home/file# mount /dev/sdb1 /data           

檢視下,容量出來了

[email protected]:/home/file# df -h /data Filesystem      Size  Used Avail Use% Mounted on/dev/sdb1       7.3T   93M  6.9T   1% /data           

添加到 /etc/fstab 檔案末尾,儲存退出 實作開機自動挂載

[email protected]:/home/file# vim /etc/fstab /dev/sdb1  /data        ext4    defaults        0 0             

繼續閱讀