Posted onIntutorialViews: Word count in article: 2.2kReading time ≈2 mins.
In last post, we talked about how to install Ubuntu Desktop 22.04 LTS with software raid 1. After installation, I still have 2 8TB SSD disk which need to make a soft raid 1. So I record the procedure and share with you.
Environment
Ubuntu Server 22.04
Two 8 TB SSD: /dev/nvme2n1, /dev/nvme3n1
How to create and mount soft raid on Linux
1 2 3 4 5 6 7
# zero out the partition table on the specified disk sudo sgdisk -Z /dev/nvme2n1 sudo sgdisk -Z /dev/nvme3n1 # install soft raid software sudo apt install mdadm # before start, we need to modify some environment variables or the process speed will be very slow due to history cause(In the very very beginning, the hardware is very slow, so the default value is very small) sudo vim /etc/sysctl.conf
1 2
dev.raid.speed_limit_min = 100000 dev.raid.speed_limit_max = 8000000 #default is 200000
1 2 3 4 5 6 7 8 9
sudo sysctl -p # see whether changes take effect sudo mdadm --create /dev/md1 --bitmap=internal --level=1 --raid-devices=2 /dev/nvme2n1 /dev/nvme3n1 # start raid process cat /proc/mdstat # see the raid status, it takes time to finish sync sudo fdisk /dev/md1 # create a new partition table on created raid device md1, you can press m for help. sudo mkfs.ext4 /dev/md1p1 # make file system for md1 partition 1 mkdir ~/Desktop/SSD-8T # create mount target folder sudo mount /dev/md1p1 /home/username/Desktop/SSD-8T # mount it manually sudo blkid /dev/md1p1 # see the UUID of this partition sudo vim /etc/fstab # add the mount command to /etc/fstab in order to make automatical mount
Maybe you will find that when you restart your PC, the /dev/md1 becomes /dev/md127 and everything still works fine. I encountered this situation though, I ignore this as it does not matter. If you want to solve this, you can refer to: