系统相关
首页 > 系统相关> > linux – 挂载属于RAID 1的单个硬盘

linux – 挂载属于RAID 1的单个硬盘

作者:互联网

所以我有一个带有两个硬盘的RAID 1.一个硬盘发生故障,然后我更换了它,我在这个新硬盘上重新安装了一个新的Linux.

现在,如果我键入fdisk -l,我得到:

root@ns354729:/mnt/sdb2# fdisk -l

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 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 identifier: 0xbb5259be

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        4096  1495042047   747518976   83  Linux
/dev/sda2      1495042048  1496088575      523264   82  Linux swap / Solaris

Disk /dev/sdb: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 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 identifier: 0x00025c91

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            4096    20975616    10485760+  fd  Linux raid autodetect
/dev/sdb2        20975617  1464092672   721558528   fd  Linux raid autodetect
/dev/sdb3      1464092673  1465144064      525696   82  Linux swap / Solaris

我想访问第二个硬盘(sdb),所以我尝试像这样挂载sdb2:

mount /dev/sdb2 /mnt

这说:

root@ns354729:/mnt/sdb2# mount /dev/sdb2 /mnt
mount: block device /dev/sdb2 is write-protected, mounting read-only
mount: you must specify the filesystem type

所以我试着给:

mount -t ext4 /dev/sdb2 /mnt

我得到了:

mount: wrong fs type, bad option, bad superblock on /dev/sdb2,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

这说:

root@ns354729:/mnt/sdb2# dmesg | tail
ufs_read_super: bad magic number
VFS: Can't find a romfs filesystem on dev sdb2.
UDF-fs: warning (device sdb2): udf_load_vrs: No VRS found
UDF-fs: warning (device sdb2): udf_fill_super: No partition found (2)
XFS (sdb2): Invalid superblock magic number
(mount,18813,1):ocfs2_fill_super:1038 ERROR: superblock probe failed!
(mount,18813,1):ocfs2_fill_super:1229 ERROR: status = -22
GFS2: not a GFS2 filesystem
GFS2: gfs2 mount does not exist
EXT4-fs (sdb2): VFS: Can't find ext4 filesystem

任何帮助?

解决方法:

您需要使用以下内容组装(降级)RAID阵列:

mdadm --assemble --readonly /dev/md0 /dev/sdb2

当然,如果已经使用了md0,请选择一个数字.然后你可以挂载/ dev / md0(或者,如果它实际上是LVM等,继续下行).

在RAID1的情况下,您也可以使用环回设备&一个偏移量,但这更令人痛苦,而且如果mdadm元数据被破坏,真的值得尝试.

标签:linux,raid,mdadm,hard-disk
来源: https://codeday.me/bug/20190812/1644842.html