Best way to replace a disk 1:1

Hello,

I’m going to start replacing some of the drives in my raid z1 array from SMR to CMR (Now I know…). What’s the best/easiest/less risky way to do this currently? I have no sata ports left, and I don’t want to do raid z1 extensions, I already rebuilt it from scratch due to issues with expansion.

Can I just power off, swap the disk, and it will do a raid rebuild automatically?

Thanks.

Not sure which version you are running, but there are pages in the docs specifically on disk replacement for example for 25.04:

1 Like

Thanks. No failed disk here, but same procedure. I “just” have to identify the proper disk :slight_smile:

Yes, offline → remove disk → insert new disk → discover disk → replace

You may need to do a disk wipe after inserting the new disk if there is anything on the new disk. It doesn’t hurt and doesn’t take a lot of time to wipe so kind of habit for me now.

1 Like

Yes I’ll do a short erase before with HDD low level format.

If you have a spare port - then replace without removing a disk first - its a bit safer

3 Likes

And if you have no spare port, you can put the drive to be replaced on a USB adapter so that it can still contribute redundancy.

2 Likes

And if you don’t have a spare port or a USB adapter, then it’s time to live dangerously.

1 Like

Ah good idea, I’ll use usb. But truenas will “recognize” the disk if moved to usb?

1 Like

Depends on the adapter or enclosure.

Avoid the “toaster” kinds or those with multiple bays when possible.

As long as it is partitioned correctly and the ZFS label is created and referenced by the partition’s PARTUUID, you should be fine.

Something like this should work fine.

1 Like

I have this kind of usb3 enclosures. But then should I still put the disk offline first? Or power off, move the disk to usb, power on and it will find it?

Can you show us what the current setup is?

Does it look something like this:

MyPool

  • raidz1
    – disk A, SMR
    – disk B, SMR
    – disk C, SMR

You have CMR replacements ready as disks D, E, and F, which are the same size as the existing disks. They are not currently in the server.

We can only guess. It’s better if you post it.

6 disks, 4 SMR, and only one to replace for now, hunting 3 more CMR used.

You can have the new CMR in the USB adapter and choose it to “replace” one of the SMRs still plugged in. (Find the SMR to be replaced and choose the “Replace” option.)

I would assume (hope) that TrueNAS will properly create a ZFS member partition, leave a 2GB buffer, and use the PARTUUID.

This will allow you to then power off the server, physically remove the “replaced” SMR, and swap it for the CMR drive in the free SATA port. When you power on again, TrueNAS should (hopefully) be able to bring the pool online, using the PARTUUIDs.

What version of TrueNAS are you running?

I’m running Scale 25.04. I can try this, the most important being of course not to lose the data :grin:

Do you have backups?

More or less, the essential part at least.

This. ZFS tracks drives by UUID and does not care how they are attached. (Well, it does matter to some extent, but temporary redundancy through a flaky link is better than no redundancy.)

2 Likes

So, first disk replaced. I went the easiest way: put the disk offline, power off, remove the disk physically, put the new one in the same slot, power on, then “Replace” disk, resilver ran overnight with no issue.