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.

Cannot replace ZFS disk with same size disk.

Featured Replies

Hello, I am attempting to replace my ZFS pool disks. Presently they are two 2TB USB SSDs, which are slow because they cannot be TRIM'd due to Unraid's lack of UAS support. I am replacing them with 2TB sata disks. Per lsblk -b, the devices are exactly the same size. In the output below, the disks that I am attempting to replace (1 at a time) are sdb and sdc, and I am attempting to replace them with sdd and sdg. Unfortunately, I get an error stating "replacement device is too small" when attempting to start the array after selecting one of the replacement disks into the pool (using the GUI). Thanks for your help!

 

root@tiny:~# lsblk -b
NAME   MAJ:MIN RM           SIZE RO TYPE MOUNTPOINTS
loop0    7:0    0       62644224  1 loop /lib
loop1    7:1    0      345944064  1 loop /usr
loop2    7:2    0    21474836480  0 loop /var/lib/docker/btrfs
                                         /var/lib/docker
sda      8:0    1     8032092160  0 disk
└─sda1   8:1    1     8031043584  0 part /boot
sdb      8:16   0  2000398934016  0 disk
└─sdb1   8:17   0  2000398901248  0 part
sdc      8:32   0  2000398934016  0 disk
└─sdc1   8:33   0  2000398901248  0 part
sdd      8:48   0  2000398934016  0 disk
sde      8:64   0 14000519643136  0 disk
└─sde1   8:65   0 14000519593472  0 part
sdf      8:80   0 14000519643136  0 disk
└─sdf1   8:81   0 14000519593472  0 part
sdg      8:96   0  2000398934016  0 disk
sdh      8:112  0 14000519643136  0 disk
└─sdh1   8:113  0 14000519593472  0 part
sdi      8:128  0 14000519643136  0 disk
└─sdi1   8:129  0 14000519593472  0 part
sdj      8:144  0 14000519643136  0 disk
└─sdj1   8:145  0 14000519593472  0 part
md1p1    9:1    0 14000519589888  0 md   /mnt/disk1
md2p1    9:2    0 14000519589888  0 md   /mnt/disk2
md3p1    9:3    0 14000519589888  0 md   /mnt/disk3

  • Community Expert

unfortunatly, "same size" is often not "same size" 😞

For different interfaces, the partition layout may be different. Some start at sector 64, some already at sector 1 and some somewhere else.

So even if you are using disks with the same number of sectors, the "net free value" maybe different.

Sadly, this cannot be known before. But it seems that your former USB interface has used a different drive layout.

 

  • Community Expert

Is this a pool that was created elsewhere? Post the output of 

fdisk -l /dev/sdb

 

  • Author

Pool was created on Unraid.

 

root@tiny:~# fdisk -l /dev/sdb
Disk /dev/sdb: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: SSD-PUTA        
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdb1          64 3907029167 3907029104  1.8T 83 Linux
root@tiny:~#

  • Author

Also, here is the fdisk result for the disk that is "too small":

 

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

  • Community Expert
On 2/3/2024 at 6:39 AM, rheumatoid-programme6086 said:

I am replacing them with 2TB sata disks

You are replacing them with disks or SSDs? Fdisk is from an SSD.

 

I see what the issue is now, I thought it could be that before but rule it out because I though you were using disks for the new pool, though it still should not happen if the previous devices were also SSDs, possibly because of the enclosures Unraid did not detect them correctly.

 

The issue is that Unraid creates a partitions starting on sector 64 for HDDs, which is what the current pool is using, but if Unraid detects it's an SSD it will use sector 2048 instead, this should help with performance, so because of that the new devices will have a few less sectors for the partitions, and hence the too small error.

 

Since you can have all devices connected together I would recommend creating a new pool with the new devices and then use zfs replication to clone the filesystem to the new pool, let me know if you need help with the replications commands.

 

 

  • Author

You are correct that the new drives are SSDs .... I was using the term 'disk' generically.

 

The only thing in my cache is appdata. When I first added the cache, I stopped docker, copied all of the appdata from the array to the cache, pointed all of the docker containers at the new location, and started docker back up. A bunch of the containers malfunctioned or lost their settings anyway. Will ZFS pool replication avoid this problem? If so, I could use help with how to do it. If not, is there a way I can get Unraid to just create the partitions at the location they're in on the current SSDs

  • Community Expert
19 hours ago, rheumatoid-programme6086 said:

copied all of the appdata from the array to the cache, pointed all of the docker containers at the new location, and started docker back up.

That should have worked if everything was copied correctly.

 

19 hours ago, rheumatoid-programme6086 said:

Will ZFS pool replication avoid this problem?

It should, but again, so should have a correct copy of the data.

 

  • Author
4 hours ago, JorgeB said:

 

 

It should, but again, so should have a correct copy of the data.

 

 

Could you please point me to directions on how to do the ZFS replication? Thanks!

  • Community Expert

Post the output of

zfs list -t all

 

  • Author

root@tiny:~# zfs list -t all
NAME              USED  AVAIL     REFER  MOUNTPOINT
cache            48.9G  1.71T      120K  /mnt/cache
cache/appdata    13.9G  1.71T     13.9G  /mnt/cache/appdata
cache/cacheTemp  24.4G  1.71T     24.4G  /mnt/cache/cacheTemp
cache/domains      96K  1.71T       96K  /mnt/cache/domains
cache/system     10.6G  1.71T     10.6G  /mnt/cache/system

  • Community Expert

Disable docker and VM services and create a snapshot for each dataset, e.g.:

 

zfs snapshot cache/appdata@now

 

Then replicate to the new pool:

 

zfs send -R cache/appdata@now | zfs receive new_pool/appdata

 

Repeat for the remaining datasets, cacheTemp, domains and system, note that if there are any root folders that are not a dataset they would not show up on the previous output, those would need to be copied manually.

 

After the replication is done for all datasets you can remove the old pool and rename the new one to use the old name, this way you don't need to change anything in docker and VM services, after that's done  just re-enable the services.

 

Old pool will remain intact if needed, and you can then delete the snapshots on the new pool, e.g.

 

zfs destroy cache/appdata@now

 

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.