0

I'm attempting to create a RAID 0 RAID array on Ubuntu server 21.10, but I keep getting the following error: mdadm: An option must be given to set the mode before a second device Here is the syntax I used:

~$ sudo mdadm –create –verbose /dev/md0 –level=0 –raid-devices=2 /dev/sdb1 /dev/sdc1
mdadm: An option must be given to set the mode before a second device
(–verbose) is listed

I've seen some websites that list the syntax as:

sudo mdadm -–create -–verbose /dev/md0 -–level=0 -–raid-devices=2 /dev/sdb1 /dev/sdc1

To which I get:

mdadm: invalid option -- '?'
Usage: mdadm --help
for help

I've tried removing the partitions and attempting the command without partitions, still no joy. I've tried the -c vs the --create option, still no fun.

Do I need to install any additional packages in order to create an array?

Dave M
  • 4,514
  • 22
  • 31
  • 30
Glenn T
  • 11
  • 1
  • 1
  • 2
  • 3
    Your commands contain some fancy utf8 characters. Some websites that focus on prettyness instead of usefulness replace `-` and `--` with fancy utf8 characters that look prettier but will not work in a command line. If you copied and pasted those lines from a website, just type them again. – Gerald Schneider Nov 24 '21 at 13:38
  • You use "en dashes" instead of hyphens (minus signs) which are needed here. – Nikita Kipriyanov Nov 25 '21 at 16:42

1 Answers1

0

I've seen some websites that list the syntax

The first place to look to find the behaviour/syntax of a command is the man pages on your local machine. That way you will be reading the documentation for the binary installed on your machine.

I don't know what version is installed on your machine, but on the one in front of me and others I have used 'create' is directive and not an option; it shouldn't be prefixed with a '-'/

symcbean
  • 21,009
  • 1
  • 31
  • 52