Replacing Disk "must be larger than X bytes"

douglasg

Cadet
Joined
Mar 24, 2021
Messages
7
Hello,
I'm running TrueNAS Scale 23.10.1 and getting the following error when trying to replace a disk with the exact same model:

Code:
Error: [EFAULT] Disk 'sdc' must be larger than 2000397868544 bytes


When I look at fdisk for the new drive (/dev/sdc), it has 2000398934016 bytes:

Code:
root@truenas:~# fdisk -l /dev/sdc
Disk /dev/sdc: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: ST2000LX001-1RG1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


I've tried a couple different drives of the same model/size but I get the same error. The drives are in a 1 RAIDZ2 8 wide vdev. Any thoughts on what is happening and how to fix it? Thanks!
 

douglasg

Cadet
Joined
Mar 24, 2021
Messages
7
Looks like I was able to replace the drive via the command line so must be something in the UI.
 

jhl

Dabbler
Joined
Mar 5, 2023
Messages
27
Any advice on working around this? I can Google Zpool commands but they only seem to work on the disk ID, not /dev/sdX path to the disk. I tried to find info on where to find the disk IDs on Truenas because some folders are not browsable from the commandline, all the responses are that you shouldn't be doing it that way and should use the GUI, doesn't work in this case...
 

douglasg

Cadet
Joined
Mar 24, 2021
Messages
7
Hello, I am having exactly the same issue with 2TB HDD.
Could you please share the line command(s) you used?
Sure, I don't see the commands in my history anymore but I believe it was something like this:


Code:
zpool replace <pool> <bad device> <good device>
ex: zpool replace tank /dev/sdb /dev/sdc


And @jhl I was able to use the /dev/sdX device path instead of the disk ID (notice the /sdb device):

Code:
root@truenas:~# zpool status tank
  pool: tank
 state: ONLINE
  scan: resilvered 68.1G in 09:23:06 with 0 errors on Tue Dec 26 06:49:36 2023
config:

        NAME                                      STATE     READ WRITE CKSUM
        tank                                      ONLINE       0     0     0
          raidz2-0                                ONLINE       0     0     0
            sdb                                   ONLINE       0     0     0
            7e90906a-d47a-489b-87c5-950a03fc07b0  ONLINE       0     0     0
            2656e8ee-ef19-4631-bdfd-d48f91a77e69  ONLINE       0     0     0
            eb3ef4a3-1e4a-4c26-8160-cdb7bae0041c  ONLINE       0     0     0
            c7a0e186-329f-44ce-bd4f-31802d59b9e6  ONLINE       0     0     0
            b69470bb-1bda-4df7-b215-2118cef4c550  ONLINE       0     0     0
            bea85933-0da7-4240-b0d6-0fc0f05478fd  ONLINE       0     0     0
            ba68ac98-1695-4477-b2f3-1ffc94ed3c1f  ONLINE       0     0     0
 

hubacekp2

Cadet
Joined
Jan 5, 2024
Messages
6
Code:
zpool replace <pool> <bad device> <good device>
ex: zpool replace tank /dev/sdb /dev/sdc

Excelent. Thank you. I will test it after I find out how to solve my HDD is quoted missing.
Does anyone has idea how to:
- replace missing HDD N°1 ?
- remove or cancel hot spare N°2 ?
- can I easily replace the HDD N°1 by N°3 ?

TrueNAS - All Drives 192.168.1.230_2024-01-06-22-20 _ edit for forum.PNG
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
The problem is that sdb might change - and then you have issues.
I would suggext exporting the pool (from the GUI) and then importing it again (in the GUI) which should fix that problem
 

hubacekp2

Cadet
Joined
Jan 5, 2024
Messages
6
The problem is that sdb might change - and then you have issues.
I would suggext exporting the pool (from the GUI) and then importing it again (in the GUI) which should fix that problem

I did it, but no change at all, the print screen is the same:
1) I clicked "Export/Disconnect" via the GUI
NOT checked - Destroy data on this pool?
NOT checked - Delete saved configurations from TrueNAS?
checked - Confirm Export/Disconnect

2) Clicked "Import Pool"
selected the pool and wyited for imort

3) the same setup was imported - no change

Have you other advice? I would appreciate it very much :smile:
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
I don't as I thought that was the solution.

Anyone else?
 

hubacekp2

Cadet
Joined
Jan 5, 2024
Messages
6
I don't as I thought that was the solution.

Dou you know, that it could be dangerous for me (my data) or someone other's data to do something that you suggested here only because it went through your mind? I may be wrong, but have you a reference to the TrueNAS documentation or other Forum topic where such a operation helped?
 

neofusion

Contributor
Joined
Apr 2, 2022
Messages
159
I don't as I thought that was the solution.

Anyone else?
I was going to suggest an addendum to your sound suggestion but I've decided not to due to certain, other, reasons.
 

hubacekp2

Cadet
Joined
Jan 5, 2024
Messages
6
I'll describe what I have done as it may be usefull for others:

1) Replacement of unavail HDD by another HDD of the same size in GUI was not possible - showed me the HDD must be larger size
I didn't figure out how to replace 2TB unavail HDD by any of my 3pcs of 2TB HDD.
So I decided to buy a new 4TB HDD for the replacement in the GUI and resilvering was done with charm.

2) Remove FAULTY HDD

I typed the following commands in the shell:

Code:
zpool status PoolA

=> this printed me the list of my HDDs with exact device name.
note: Interesting is, that HDD sdd in GUI is sdd1 in command line

Code:
zpool remove PoolA /dev/sdd1

=> this removed my FAULTY spare HDD sdd within 5 sec

3) Remove healthy HDD
Code:
zpool remove PoolA /dev/sdi1

=> this removed my other spare HDD sdi within 5 sec.
note: This HDD sdi is healthy so I can use it elsewhere.

The present result:
1705269121790.png


My toughts:

As my Zpool is raidz3, I prefer to have cold spare instead hot spare.
This will save the life of my HDD and I replace the HDD only on "email request when TrueNAS allert me".

I'll proceed to replacing the 4TB hdd by 2TB hdd and see, if I succeed in GUI.
Eventualy, I am ok with the posibility I don't succeed the replacement to have back all the hdds of the same size in the pool.
 
Last edited:

hubacekp2

Cadet
Joined
Jan 5, 2024
Messages
6
Surprisingly, I have suceeded, in GUI, to use the command "Replace" for the sdn HDD 4TB and replace it by previously removed sdi HDD 2TB used as hot spare HDD. Now resilvering.
1705269952627.png

Only one a bit onnoying thing in TrueNAS GUI is, that device name changes every time when I do a change add/detach/replace/remove and HDD. I would prefer to have the name fixed with HDD serial number. Not sdh only, but informative like sdh_2GFZ0G (6 last letters from hdd SN). Well, just dreaming.

1705269444935.png
 

douglasg

Cadet
Joined
Mar 24, 2021
Messages
7
I didn't know how/where to get the disk GUID but for posterity, you can just use the disk-id (which I prefer more):

Code:
# ls -l /dev/disk/by-id | grep sdb
lrwxrwxrwx 1 root root  9 Jan 19 16:41 ata-ST2000LX001-1RG174_XXXX -> ../../sdb
lrwxrwxrwx 1 root root  9 Jan 19 16:41 wwn-0x5000c500aXXXX -> ../../sdb


And I was able to do the following after putting the disk offline in the UI (replacing the same disk with itself since the UI still gives the "replacing disk must be larger" error):

Code:
zpool replace tank /dev/sdb /dev/disk/by-id/ata-ST2000LX001-1RG174_XXXX


Is there any reason why the UI should prevent us from replacing a drive even though we can do it on the command line?
 
Top