0

I'm trying to create raid 5 from four disks:

Disk /dev/sdc: 8001.6 GB, 8001563222016 bytes
/dev/sdc1            2048  4294967294  2147482623+  fd  Linux raid autodetect
Disk /dev/sdb: 8001.6 GB, 8001563222016 bytes
/dev/sdb1            2048  4294967294  2147482623+  fd  Linux raid autodetect
Disk /dev/sdd: 24003.1 GB, 24003062267904 bytes
/dev/sdd1            2048  4294967294  2147482623+  fd  Linux raid autodetect
Disk /dev/sde: 8001.6 GB, 8001563222016 bytes
/dev/sde1            2048  4294967294  2147482623+  fd  Linux raid autodetect

But, I just got 6T space (one of my disk) after creating:

/dev/md0         ext4   6.0T  184M  5.7T   1% /mnt/raid5

Here's other information of my creating process:

Results of mdadm -E /dev/sd[b-e]1:

/dev/sdb1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 8953b4f1:61212c46:b0a63144:25eb4a7d
           Name : node7:0  (local to host node7)
  Creation Time : Fri Sep  7 09:16:42 2018
     Raid Level : raid5
   Raid Devices : 4

 Avail Dev Size : 4294703103 (2047.87 GiB 2198.89 GB)
     Array Size : 6442053120 (6143.62 GiB 6596.66 GB)
  Used Dev Size : 4294702080 (2047.87 GiB 2198.89 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
          State : clean
    Device UUID : 2fcb3346:9ed69eab:64c6f851:0bcc39c4

    Update Time : Fri Sep  7 13:17:38 2018
       Checksum : c701ff7e - correct
         Events : 18

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 0
   Array State : AAAA ('A' == active, '.' == missing)
/dev/sdc1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 8953b4f1:61212c46:b0a63144:25eb4a7d
           Name : node7:0  (local to host node7)
  Creation Time : Fri Sep  7 09:16:42 2018
     Raid Level : raid5
   Raid Devices : 4

 Avail Dev Size : 4294703103 (2047.87 GiB 2198.89 GB)
     Array Size : 6442053120 (6143.62 GiB 6596.66 GB)
  Used Dev Size : 4294702080 (2047.87 GiB 2198.89 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
          State : clean
    Device UUID : 6f13c9f0:de2d4c6f:cbac6b87:67bc483e

    Update Time : Fri Sep  7 13:17:38 2018
       Checksum : e4c675c2 - correct
         Events : 18

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 1
   Array State : AAAA ('A' == active, '.' == missing)
/dev/sdd1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 8953b4f1:61212c46:b0a63144:25eb4a7d
           Name : node7:0  (local to host node7)
  Creation Time : Fri Sep  7 09:16:42 2018
     Raid Level : raid5
   Raid Devices : 4

 Avail Dev Size : 4294703103 (2047.87 GiB 2198.89 GB)
     Array Size : 6442053120 (6143.62 GiB 6596.66 GB)
  Used Dev Size : 4294702080 (2047.87 GiB 2198.89 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
          State : clean
    Device UUID : 4dab38e6:94c5052b:06d6b6b0:34a41472

    Update Time : Fri Sep  7 13:17:38 2018
       Checksum : f306b65f - correct
         Events : 18

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 2
   Array State : AAAA ('A' == active, '.' == missing)
/dev/sde1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 8953b4f1:61212c46:b0a63144:25eb4a7d
           Name : node7:0  (local to host node7)
  Creation Time : Fri Sep  7 09:16:42 2018
     Raid Level : raid5
   Raid Devices : 4

 Avail Dev Size : 4294703103 (2047.87 GiB 2198.89 GB)
     Array Size : 6442053120 (6143.62 GiB 6596.66 GB)
  Used Dev Size : 4294702080 (2047.87 GiB 2198.89 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
          State : clean
    Device UUID : b04d152e:0448fe56:3b22a2d6:b2504d26

    Update Time : Fri Sep  7 13:17:38 2018
       Checksum : 40ffd3e7 - correct
         Events : 18

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 3
   Array State : AAAA ('A' == active, '.' == missing)

Results of mdadm --detail /dev/md0:

/dev/md0:
        Version : 1.2
  Creation Time : Fri Sep  7 09:16:42 2018
     Raid Level : raid5
     Array Size : 6442053120 (6143.62 GiB 6596.66 GB)
  Used Dev Size : 2147351040 (2047.87 GiB 2198.89 GB)
   Raid Devices : 4
  Total Devices : 4
    Persistence : Superblock is persistent

    Update Time : Fri Sep  7 13:17:38 2018
          State : clean 
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 512K

           Name : node7:0  (local to host node7)
           UUID : 8953b4f1:61212c46:b0a63144:25eb4a7d
         Events : 18

    Number   Major   Minor   RaidDevice State
       0       8       17        0      active sync   /dev/sdb1
       1       8       33        1      active sync   /dev/sdc1
       2       8       49        2      active sync   /dev/sdd1
       4       8       65        3      active sync   /dev/sde1

Results of mkfs.ext4 /dev/md0

mke2fs 1.41.9 (22-Aug-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
402628608 inodes, 1610513280 blocks
80525664 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
49149 block groups
32768 blocks per group, 32768 fragments per group
8192 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

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

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Then mkdir /mnt/raid5 and mount /dev/md0 /mnt/raid5/.

  • Please avoid mkfs.ext4 /dev/md0 on storages larger than 1TB and use mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 /dev/md0 instead. – LinuxSecurityFreak Sep 7 '18 at 10:09
1

6 TB would be (4 - 1) * 2 TB, where 4 is the number of your devices, minus one for parity, and 2 TB is the size of the partitions you seem to have.

Assuming that first output is from the fdisk utility, the fields are probably

partition name       start        end       length  type
/dev/sdc1            2048  4294967294  2147482623+  fd  Linux raid autodetect

In units of 512-byte sectors, the partition is 2 TB from start to end. (the + at the end of the length field seems to hint that the actual length is greater than , so I ignored that field.) My fdisk utility shows the size of the partition in human units too, but 2 TB is the limitation of what an old-style MBR partition table can provide, so check that you haven't used that instead of GPT.

Some older versions of fdisk might not know about GPT partition tables, so you may need to use other tools (or a get a newer version). You don't actually even need to use partitions, you can just run mdadm on /dev/sd[bcde]. But note that because of the RAID-5 layout, the smallest drive (or partition) sets the size of the array, so a single larger disk gets partly wasted.

  • @ilkkachu.The engineer combined four 8T disks to one 32 T disk (sdd shown in the information). So, do I need to let him split it? – Xin Zhang Sep 7 '18 at 11:48
  • @XinZhang, depends on what you want to do. If you want to run RAID using mdadm, you probably should let the OS see all the physical disks. On the other hand, if that 24 TB sdd is actually four 8 TB drives, then there's probably some hardware-based RAID-5 running it. In that case, you could just stick all seven drives in the same hardware RAID array, probably using RAID-6 at that point. (That is, if the controller can take more than four drives). Running RAID-5 over RAID-5 doesn't seem too useful, and in any case, there's that partition issue. – ilkkachu Sep 7 '18 at 11:55
  • Now, I delete hardware RAID-5 and use these 8T disks to create RAID-5 without partition. After ~1000 min, mdadm -C /dev/md0 -l 5 -n 7 /dev/sd[b-h] will finish. – Xin Zhang Sep 8 '18 at 2:06
1

RAID 5 is a redundancy protocol. It is an array of disks with redundant data protocols to prevent data loss, e.g. if one of the disk dies, you won't have any data loss.

However, it works at the expense of replicating the data over the extra disks, and thus not summing up the capacity storage of the sum of all of them.

If you really want to sum up the capacity of disks together without any redundancy, that is RAID 0, not RAID 5.

From geekstuff.com:

raid0 raid5

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.