问题原文
原帖链接 · jogiboy · CC BY-SA 4.0
I bought the E3-SSD-3-32 server from the SoYouStart offer. There is a 3x120 GB SSD drive. Unfortunately, after some time, there was a lack of disk space. Is there any way to convert RAID1 to RAID0? The operating system is Debian 9.
web1@ns510077:~$ cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
md1 : active raid1 sdc1[2] sdb1[1] sda1[0]
20478912 blocks [3/3] [UUU]
md2 : active raid1 sdc2[2] sdb2[1] sda2[0]
96211904 blocks [3/3] [UUU]
unused devices: <none>
web1@ns510077:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 20G 1.6G 17G 9% /
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 16G 530M 16G 4% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/md2 91G 77G 9.3G 90% /var
社区高分解答
原帖链接 · nmr · CC BY-SA 4.0
Building on Strepsils's clues, for a RAID1 md volume named /dev/md2, and two partitions named /dev/nvme0n1p2 and /dev/nvme1n1p2:
Remove the mirror:
sudo mdadm /dev/md2 --fail /dev/nvme1n1p2, thensudo mdadm /dev/md2 --remove /dev/nvme1n1p2(from https://www.thegeekdiary.com/centos-rhel-how-to-remove-a-mirror-with-mdadm/)Extend to raid0:
sudo mdadm /dev/md2 --grow --level=0Add the second disk back:
sudo mdadm --grow /dev/md2 --level=0 --raid-devices=2 --add /dev/nvme1n1p2(Note that this will change md2 to raid4?! and automatically start reshaping. From https://serverfault.com/a/1077269/167906)Wait for reshape to finish (
watch cat /proc/mdstat) (~90 minutes for an md volume that began life as a 1TB raid1 on 2 fast SSDs)/dev/md2 will automatically become raid0 after reshape is finished.
Grow file system:
sudo resize2fs /dev/md2
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
