从 Ubuntu 16.04 升级到 20.04 后重新连接 raid 10 驱动器 md0

从 Ubuntu 16.04 升级到 20.04 后重新连接 raid 10 驱动器 md0

我刚刚从Ubuntu 16.0420.04。我的电脑里有 4 个 1TB HHD突袭 10数组。它们是sda、sdb、sdc 和 sdd = md0 这个被袭击的驱动器包含我的主目录,在我的情况下是 /home/joe/,我在 fstab 中有一行:

UUID=f7790191-84f3-4d9b-81b8-43de132244a2 /home           ext4    defaults        0       0

Linux Ubuntu 安装在固态硬盘上,dev/nvme0n1

这是 16.04 下 blkid 的输出:

/dev/nvme0n1p1: UUID="1c7b2d4e-d543-4e71-8b05-569a0993e339" TYPE="ext4" PARTUUID="3acfb4f5-01"
/dev/nvme0n1p5: UUID="2403be72-9dca-43b6-a596-044cfd813801" TYPE="swap" PARTUUID="3acfb4f5-05"
/dev/sda: UUID="43468a60-e0d2-6202-4e0c-320120beeee1" UUID_SUB="a49f1c1a-3450-39bc-8efb-67da1ebeacdf" LABEL="joeslinux:0" TYPE="linux_raid_member"
/dev/sdb: UUID="43468a60-e0d2-6202-4e0c-320120beeee1" UUID_SUB="11eb3ea8-74da-18c2-cd0a-bb2454c0cb46" LABEL="joeslinux:0" TYPE="linux_raid_member"
/dev/sdc: UUID="43468a60-e0d2-6202-4e0c-320120beeee1" UUID_SUB="e5b7cd63-974c-b4ed-8061-fc1c405abb08" LABEL="joeslinux:0" TYPE="linux_raid_member"
/dev/sdd1: UUID="82374f03-c484-4420-8693-6ed0a7704b4e" TYPE="ext4" PARTUUID="049ace7e-01"
/dev/sde: UUID="74D8-8B03" TYPE="vfat"
/dev/nvme0n1: PTUUID="3acfb4f5" PTTYPE="dos"

然后我从 Ubuntu 16.04 升级到了 20.04。升级在中途终止,因为需要删除一些与 Python 3 基本软件包有关的东西。但是,我的电脑无法运行,所以我在那个 SSD nvme01n 上全新安装了 20.04。在这样做的同时,我物理断开了 4 个硬盘驱动器(sda 到 sdd)的连接。我这样做是因为安装程序暗示它想使用我的 sda 作为安装设备,我不能冒险让这种情况发生。

现在我已成功干净地安装了 20.04。我假设我的主目录中的所有工作都完好无损。但是我现在无法访问它。我没有拿回我的 md0 驱动器。

这是我的新 fdisk -l:

Disk /dev/nvme0n1: 238.49 GiB, 256060514304 bytes, 500118192 sectors
Disk model: SAMSUNG MZVPW256HEGL-000H1
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: gpt
Disk identifier: 233AD7D4-8BEC-407D-8096-A2C7BEA37CB7

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
/dev/nvme0n1p2 1050624 500117503 499066880 238G Linux filesystem

Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: HGST HTS721010A9
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: dos
Disk identifier: 0x000680a0

Disk /dev/sdb: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: HGST HTS721010A9
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: dos
Disk identifier: 0xd92e9edf

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdb1        2048 1953525167 1953523120 931.5G 83 Linux

Disk /dev/sdc: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000DM010-2EP1
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: dos
Disk identifier: 0x76221e63

Disk /dev/sdd: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000DM010-2EP1
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: dos
Disk identifier: 0xee260f95

Disk /dev/sdf: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: PSZ-HB
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: dos
Disk identifier: 0x049ace7e

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdf1        2048 3907029167 3907027120  1.8T 83 Linux

(上面省略了循环 0 至 9。)

我知道 sda sdb sdc 和 sdd 的大小正确。我还看到一个新的 sdf,大小与 md0 应有的大小相同,均为 1.84TiB。这与实际情况相符,所以我知道一切都在那里。

目前我的 blkid 只显示一行:

/dev/nvme0n1p2: UUID="ebb08f84-7501-4461-a5c4-c69c3c25d9b0" TYPE="ext4" PARTUUID="3ba58f92-47c7-423a-aad0-459ffe32cae1"

这只是装有操作系统的 SSD。可疑的是,UUID 和 PARTUUID 都与旧 16.04 上的不同。这让我担心被突袭的 md0 的 UUID 也发生了变化。

无论如何,我需要关于如何重建的建议突袭md0并重新指向我的主文件夹。我不敢激活该行

UUID=f7790191-84f3-4d9b-81b8-43de132244a2 /home           ext4    defaults        0       0

在新的 fstab 中并重新启动。

如果我不清楚自己在做什么,我是不敢摆弄 mdadm 的。

提前感谢您的任何帮助或建议,

答案1

我刚刚运行了 mdadm,如下所示。

mdadm --assemble /dev/md0 /dev/sda /dev/sdb /dev/sdc /dev/sdd

只需几秒钟。而且第一次就成功了。

为了保持磁盘挂载,我将其添加到 /etc/fstab

UUID=<my uuid for the new md0> /home           ext4    defaults        0       0

相关内容