Monday, August 10, 2020

Howto: Add disk to Linux RAID

How to add disk to linux RAID on Sabayon 5


**This is a legacy article which does not meet some of our quality standards. While it may contain useful information, is retained here for legacy reasons only.**

(Of course the same basic commands apply across any linux system running mdadm).

Forgive the lack of formatting with this, but I figure I’ll post it before it gets lost and format it later 🙂

After the hardware is installed do the following:

fdisk /dev/yourdisk

press n for new partition

Accept defaults for largest size disk if that’s what you want to do (most likely)

Press ? To change the partition type to Raid Autodetect

press w to exit fdisk

Ensure your existing array is built and running

# mdadm –assemble /dev/md0 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1

# mount /dev/md0 /mnt/data1

# mdadm /dev/yourexisting array –add /dev/yournewdisk

mdadm: added /dev/sdf1

# mdadm –detail /dev/md0

You should see a list similar to this showing your new drive currently added as a hot spare

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

3 8 65 3 active sync /dev/sde1

4 8 81 – spare /dev/sdf1

Now you’re ready to roll….. 🙂

# mdadm –grow –raid-devices=5 /dev/md0

Donald Scripts # mdadm –grow –raid-devices=5 /dev/md0

mdadm: Need to backup 768K of critical section..

mdadm: … critical section passed.

Every 2.0s: cat /proc/mdstat Wed Sep 16 18:18:20 2009

Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]

md0 : active raid5 sdf1[4] sdb1[0] sde1[3] sdd1[2] sdc1[1]

2930279808 blocks super 0.91 level 5, 64k chunk, algorithm 2 [5/5] [UUUUU]

[>………………..] reshape = 0.1% (1176912/976759936) finish=816.4min speed=19915K/sec

unused devices: <none>

Check the filesystem e2fsck!

Donald Scripts # e2fsck -pv /dev/md0

/dev/md0: clean, 87382/183148544 files, 634355575/732569952 blocks (check in 5 mounts)

Donald Scripts # resize2fs -p /dev/md0

resize2fs 1.41.9 (22-Aug-2009)

Resizing the filesystem on /dev/md0 to 976759936 (4k) blocks.

Begin pass 1 (max = 7452)


The filesystem on /dev/md0 is now 976759936 blocks long.

Popular Articles

Raspberry Pi 3

Raspberry Pi Disk Images – Definitive List

This page attempts to list all the Raspberry Pi disk images known to currently exist from around the web, providing direct links to download...
Raspberry Pi Audio Hardware

Raspberry Pi audio HAT’s (Hardware Attached on Top) – Definitive List

Summary Back in July 2014, Raspberry Pi announced the then new, Raspberry Pi 2 followed soon after by the announcement of HaTs (Hardware Attached on...
How to set Plex permissions on Linux / NAS devices

How to set Plex permissions on linux or NAS devices

Problem / Outcome Summary This how to guide will show you how to properly set up Linux file permissions for Plex Media Server Please...
How to set up Plex on Raspberry Pi 2 or Raspberry Pi 3

How to Install Official Plex Media Player on Raspberry Pi 2 / Pi 3

Problem / Outcome Summary This ‘How To’ article will show you step by step how to set up and install the official Plex Media...
Plex Media Server

How to install Plex Media Server on Ubuntu Server Headless

This howto will enable you to install the Plex Media Server on Ubuntu Server For how to install Plex Media Server on another...

Related Stories


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Stay on op - Ge the daily news in your inbox