I switched the HC550 in the ZFS pool from 512e to 4kn, and something strange happened

After converting a HC550 disk in the ZFS pool to 4kn, I was surprised to find that I could directly bring that hard drive into an ONLINE state. My initial expectation was that I would need to repartition and rebuild the ZFS pool, but it seems that may not be necessary. Now, I would like to verify the integrity of the ZFS pool. Is it sufficient to use the zpool scrub command for this purpose?

Hi @Dark_iaji,

Although I have no experience with ZFS, the Arch wiki article says:

Verifying pool status

If the command is successful, there will be no output. Using the mount command will show that the pool is mounted. Using zpool status will show that the pool has been created:

# zpool status -v


pool: bigdata
state: ONLINE
scan: none requested
config:

NAME STATE READ WRITE CKSUM
bigdata ONLINE 0 0 0
-0 ONLINE 0 0 0
ata-ST3000DM001-9YN166_S1F0KDGY-part1 ONLINE 0 0 0
ata-ST3000DM001-9YN166_S1F0JKRR-part1 ONLINE 0 0 0
ata-ST3000DM001-9YN166_S1F0KBP8-part1 ONLINE 0 0 0
ata-ST3000DM001-9YN166_S1F0JTM1-part1 ONLINE 0 0 0

errors: No known data errors

At this point it would be good to reboot the machine to ensure that the ZFS pool is mounted at boot. It is best to deal with all errors before transferring data.

Hope this helps!

How did you convert the block size to the other block size on ZFS pool?
I do not find any information about this converting.

Keep in mind that changing the block size of ZFS dataset only affects newly written data. It does not modify existing data. This is not the converting.


I don’t think zpool scrub can verify that all data uses the 4k block size.

PS: ZFS version 2.2.0 has the known crazy bug (Block cloning bug): If you copy data to the same ZFS pool to create a silent data corruption, this corruption cannot be detected by zfs scrub. You need to upgrade ZFS version to version 2.2.2 to fix some bugs (The block cloning feature is disabled.)

I am converting the HDD logical sector size, not modifying the ashift of the ZFS pool. Generally, it seems rare for consumer-grade devices to support switching the logical sector from 512e to 4Kn, but I happen to be using data center products.

https://wiki.archlinux.org/title/Advanced_Format#Advanced_Format_hard_disk_drives