issue with replacing disk?

killmasta93

Renowned Member
Aug 13, 2017
973
58
68
31
Hi
I was wondering if someone could shed some light on the issue im having, Currently going to replace a disk as it failed but using sgdisk as i normally do but this time it says something very odd

the sda is the new disk and copy the tables from sdb


Code:
root@prometheus5:~# sgdisk /dev/sdb -R /dev/sda
Caution! Secondary header was placed beyond the disk's limits! Moving the
header, but other problems may occur!

Warning! Secondary partition table overlaps the last partition by
8546598522 blocks!
You will need to delete this partition or resize it in another utility.

Problem: partition 3 is too big for the disk.
Aborting write operation!
Aborting write of new partition table.


i saw both disks have the same size but whats differnt is the unit sectors which not sure that might be the reason

Code:
root@prometheus5:~# fdisk /dev/sda -l

Disk /dev/sda: 4.6 TiB, 5000981078016 bytes, 1220942646 sectors

Units: sectors of 1 * 4096 = 4096 bytes

Sector size (logical/physical): 4096 bytes / 4096 bytes

I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disklabel type: gpt

Disk identifier: 5D256687-6481-489F-91BA-3BC387217DF3

root@prometheus5:~# fdisk /dev/sdb -l

Disk /dev/sdb: 4.6 TiB, 5000981078016 bytes, 9767541168 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 4096 bytes

I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disklabel type: gpt

Disk identifier: EE73122C-8C7D-407B-98B2-AE93D009C300


Device       Start        End    Sectors  Size Type

/dev/sdb1       34       2047       2014 1007K BIOS boot

/dev/sdb2     2048    1050623    1048576  512M EFI System

/dev/sdb3  1050624 9767541134 9766490511  4.6T Solaris /usr & Apple ZFS


Partition 1 does not start on physical sector boundary.


Thank you
 
Is there a reason why you are trying to only copy the partition table to the new disk? I think it should be fine if you just create a diskimage and restore it to your new disk or just copy it directly with dd .
 
Last edited:
I see, this seems quite tricky. The only solution I can see is recreating the partition table by hand with the exact same sizes. This seems impossible though since your first partition has 2014 sectors which is not divisible by 8 and your 3rd partition has 9766490511 sectors which is also not divisible by 8. So I am quite unsure if this is even possible.
 
thank you for the reply, but whats odd is that both disks have the same size
Yes, but the logical sector size is what makes the difference here sadly as you already seemed to have noticed. The other way around would be no problem, I think.

What you still could try, instead of trying to copy the partition table of the old disk is manually recreating all the partitions with approximately the same size and then trying to proceed with the steps in the wiki (e.g. skipping the sgdisk commands, instead creating partitions manually by hand with parted or something similar). I cannot guarantee for this to work though.

You can also try playing around with the ashift parameter of ZFS [1].

The easiest solution by far would be to just get a disk with the same logical/physical sector size as your previous one. Then you should encounter no problems when copying the partition table and everything should work as expected. Everything else would be a bit iffy imho and could have performance impacts even when you get it to work.

[1] https://www.reddit.com/r/zfs/comments/xutuqz/zfs_pool_with_identical_disks_except_different/
 
Last edited:
thank you so much, im going to try and postback, worst case scenario would be nuke and reinstall
 
thank you so much, im going to try and postback, worst case scenario would be nuke and reinstall
Either this or getting a new drive that has the same sector sizes, as your old ones. Not sure if you saw my edit, but I think this would be by far the sanest and easiest solution compared to the other options.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!