Add Second HDD

Hi, I'm new to FreeBSD,

I installed FreeBSD with ZFS on my system. Now I want to add a Second HDD to the system. At this moment the second disk is formatted with HFS+.
How can I delete the disk an add it to the FreeBSD system with ZFS?

Code:
gpart list
Geom name: ada0
modified: false
state: CORRUPT
fwheads: 16
fwsectors: 63
last: 3907024862
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ada0p1
   Mediasize: 209715200 (200M)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: e892ffec-a6bc-41f1-a0c7-ea9f052d4bc4
   rawtype: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
   label: EFI System Partition
   length: 209715200
   offset: 20480
   type: efi
   index: 1
   end: 409639
   start: 40
2. Name: ada0p2
   Mediasize: 2000052772864 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 09601d95-5419-456f-9036-e65f3b4a4e75
   rawtype: 48465300-0000-11aa-aa11-00306543ecac
   label: Tee
   length: 2000052772864
   offset: 209735680
   type: apple-hfs
   index: 2
   end: 3906762711
   start: 409640
Consumers:
1. Name: ada0
   Mediasize: 2000398934016 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0

Geom name: ada1
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 3907029134
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ada1p1
   Mediasize: 524288 (512K)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 1b8c54f3-b6e0-11e3-895f-d05099046a14
   rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
   label: gptboot0
   length: 524288
   offset: 20480
   type: freebsd-boot
   index: 1
   end: 1063
   start: 40
2. Name: ada1p2
   Mediasize: 2147483648 (2.0G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   rawuuid: 1ba75df5-b6e0-11e3-895f-d05099046a14
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: swap0
   length: 2147483648
   offset: 544768
   type: freebsd-swap
   index: 2
   end: 4195367
   start: 1064
3. Name: ada1p3
   Mediasize: 1998250885120 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e2
   rawuuid: 1bb9f518-b6e0-11e3-895f-d05099046a14
   rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
   label: zfs0
   length: 1998250885120
   offset: 2148028416
   type: freebsd-zfs
   index: 3
   end: 3907029127
   start: 4195368
Consumers:
1. Name: ada1
   Mediasize: 2000398934016 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r2w2e5

Geom name: diskid/DISK-WD-WCAZAL129990
modified: false
state: CORRUPT
fwheads: 16
fwsectors: 63
last: 3907024862
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: diskid/DISK-WD-WCAZAL129990p1
   Mediasize: 209715200 (200M)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: e892ffec-a6bc-41f1-a0c7-ea9f052d4bc4
   rawtype: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
   label: EFI System Partition
   length: 209715200
   offset: 20480
   type: efi
   index: 1
   end: 409639
   start: 40
2. Name: diskid/DISK-WD-WCAZAL129990p2
   Mediasize: 2000052772864 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   rawuuid: 09601d95-5419-456f-9036-e65f3b4a4e75
   rawtype: 48465300-0000-11aa-aa11-00306543ecac
   label: Tee
   length: 2000052772864
   offset: 209735680
   type: apple-hfs
   index: 2
   end: 3906762711
   start: 409640
Consumers:
1. Name: diskid/DISK-WD-WCAZAL129990
   Mediasize: 2000398934016 (1.8T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
 
If you want to, blank out the second disk with dd, by overwriting all of adax (in your case, the "new" disk seems to be ada0, judging by the messed-up partition table containing a HFS file system). This is not necessary, but I like to start with blank disks. There is risk ... if you blank the wrong disk, your other disk is gone. Expect this to take about an hour.

Then, partition the new disk: gpart add -t freebsd-zfs -a 4K -l pickYourFavoriteNameForIt -s xxxG ada0. Pick a sensible size, thinking about whether you want to leave some spare space for later. I think if you omit the -s option, the partition will use the whole disk, but I'm not sure (read the man page yourself).

Now add that new partition to your ZFS file system. If you want to just make the existing pool bigger, then just do zpool add oldPool adaXsY. But if you have enough disk space, I would do mirroring instead (safer against disk failure), and use zpool attach oldPool adaXsY. Before you make that decision, learn about ZFS.
 
Back
Top