Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Shrink Array question

Featured Replies

5 hours ago, gemeit said:

 

Hi I want to remove 5 disks can I run this for 5 disks at the same time or do I need to do it 1 disk at a time

 

Thanks

You can do it simultaneously but it will be excruciatingly slow.

 

Why not just remove the disks all at once and rebuild parity one time with the final complement of disks?

  • Replies 65
  • Views 16.7k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • I never used the script, it may have issues with latest unRAID, you can still do it manually:   Optional, for better speed, and if disabled, enable reconstruct write (aka turbo write): Settings ->

  • The whole point of this technique is to update parity as you go to reflect the fact that sectors on the drive to be removed have been zeroed.  That is why you can later remove the drive without affect

  • There is on the current release, but this is likely to change later to allow for ZFS file systems on partition 2.

Posted Images

  • Community Expert
17 hours ago, gemeit said:

Hi I want to remove 5 disks can I run this for 5 disks at the same time or do I need to do it 1 disk at a time

 

Thanks

It will be faster to clear one disk at a time, or much faster yet, just remove all and re-sync parity.

  • 2 months later...
On 6/25/2023 at 7:02 PM, dopeytree said:

Ok thanks and guess there is only ever the 1 partition?

 

The drive was blank zeroed already and not used so I was able to remove by doing new config.

Quick easy.

Can you add some detail on how you were able to do a new config? I also have 5 disks I'm trying to remove, all of which were zeroed and 4 of which were never used. Want to try to safely remove the 4 and zero the 5th but not sure how and unraid docs don't provide any guidance.

On 12/3/2017 at 12:48 AM, JorgeB said:

   For Unraid 6.12+ type in the CLI:

dd bs=1M if=/dev/zero of=/dev/mdXp1 status=progress

replace X with the correct disk number

 

I am currently running this script but it is speed limited by the read rate of my slowest drive which is currently about 5MB/s. At this rate it will take 19 days which is unacceptably long. 

 

Is there any way to interrupt/cancel this script from running without completing the full clear? Would that impact parity? 

  • Community Expert
9 hours ago, WobbleBobble2 said:

I am currently running this script

Which script? Do you mean the command? If yes you can interrupt with CTRL + C

  • 7 months later...
On 12/3/2017 at 1:48 AM, JorgeB said:

I never used the script, it may have issues with latest unRAID, you can still do it manually (array will be inaccessible during the clear):

 

1. If disable enable reconstruct write (aka turbo write): Settings -> Disk Settings -> Tunable (md_write_method)

2. Start array in Maintenance mode. (array will not be accessible during the clearing)

3. Identify which disk you're removing

4. For Unraid <6.12 type in the CLI:

dd bs=1M if=/dev/zero of=/dev/mdX status=progress
   For Unraid 6.12+ type in the CLI:
dd bs=1M if=/dev/zero of=/dev/mdXp1 status=progress

replace X with the correct disk number

 

5. Wait, this will take a long time, about 2 to 3 hours per TB.

6. When the command completes, Stop array, go to Tools -> New Config -> Retain current configuration: All -> Apply

7. Go back to Main page, unassign the cleared device. * with dual parity disk order has to be maintained, including empty slot(s) *

8. Click checkbox "Parity is already valid.", and start the array

 

 

7 years later, can we get the docs updated to reflect this?  The official docs still says of=/dev/mdX for 6.2 or higher, which leads to being forced to pushing the power button on the server, pulling the drive(s) you want to remove, and doing a rebuild.

 

Granted, it's "legacy" documentation, but it's all we have for info on how to shrink an array.

  • 2 months later...

Hi, i also want to manually clear a disk before removing it, but the disk is actually encrypted.
From this list i want to clear the disk2:
 

/dev/mapper/md1p1 on /mnt/disk1 type xfs (rw,noatime,nouuid,attr2,inode64,logbufs=8,logbsize=32k,noquota)
/dev/mapper/md2p1 on /mnt/disk2 type xfs (rw,noatime,nouuid,attr2,inode64,logbufs=8,logbsize=32k,noquota)
/dev/mapper/md3p1 on /mnt/disk3 type xfs (rw,noatime,nouuid,attr2,inode64,logbufs=8,logbsize=32k,noquota)
/dev/mapper/md4p1 on /mnt/disk4 type xfs (rw,noatime,nouuid,attr2,inode64,logbufs=8,logbsize=32k,noquota)
/dev/mapper/md5p1 on /mnt/disk5 type xfs (rw,noatime,nouuid,attr2,inode64,logbufs=8,logbsize=32k,noquota)
/dev/mapper/md6p1 on /mnt/disk6 type xfs (rw,noatime,nouuid,attr2,inode64,logbufs=8,logbsize=32k,noquota)
/dev/mapper/nvme1n1p1 on /mnt/cache type btrfs (rw,noatime,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/)
shfs on /mnt/user0 type fuse.shfs (rw,nosuid,nodev,noatime,user_id=0,group_id=0,default_permissions,allow_other)
shfs on /mnt/user type fuse.shfs (rw,nosuid,nodev,noatime,user_id=0,group_id=0,default_permissions,allow_other)
/dev/mapper/nvme1n1p1 on /var/lib/docker type btrfs (rw,noatime,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/)
/dev/mapper/nvme1n1p1 on /var/lib/docker/btrfs type btrfs (rw,noatime,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/)
/dev/mapper/nvme1n1p1 on /mnt/cache/system/docker/docker/btrfs type btrfs (rw,noatime,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/)

 

Is this the correct way to do it:
1. unmount disk2

2. execute this to use the decrypted/mapped device2 instead of the disk2 directly:

dd bs=1M if=/dev/zero of=/dev/mapper/md2p1 status=progress


 

  • Community Expert
8 hours ago, sw4280 said:
dd bs=1M if=/dev/zero of=/dev/mapper/md2p1 status=progress

correct

  • 4 months later...
On 4/17/2025 at 11:46 PM, sw4280 said:

Hi, i also want to manually clear a disk before removing it, but the disk is actually encrypted.

Is this the correct way to do it:
1. unmount disk2

2. execute this to use the decrypted/mapped device2 instead of the disk2 directly:

dd bs=1M if=/dev/zero of=/dev/mapper/md2p1 status=progress

Hi there, sorry I have a really silly query, but can you confirm exactly what you mean by "unmount" disk 2 in an explain like I'm five way?

I'm only familiar with that exact word as a button in Unassigned Devices so I want to be really clear and not make any assumptions that could cause problems. Essentially I'm intending to do the same as you, zero out an xfs encrypted disk to remove it from the array without breaking parity.

  • Community Expert

The fact that a disk was encrypted is irrelevant if you are clearing it - the process is identical for both encrypted and unencrypted dtives as you are writing zeroes to every sector on the dtive.

  • 1 month later...
On 4/7/2024 at 3:39 AM, JonathanM said:

You can do it simultaneously but it will be excruciatingly slow.

 

Why not just remove the disks all at once and rebuild parity one time with the final complement of disks?

Do you mean the method 1 that is mentioned in spaceinvader one's video?
https://www.youtube.com/watch?v=nV5snitWrBk

Cos I am in the same boat I want to get rid of 4 smaller capacity drive and replace them with a high capacity one.

Edited by Vach

  • 4 months later...
  • Community Expert
6 hours ago, t33j4y said:

Is the "Preserving parity" option still valid for 7.2.3 ?

Yes.

So, I did this and it worked. However, I expanded the step-by-step instructions to hopefully help others looking for this information. I guess for those who do a lot of server maintenance, things are obvious but it kind of threw me for a bit with the old user script apparently not working and the docs.unraid.net article not having a revision timestamp (so I wasn't able to verify if it was up to date)

Also, I removed the unmount part as it didn't make sense, since the disks weren't mounted after removing the file system. So, here goes:


To use the parity-preserve method

  1. Start the array in maintenance mode

    1. Click on the disk you want to remove, and then click Erase.

    2. This erases the file system from the device while maintaining parity, then stop the array.

  2. Start the array again and record array assignments

    1. Start the array in Normal mode. The disk won't mount, but the remaining disks are online.

    2. Record array assignments, especially the parity drive (take a screenshot and save it)

    3. Optionally enable 'Reconstruct Write' for faster zeroing (but only if all drives are healthy): Go to in Settings → Disk Settings (look for 'Tunable (md_write_method)' and change to 'Reconstruct Write'

  3. Zero out the disk using the dd command from a terminal window:

    1. Open a terminal window on the Unraid server

      Tip: If opening terminal from Unraid GUI, as the first thing, type 'tmux' to persist the terminal window as the dd command will abort if the terminal is closed - you can later connect to the same terminal window by typing 'tmux attach') Then enter the appropriate command:

      For Unraid 6.12 or later: dd bs=1M if=/dev/zero of=/dev/mdXp1 status=progress

      For Unraid 6.11 or earlier: dd bs=1M if=/dev/zero of=/dev/mdX status=progress

      (Replace X with the specific number of the data disk you're removing. If in doubt, use 'lsblk' command in terminal window to identify disks and number. The 'mdXp1' overview will be at the end of the command output)

  4. Once the clearing is complete, close the terminal windows and stop the array (from the Unraid GUI)

    1. Reset the array configuration, retaining all current assignments:

      Go to 'Tools' and select the 'New Config' function.

      Under 'Preserve current assignments', select 'All'

  5. Unassign the disk you want to remove

    1. Go back to 'Main' windows and unassign the disk you want to remove

      Remember to double-check all assignments - especially the parity drive (this is where the screenshot of your assignments comes in handy)

      Scroll down to the section where you can start the array

      Check the box indicating "Parity is already valid."

      Start the array to finish the removal.

  6. Finishing up

    1. If you enabled 'Reconstruct Write), remember to set it back to 'Auto'

    2. Optionally run a correcting parity check afterward to ensure parity integrity.

    3. Shut down your server, physcially remove the disk and restart the server.


Let me know if this is helpful, anything should be changed or optimized.

Edited by t33j4y

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.