I have FreeNAS running in a VM in XCP-NG. I’ve followed the guides and I’ve dedicated a SATA controller to it using PCI-passthrough. FreeNAS correctly discovers its boot disk, which is virtual, and two physical disks that are connected through the SATA controller. Unfortunately, FreeNAS identifies both the virtual boot disk and the first physical disk as ada0
.
Here’s what I get when I run geom disk list
Geom name: ada0Providers:1. Name: ada0 Mediasize: 8589934592 (8.0G) Sectorsize: 512 Mode: r1w1e2 descr: (null) ident: (null) rotationrate: unknown fwsectors: 0 fwheads: 0Geom name: cd0Providers:1. Name: cd0 Mediasize: 0 (0B) Sectorsize: 2048 Mode: r0w0e0 descr: QEMU QEMU DVD-ROM ident: (null) rotationrate: unknown fwsectors: 0 fwheads: 0Geom name: ada0Providers:1. Name: ada0 Mediasize: 4000787030016 (3.6T) Sectorsize: 512 Stripesize: 4096 Stripeoffset: 0 Mode: r1w1e2 descr: WDC WD40EZRZ-00WN9B0 lunid: 50014ee20d58de88 ident: WD-WCC4E5SLVZV7 rotationrate: 5400 fwsectors: 63 fwheads: 16Geom name: ada1Providers:1. Name: ada1 Mediasize: 4000787030016 (3.6T) Sectorsize: 512 Stripesize: 4096 Stripeoffset: 0 Mode: r1w1e2 descr: WDC WD40EZRX-22SPEB0 lunid: 50014ee2b6e06d20 ident: WD-WCC4E4EN0Y9S rotationrate: 5400 fwsectors: 63 fwheads: 16
As you can see, ada0
appears twice. This is wreaking all kinds of havoc with ZFS, which coredumps if I run zpool import
or make any attempt to load the existing pool on the physical disks.
Some things that I’ve learned during my research into this:
- If I run Linux instead of FreeNAS, the disks are detected as xvda, sda and sdb.
- If I change the position of the boot disk to 2 instead of 0, it becomes
ada2
and pool import works but this isn’t feasible since I plan to have several more physical disks. - I can’t tell XCP-NG to assign the boot disk some high number that won’t conflict with any physical disks because then the VM won’t boot. It appears that the boot disk needs to be in position 3 or lower.
- In a YouTube video, someone else who’s done this used a SAS controller instead and the physical disks were labelled
da0
,da1
, etc., avoiding the conflict.
Is there any way I can force FreeNAS to number the disks from the second controller differently? Can I force it to use da0
? Can I force it to start at a different offset, like ada1
? Can I trick it into giving the virtual disk a different device name? Can I get XCP-NG to boot from a disk at an arbitrary position? Am I just stuck unless I buy a SAS controller?