User Tools

Site Tools


grow_md_raid1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
grow_md_raid1 [2023/09/29 17:56] – created stevegrow_md_raid1 [2024/01/04 14:04] (current) steve
Line 6: Line 6:
       * <wrap hi>parted --script /dev/sdc "mklabel gpt"</wrap>       * <wrap hi>parted --script /dev/sdc "mklabel gpt"</wrap>
       * <wrap hi>parted --script /dev/sdc "mkpart primary 0% 100%"</wrap>       * <wrap hi>parted --script /dev/sdc "mkpart primary 0% 100%"</wrap>
-      * <wrap hi>parted --script /dev/sdc "set 1 raid on" # Repeat for /dev/sdd</wrap> +      * <wrap hi>parted --script /dev/sdc "set 1 raid on" </wrap> 
-  * Added them both to the RAID1: +      * # Repeat for /dev/sdd 
 +  * Add them both to the RAID1: 
       * <wrap hi>mdadm /dev/md0 --add /dev/sdc1 /dev/sdd1</wrap>       * <wrap hi>mdadm /dev/md0 --add /dev/sdc1 /dev/sdd1</wrap>
   * Fail one of the old drives:    * Fail one of the old drives: 
       * <wrap hi>mdadm /dev/md0 -f /dev/sda1</wrap>       * <wrap hi>mdadm /dev/md0 -f /dev/sda1</wrap>
   * Wait for sync to finish:    * Wait for sync to finish: 
-      * <wrap hi>watch cat /proc/mdstat</wrap>+      * <wrap hi>watch -n 60 cat /proc/mdstat</wrap>
   * Fail the other old drive:    * Fail the other old drive: 
       * <wrap hi>mdadm /dev/md0 -f /dev/sdb1</wrap>       * <wrap hi>mdadm /dev/md0 -f /dev/sdb1</wrap>
   * Wait for sync to finish:    * Wait for sync to finish: 
-      * <wrap hi>watch cat /proc/mdstat</wrap>+      * <wrap hi>watch -n 60 cat /proc/mdstat</wrap>
   * Remove the old drives from the array:    * Remove the old drives from the array: 
       * <wrap hi>mdadm /dev/md0 -r /dev/sda1 /dev/sdb1</wrap>       * <wrap hi>mdadm /dev/md0 -r /dev/sda1 /dev/sdb1</wrap>
Line 22: Line 23:
       * <wrap hi>mdadm --grow /dev/md0 --size max</wrap>       * <wrap hi>mdadm --grow /dev/md0 --size max</wrap>
   * Grow the filesystem:    * Grow the filesystem: 
-      * <wrap hi>resize2fs /dev/md0  # Or xfs_growfs, resize2fs, etc...</wrap>+      * <wrap hi>resize2fs /dev/md0</wrap> 
 +      * # Or xfs_growfs, resize2fs, etc...
 ..and now I have a 14TB RAID1 instead of the initial 4TB. ..and now I have a 14TB RAID1 instead of the initial 4TB.
 +
 +Originally from; [[https://unix.stackexchange.com/questions/665389/mdadm-adding-a-new-hard-disk-to-an-existing-raid1|StackExchange]]
grow_md_raid1.1696010217.txt.gz · Last modified: by steve