NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
Sandshark
Apr 12, 2019Sensei - Experienced User
Reducing RAID size (removing drives) WITHOUT DATA LOSS is possible via SSH
In the following process, I explore removing a drive from an array without having to destroy and re-build the array and restore all files from backup. This information is provided by myself, just ano...
Sandshark
Apr 12, 2019Sensei - Experienced User
So, now it was time to move from 2 drives in RAID1 to one in JBOD, removing drive 2. Except it turns out that the NAS actually creates a 1-drive "RAID1" when only one drive is installed and calls it "JBOD". So, it's a very simple process:
# mdadm /dev/md127 --fail --verbose /dev/sdb3 # mdadm /dev/md127 --remove --verbose /dev/sdb3 # mdadm --grow /dev/md127 --raid-devices=1 --force --verbose
Note the --force parameter is required because a RAID of 1 drive is not a normal format. But it does much more easily lend itself to further RAID expansion, which is obviously why it's used in the ReadyNAS.
End result is that the NAS UI showed 1 drive green, in JBOD mode. Just to be sure this really was equal to a JBOD created from scratch by the NAS, I switched to FlexRAID, added a drive, and selected "Add Group" to expand the JBOD, and it worked as expected.
Then, I wanted to remove a drive from a JBOD. First to see what's in the data volume:
# btrfs filesystem show /data Label: '758b3fbc:data' uuid: 116ad59c-74ef-4e73-b888-21ddfe4b3b43 Total devices 2 FS bytes used 97.22GiB devid 1 size 926.89GiB used 100.02GiB path /dev/md127 devid 2 size 926.89GiB used 0.00B path /dev/md126 # cat /proc/mdstat Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] md126 : active raid1 sdb3[0] 971912832 blocks super 1.2 [1/1] [U] md127 : active raid1 sda3[0] 971912832 blocks super 1.2 [1/1] [U] md1 : active raid1 sda2[0] sdb2[1] 523712 blocks super 1.2 [2/2] [UU] md0 : active raid1 sda1[0] sdb1[4] 4190208 blocks super 1.2 [4/2] [UU__]
So, all RAID elements were in sync and I needed to remove md126 and check it's no longer included in /data
# btrfs device delete /dev/md126 /data # btrfs filesystem show /data Label: '758b3fbc:data' uuid: 116ad59c-74ef-4e73-b888-21ddfe4b3b43 Total devices 1 FS bytes used 97.22GiB devid 1 size 926.89GiB used 100.02GiB path /dev/md127
OK, all was well, so I powered down, removed the added drive, and powered back on. Once again, the NAS was happy as a clam with it's one-drive JBOD.
I re-enabled XRAID and re-inserted a clean second drive it started to sync. I ran into a sync problem because my sandbox drives are on their last legs. But that it accepted it and started the re-sync satisfied me all would have completed with better drives.
So, I'm convinced that each of the reduction steps left the NAS in the same condition (or close enough it doesn't matter) as creating an array of that size from the start.
Sandshark
Apr 12, 2019Sensei - Experienced User
Cast your vote for adding to the UI: https://community.netgear.com/t5/ReadyNAS-Idea-Exchange/Add-ability-to-remove-drives-from-RAID/idi-p/1736142#M1829
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!