3

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
jogiboy
  • 41
  • 1
  • 2
  • 2
    Why would you weaken your system by doing this? – Chopper3 Jun 05 '18 at 15:04
  • 1
    Presumably you wanted the RAID mirroring, but didn't need the triple replicated RAID-1? One possibility is to drop it back to a three disk RAID-1E (10), but there's no way to do the migration live. You could attempt to follow the procedure here https://serverfault.com/questions/43677/best-way-to-grow-linux-software-raid-1-to-raid-10 , but it's risky. However, having 77GB in `/var` is unusual. You might try using `du` in there to figure out where the space is going. – Mike Andrews Jun 06 '18 at 03:49

2 Answers2

3

As far as I know that does not look possible. I'd suggest you to backup all data, then rebuild the RAID to the stripe RAID.

However, you can try to backup the data before growing RAID from 1 to 0 using this command:

mdadm /dev/md2 --grow --level=0

OR

Remove mirror, extend to raid 0 and resize fs.

In any case DO the backup before for your data safety.

Strepsils
  • 4,817
  • 9
  • 14
1

Building on Strepsils's clues, for a RAID1 md volume named /dev/md2, and two partitions named /dev/nvme0n1p2 and /dev/nvme1n1p2:

  1. Remove the mirror: sudo mdadm /dev/md2 --fail /dev/nvme1n1p2, then sudo mdadm /dev/md2 --remove /dev/nvme1n1p2 (from https://www.thegeekdiary.com/centos-rhel-how-to-remove-a-mirror-with-mdadm/)

  2. Extend to raid0: sudo mdadm /dev/md2 --grow --level=0

  3. Add 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)

  4. Wait for reshape to finish (watch /proc/mdstat) (~90 minutes for an md volume that began life as a 1TB raid1 on 2 fast SSDs)

  5. /dev/md2 will automatically become raid0 after reshape is finished.

  6. Grow file system: sudo resize2fs /dev/md2

nmr
  • 111
  • 2