Reply

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)

joel80
Tutor

how to remove a hard disk clean from a raid (RN 314, using SSH)

Hey there,

 

i would like to remove a specific hard drive from the volume cleanly.

First, is my plan very risky, even possible at all in this way?

 

Afaik i would first use:

 

 

btrfs device delete <device> /data

And then start a rebalancing.

 

My problem is: which device should i remove? i got the serial and some technical data of the harddrive, i want to remove.

 

 

i checked the raid:

 

 

root@NAS:/dev# btrfs filesystem show


Label: '7c6e9fa0:root'  uuid: 4e2825bc-f7ec-4c5d-8ffa-9bf9b1f6af0X
        Total devices 1 FS bytes used 294.55MiB
        devid    1 size 4.00GiB used 1.63GiB path /dev/md0

Label: '7c6e9fa0:data'  uuid: 1698d7f7-05b1-47c6-b9ac-47ae7d32af4X
        Total devices 1 FS bytes used 3.29TiB
        devid    1 size 5.44TiB used 3.31TiB path /dev/md127

 

So, how can i identify the right dev to remove, using the serial of the hard drive?

To remove the hard drive instantly, delete the missing drive and rebuild the raid is very risky i think 😉

 

Thank you for any hints.

 

Message 1 of 16
StephenB
Guru

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)

What is the larger goal?

 

-replace a disk

-create a smaller RAID array

-???

 

 

Message 2 of 16
joel80
Tutor

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)

I want to find out the cause of my sporadic freezes while accessing smb shares.

 

It might be a single hard drive, which i installed some months ago - i suppose the freezes occures after installing this drive.

 

So i want to remove this drive, to see if its working fine then.

Message 3 of 16
StephenB
Guru

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)

 

Have you checked the SMART stats?  Normally you'd power down the NAS and test that particular drive with the vendor diags.

 

You could potentially remove it (with the NAS running) and you'd still have all your data - but no RAID redundancy.  Then hot-insert the drive after the balance test - which would rebuild the array.  No need for SSH.

 

Another option is just buy a replacement disk, and replace the one you don't trust.

 

Do you have backups of the data?  There's always some risk when you fiddle with the disks.

Message 4 of 16
joel80
Tutor

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)

Hi, i just removed a suspicious hard drive - bam - there it is. This hdd WAS the cause for these random freezings. I will exchange her asap.

The volume status is now degraded. Can i tell the volumen to remove the removed drive permanently cleanly?

 I don't need the extra space currently.

 

i have backups here, yes.

Message 5 of 16
StephenB
Guru

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)


@joel80 wrote:

The volume status is now degraded. Can i tell the volumen to remove the removed drive permanently cleanly?


Unfortunately you can't.  

 

You either need to

(a) replace the drive,

(b) or destroy the volume, recreate it, and restore data from backup. 

 

If you go with (b) uninstall your apps first, and reinstall them when you are done.  The apps data is saved on the data volume, so it will get lost when you destroy it.

Message 6 of 16
joel80
Tutor

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)

Are you sure?

 

What is about

btrfs device delete missing /data

?

 

This should remove the missing device?

 

Message 7 of 16
StephenB
Guru

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)

You need to be very careful on what you google here.

 

btrfs has some built-in raid-like features that OS6 doesn't use.  OS6 builds the RAID array using mdadm, and then creates btrfs on top of that.  The ReadyNAS software also needs to stay in sync with the current raid configuration (and I think the info is also kept in its SQL database).

 

There might be a way to do all the needed steps manually, but Netgear certainly hasn't documented it, and sorting it out on your own would be very high risk.

Message 8 of 16
joel80
Tutor

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)

thank you. I didn't know thew that. Thats the reason why iam asking here, before doing anything 😉

Message 9 of 16
StephenB
Guru

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)

A couple of folks have asked for the ability to shrink an array.  It'd be a lot of work for Netgear, but there are times when it would be useful.

Message 10 of 16
Equinox1
Guide

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)

I agree; shrinking an array is very useful at times, especially when you have a fully populated NAS.

 

@StephenB, I'm not sure this would that much work, as the underlying components/layers start to have meaningful support for this scenario. However, I wouldn't want to be in your testing team. Nevertheless, it would be a diferenciating feature in the current NAS market.

You could come up with a possible path, and always launch it in the "use it at your own risk" spirit we have seen many times coming from Netgear (I'm a legacy user running OS6, I know the drill 🙂 ).

 

 

 

Message 11 of 16
StephenB
Guru

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)


@Equinox1 wrote:

...However, I wouldn't want to be in your testing team. Nevertheless, it would be a diferenciating feature in the current NAS market.

 


I don't work for Netgear,  but I wouldn't want to be on the testing team either.  There is one common case, where it is simple.  That's when new users insert their second disk, and are shocked that they don't get more space.  Downgrading RAID-1 back to jbod would allow an easy recovery.

 

This request is already posted on the ideas exchange, if you are interested in it you could vote for it: https://community.netgear.com/t5/Idea-Exchange-for-ReadyNAS/Switching-disc-configuration-to-user-FEW...

 

It's worth looking at all of those ideas, and voting for all the ones you think you'd use.

Message 12 of 16
IcyK
Tutor

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)

I have succesfully 'downgraded' a RAID 6 volume on OS 6.3.5 to RAID 5, once (in order to use one of the disks in another system).

As far as my very limited knowledge goes, hou have to disable xraid first (at least I did). When the RAID 6 volume is in flexraid mode, I could change stuff via the command line as long as the volume size didn't change. (mdadm RAID 6 to mdadm RAID 5 keeps the same BTRFS volume size).

After being done, change back to xraid and a new disk will expand the volume (confirmed).

 

Of course, ymmv and no guarantees whatoever.

Message 13 of 16
mdgm-ntgr
NETGEAR Employee Retired

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)

If you wanted to reduce the volume capacity, that is where there would certainly be much higher risk. As you'd be relying on a number of things working well and if just one of them doesn't then there could be big issues.

 

We know backups are important, but there would be users who would not update their backup (if they even have one) before doing such an operation even if we provide a number of warnings to do so.

Message 14 of 16
StephenB
Guru

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)


@mdgm wrote:

If you wanted to reduce the volume capacity, that is where there would certainly be much higher risk. As you'd be relying on a number of things working well and if just one of them doesn't then there could be big issues.

 

 

A middle ground could be a documented "at your own risk" ssh procedure.

 

Also, even if volume reduction can't be done, downgrading raid redundancy (raid1->jbod, raid 6->raid 5) would give users more options when their NAS runs out of capacity.

 

Message 15 of 16
Equinox1
Guide

Re: how to remove a hard disk clean from a raid (RN 314, using SSH)

I agree.

The 'key' here is that the most common scenario is not shrinking the capacity 'per se' but reducing the number of units it relies on.

Message 16 of 16
Top Contributors
Discussion stats
  • 15 replies
  • 3574 views
  • 2 kudos
  • 5 in conversation
Announcements