Skip to content

Instantly share code, notes, and snippets.

@jimeh
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimeh/4e5cfe288f7339b2663f to your computer and use it in GitHub Desktop.
Save jimeh/4e5cfe288f7339b2663f to your computer and use it in GitHub Desktop.
Personal notes from last time I added a disk to my RAID, so I've one got compact place to find all steps next time.
  1. Prepare disk with gparted:
  2. Terminal: - sudo DISPLAY=:5 gparted
  3. Device > Create Partition Table: - Partition table type: gpt
  4. Partition > New: - Create as: Primary Partition - File system: ext4
  5. Edit > Apply All Operations
  6. Partition > Manage flags: - Enable: raid
  7. Prepare RAID device:
  8. Disable write-intent bitmap: - sudo mdadm --grow --bitmap=none /dev/md0
  9. Grow the RAID device:
  10. Add new disk to RAID: - sudo mdadm --add /dev/md0 /dev/sdh1
  11. Grow RAID to new number of device with dated backup file: - sudo mdadm --grow --raid-devices=7 --backup-file=/grow_md0-2014-11-21.bak /dev/md0
  12. Wait, a potentially really long time (1-5 days).
  13. Grow the filesystem on RAID device:
  14. Stop all services using the mounted RAID device: - Everything in Monit. - sudo service docker stop - sudo service dropbox stop
  15. Unmount the RAID device: - sudo umount /mnt/raid
  16. Check filesystem before resize: - sudo e2fsck -f /dev/md0
  17. Resize the filesystem: - sudo resize2fs -p /dev/md0
  18. Re-mount the RAID device: - sudo mount /dev/md0 /mnt/raid
  19. Start all services again: - Everything in Monit. - sudo service docker start - sudo service dropbox start
  20. Finish off and cleanup:
  21. Re-enable write-intent bitmap: - sudo mdadm --grow --bitmap=internal /dev/md0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment