From Single disk RAID-0 ZFS to RAID-1

emanuelebruno

Renowned Member
May 1, 2012
143
7
83
Catania
emanuelebruno.it
Hi,
according to my post, this italian translation is for you:

Having the need to purchase a second 8-TB disk and put it in RAID-1 on a already working system consisting of only one RAID 0 disk, I wanted to write this step-by-step guide hoping to be of help to someone. First, let's repeat the steps written in the previous guide:



Code:
sgdisk --replicate=/dev/sdb /dev/sda
sgdisk --randomize-guids /dev/sdb
grub-install /dev/sdb

To add the second disk to the existing pool and to have a RAID-1perfectly working, I had to type the following command:

Code:
zpool attach rpool pci-0000:00:10.0-scsi-0:0:0:0-part2 /dev/sdb



At the end of the operation and after a reboot, the system will be fully functional:



Best regards,
Emanuele Bruno
 
You don't need to reboot
Additionally, you have to install grub even on the newly added disk or in case of first disk failure, your system won't boot anymore
 
Hi,
...
Code:
sgdisk --replicate=/dev/sdb /dev/sda
sgdisk --randomize-guids /dev/sdb
grub-install /dev/sdb

To add the second disk to the existing pool and to have a RAID-1perfectly working, I had to type the following command:

Code:
zpool attach rpool pci-0000:00:10.0-scsi-0:0:0:0-part2 /dev/sdb
...
Hi,
why you copy the partitiontable first, but then add the whole disk and not part2 also (sdb2)?
Is this correct?

Udo
 
Hi,
why you copy the partitiontable first, but then add the whole disk and not part2 also (sdb2)?
Is this correct?

Hi,

Udo you are wright. It is a non-sense to copy the partion layout, and then to add the new disk to the pool(and not a partition, sdb2) !

I also read your tutorial(I can undestand some words .... not all). As a observation, the best test for the new HDD that will be add to a pool, would be(my opinion):

FOR J=1,N

smartctl -t long /dev/sdX

badblocks -c 10240 -s -w -t random -v /dev/sdaX

NEXT J

- badblock will write random data to the disk, and then it will read the same data , in case of write data != read data, this is a bad disk(very probably)

- adjust N as you wish(I use 5 in most of the cases)
 

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!