Is it possible to "undo" a raid1 configuration
Easiest way is to reinstall the system without RAID 1.
If that is not possible, then you need to first take backup of current system and then start into a recovery system to move partitions around.
These are high level instructions of the steps to take. Notice that /usr
and /var
directories are moved from their own partitions to /
partition. This can cause problems in the future, if /var
directory grows to fill the root partition.
After booting up the recovery system:
- Mount
/dev/md2
to/mnt
- Create
/mnt2
directory. - Mount
/dev/vg0-usr
to/mnt2
. - Move all files from
/mnt2
to/mnt/usr
. - Unmount
/dev/vg0-usr
. - Mount
/dev/vg0-var
to/mnt2
. - Move all files from
/mnt2
to/mnt/var
. - Unmount
/dev/vg0-var
. - Mount
/dev/vg0-home
to/mnt2
. - Move all files from
/mnt2
to/mnt/home
. - Unmount
/dev/vg0-home
.
Now, the /dev/md4
device and volume groups under it can be removed.
- Run
vgchange -a n vg0
to deactivate vg0 volume group. - Run
vgremove vg0
to remove the group. - Run
mdadm --stop /dev/md4
to stop RAID device - Run
mdadm --remove /dev/md4
to remove the RAID device.
Create a RAID0 array for new volume group and create logical volume for /home
:
- Run
mdadm --create /dev/md4 /dev/nvme0n1p2 /dev/nvme1n1p4 --level=0 --raid-devices=2
- Run
pvcreate /dev/md4
. - Run
vgcreate vg0 /dev/md4
. - Run
lvcreate -l 100%VG -n home vg0
- Run
mkfs.ext4 /dev/vg0-home
- Run
mount /dev/vg0-home /mnt2
to mount new home directory. - Move files from
/mnt/home
to/mnt2
.
Last step is to modify fstab
so that system doesn't try to mount non-existing logical volumes during startup. Edit /mnt/fstab
and remove lines that contain /dev/vg0-var
or /dev/vg0-usr
.
After these steps, you can reboot the machine and your /home
should be what you wanted.