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
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