2

I have three 3 TB drives that I am attempting to put together into a RAID 5 setup with mdadm, but I am running into some issues. (Actually, I have four 3 TB drives I will be using, but one of them currently has data on it, so I need to back that data up first. Thus I have been playing with three of the drives to figure out how to get everything working, then I will backup the data and rebuild with all four drives)

First, I did the initial configuration following the instructions outlined here: https://raid.wiki.kernel.org/index.php/RAID_setup

I ended up with:

root@VMHost:/home/lex# mdadm --detail /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Mon Nov 10 22:41:00 2014
     Raid Level : raid5
     Array Size : 5860270080 (5588.79 GiB 6000.92 GB)
  Used Dev Size : 2930135040 (2794.39 GiB 3000.46 GB)
   Raid Devices : 3
  Total Devices : 3
    Persistence : Superblock is persistent

    Update Time : Tue Nov 11 05:14:13 2014
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 512K

           Name : VMHost:0  (local to host VMHost)
           UUID : d058bef5:ae3c96bd:a3a7d216:cb6aca06
         Events : 81

    Number   Major   Minor   RaidDevice State
       0       8        0        0      active sync   /dev/sda
       1       8       16        1      active sync   /dev/sdb
       3       8       64        2      active sync   /dev/sde

I then tried to create a filesystem on it using the command

root@VMHost:/home/lex# mkfs.ext3 -v -m .1 -b 4096 -E stride=128,stripe-width=256 /dev/md0
mke2fs 1.42.9 (4-Feb-2014)
fs_types for mke2fs.conf resolution: 'ext3', 'big'
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=128 blocks, Stripe width=256 blocks
183136256 inodes, 1465067520 blocks
1465067 blocks (0.10%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
44711 block groups
32768 blocks per group, 32768 fragments per group
4096 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848, 512000000, 550731776, 644972544

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

However, when I attempted to mount it, I received:

root@VMHost:/home/lex# mount /dev/md0 /mnt/md0/
NTFS signature is missing.
Failed to mount '/dev/md0': Invalid argument
The device '/dev/md0' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

Furthermore, specifying the type as ext3:

root@VMHost:/home/lex# mount -t ext3 /dev/md0 /mnt/md0
mount: wrong fs type, bad option, bad superblock on /dev/md0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

So, I thought that maybe I need to create partitions on the drives beforehand, then use the partitions as the RAID setup (instead of the full drive), so I disassembled the RAID and began to create partitions on the drive, however it doesn't seem to recognized a gpt drive when I create one

root@VMHost:/home/lex# parted /dev/sda
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: /dev/sda: unrecognised disk label
(parted) mklabel gpt
(parted) print
Error: /dev/sda: unrecognised disk label
(parted) quit
Information: You may need to update /etc/fstab.

For this setup with gpt, I was attempting to follow along with some other instructions I found https://plone.lucidsolutions.co.nz/linux/io/using-parted-to-create-a-raid-primary-partition which uses msdos as the disk label, but since these are 3 TB disks, I believe I need to use something other than msdos, which supports larger disks, thus I was trying gpt.

Do you know why parted isn't recognizing the disk label, even after it sets it to gpt itself? Is there a better approach to creating the RAID device than what I was doing?

EDIT: Checking dmesg after executing the mount -t command (these results are actually for when I attempted to format to ext4, which was something I tried before ext3) results in:

root@VMHost:/home/lex# dmesg | tail
[611756.731067] EXT4-fs (md0): VFS: Can't find ext4 filesystem
[611756.731488] EXT4-fs (md0): VFS: Can't find ext4 filesystem
[611756.731790] EXT4-fs (md0): VFS: Can't find ext4 filesystem
[611756.732391] FAT-fs (md0): bogus logical sector size 65535
[611756.732421] FAT-fs (md0): Can't find a valid FAT filesystem
[611756.733932] XFS (md0): bad magic number
[611756.733974] XFS (md0): SB validate failed with error 22.
[611756.735611] FAT-fs (md0): bogus logical sector size 65535
[611756.735621] FAT-fs (md0): Can't find a valid FAT filesystem
[611773.636148] EXT4-fs (md0): VFS: Can't find ext4 filesystem

EDIT: I am sure the system supports GPT as one drive is already mounted with GPT

root@VMHost:/u01# parted --list
Error: /dev/sda: unrecognised disk label

Error: /dev/sdb: unrecognised disk label

Model: ATA ST1000DM003-1CH1 (scsi)
Disk /dev/sdc: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      1049kB  256MB   255MB   primary   ext2         boot
 2      257MB   1000GB  1000GB  extended
 5      257MB   1000GB  1000GB  logical                lvm


Model: ATA ST3000DM001-1CH1 (scsi)
Disk /dev/sdd: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name                  Flags
 1      1049kB  3001GB  3001GB  ntfs         Basic data partition  msftdata


Model: ATA ST3000DM001-1CH1 (scsi)
Disk /dev/sde: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  3001GB  3001GB               primary
2
  • And what's in dmesg after trying to mount with -t ext3? Also, check that your kernel supports GPT as well as ext3. Partitioning is not required, but recommended. – frostschutz Nov 11 '14 at 22:44
  • As I have disassembled the RAID, I can't directly get the dmesg results for the ext3 results, but I do have it for when I tried to format with ext4 before trying ext3. I have updated to include those results. – Alex Nov 11 '14 at 23:13
2

It might be that parted is confused by the previous information on the disc, so you could wipe the first few sectors of each drive first:

dd if=/dev/zero of=/dev/sda bs=1k count=1

after that the following should work:

parted /dev/sda
unit TB
mklabel gpt
mkpart primary 0 4
print
quit

If you are planning to add the fourth drive afterwards, you should consider creating the raid-5 in degraded mode:

mdadm --create --name=DATA00 --level=5 --auto=part --verbose /dev/md0 \
--raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 missing

then adding the drive later on will not require much extra action:

mdadm --add /dev/sdd1

If you don't create in degraded mode you'll need to grow the raid:

mdadm --grow --raid-devices=4 --backup-file=/root/grow_md0.bak /dev/md0

(this assumes previously created non-degraded with --raid-devices=3)

I have LVM on top of my raid, with that it was easy to extent when I grew from 4 to 5 discs, although that should be possible without as well.

I have been using mdadm for over 10 years now, always on partitions. My array actually consists of 3 3TB drives and 2 4TB drives (I am replacing the 3TB drives as they break). The 3TB drives are completely one partition, the 4TB drives have a 3TB compatible partition and the rest is currently not in use, but the 4TB drives are partitioned so they could be used for booting (there is an extra, small, drive in the system that I use for booting, but I might want to get rid of that in order to open up a SATA slot to grow the raid some more.

1
  • Thank you for the answer, the second part about growing the RAID will be useful later when I actually get it working. For the first part, I am still running into issues. I've done some more in-depth research and have posted a new question (because the issue appears to actually be separate from what I initially asked about) unix.stackexchange.com/questions/167450/… – Alex Nov 12 '14 at 1:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.