添加 raid1 HD 后只读文件系统

添加 raid1 HD 后只读文件系统

我在 ubuntu 18.04 服务器上有一个 1TB 硬盘,想在 raid1 中添加 2 个 6TB 硬盘。现在我的文件系统在 1TB HD 上是只读的,其他两个驱动器不再显示,并且大多数程序无法运行(vim、scp 等)。如何从零开始使用 raid 驱动器(重新格式化它们)但修复我现有的驱动器?即使尝试 cd + tab 也会显示错误:

bash: cannot create temp file for here-document: Read-only file system

我是如何来到这里的:

我尝试按照本教程将两个硬盘配置为 raid1:

https://www.linuxbabe.com/linux-server/linux-software-raid-1-setup

但是,我使用的是 ubuntu 服务器 18.04,因此 Linux RAID 自动检测 (fd) 不是一个选项。我为 Linux RAID 选择了 29。

我设置了 raid,并且 sudo fsdisk -l 的输出看起来像教程一样很好,直到我尝试在 /mnt/raid1 中创建目录。由于权限原因,它不允许我使用,也不允许我 chown /mnt/raid1。

跑步sudo fsdisk -l

在其中一个新驱动器上显示以下消息:

The backup GPT table is corrupt, but the primary appears OK, so that will be used.

sudo fsdisk -l 输出与当时这篇文章相同https://ubuntuforums.org/showthread.php?t=2361339, 所以我做了:

sudo umount /dev/md0
sudo mdadm --stop /dev/md0
mdadm --assemble --scan

然后我无法再看到或访问 /dev/sdb1 /dev/sdc1 并且 md0 的重组失败。

shutdown -r打开服务器,看看它是否允许我查看驱动器,但现在它重新启动,没有任何作用,我什至无法再次关闭它:

$ sudo shutdown now
Failed to open /dev/initctl: No such device or address
Failed to talk to init daemon.

sudo fdisk -l 输出现在显示我的原始硬盘驱动器的所有分区,并且不显示两个新驱动器。它曾经不显示所有这些分区:

$ sudo fdisk -l
Disk /dev/loop0: 212.1 MiB, 222388224 bytes, 434352 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/loop1: 3.1 MiB, 3248128 bytes, 6344 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/loop2: 88.7 MiB, 92983296 bytes, 181608 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/loop3: 89 MiB, 93327360 bytes, 182280 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/loop4: 217.8 MiB, 228388864 bytes, 446072 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/loop5: 3.1 MiB, 3252224 bytes, 6352 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/loop6: 11.7 MiB, 12242944 bytes, 23912 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/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 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
Disklabel type: gpt
Disk identifier: AF308587-0A23-464F-9CF7-1C3D17ADA860


Device       Start        End    Sectors   Size Type
/dev/sda1     2048       4095       2048     1M BIOS boot
/dev/sda2     4096    2101247    2097152     1G Linux filesystem
/dev/sda3  2101248 1953521663 1951420416 930.5G Linux filesystem




Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 337 GiB, 361842606080 bytes, 706723840 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/ubuntu--vg-lv--ml: 434.8 GiB, 466876366848 bytes, 911867904 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

相关内容