0

I'm trying to create (two) software RAID1 arrays on two identical 4TB non-boot drives. I'm following advice from several forum posts but keep running into trouble. Here's what I've done so far:

  • for each brand-new drive (/dev/sdb and /dev/sdc):

    • sudo fdisk <drive>

    • "o" to create a new partition table (I think this is necessary?)

    • "n" to create new partition

    • "p" and "1" to create primary partition #1

    • "2048" (default) partition start

    • "+3500M" partition end at 3.5GB.

    • Repeat with "p", "2", , "+500M" to create a smaller 500MB partition

    • This creates /dev/sdb1, /dev/sdb2, /dev/sdc1, /dev/sdc2

  • Create raid arrays: sudo mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1

    • Repeat with /dev/md0, /dev/sdb2, /dev/sdc2
  • Create file system: sudo mkfs -t ext4 /dev/md0

Creating the file system results in no errors, but if I run sudo fdisk -l /dev/md0 I get:

Disk /dev/md0: 3667 MB, 3667853312 bytes
2 heads, 4 sectors/track, 895472 cylinders, total 7163776 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md0 doesn't contain a valid partition table

I can't seem to fix the "doesn't contain a valid partition table" thing. Is this a problem or is it supposed to be this way?

Bonus question: assuming I get these two arrays working, what is the "standard" place to mount them? Root?

JaredL
  • 101

1 Answers1

0

Since you did not create a partition table, and only a partition, yes, it is supposed to be this way.

Example:

$ dd if=/dev/zero of=/tmp/file bs=4096 count=$((1024*1024 / 4096))
$ mkfs -t ext4 /tmp/file
mke2fs 1.42.9 (4-Feb-2014)
/tmp/file is not a block special device.
Proceed anyway? (y,n) y
$ fdisk -l !$
fdisk -l /tmp/file

Disk /tmp/file: 1 MB, 1048576 bytes 255 heads, 63 sectors/track, 0 cylinders, total 2048 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000

Disk /tmp/file doesn't contain a valid partition table

To make a partition table, you use something like:

parted /dev/md0 mklabel msdos

With fdisk:

$ fdisk /tmp/file
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xb1f4c1d2.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) You must set cylinders. You can do this from the extra functions menu.

Command (m for help): w

Simply opening it with fdisk makes it create a partition table. Use w to save it. You'll need to create a new partition within it.

You probably don't need it if the entire device is going to one partition.

muru
  • 207,228