Error creating RAID0 in ubuntu

Hi, guys

I run this command to create raid0:
mdadm --create /dev/Temp --level=raid0 --raid-devices=2 /dev/nvme0n1 /dev/nvme1n1

This is what I get :

root@Plotter1:~# mdadm --create /dev/Temp --level=raid0 --raid-devices=2 /dev/nvme0n1 /dev/nvme1n1 mdadm: cannot open /dev/nvme0n1: Device or resource busy

Tried to reboot, still the same.

Any ideas?

You could have a filesystem mounted on it. What does:

mount | grep nvme1n1


If it’s mounted you want to unmount whatever filesystem that is.

If that’s difficult you can comment out the mount in /etc/fstab

Or debug further with lsof | grep fsname

Where fsname is the name of the filesystem

To see what files (lsof = list open files) are in use on that filesystem. Even shells sitting in the directory of a filesystem would block unmounting…

You have to unmount the drive before you can add it to an array - just fire up the disks tool and find the drive and click the ‘Stop’ button on it - then try again.

Thank you. It worked fine this time. Problem solved.