# XEN, 3TB hard drive seen as 746GB



## stefarossi (Apr 2, 2013)

Hello everybody,

I'm quite new to Xen. I am running Debian as dom0 and FreeBSD as domU. The machine does not have VT-x, so it's running in paravirtualization.

This is the virtual machine configuration file:

```
name = "freebsd" 
kernel = "/boot/kfreebsd-9.0-2-xen.gz" 
extra = "vfs.root.mountfrom=ufs:/dev/ad0p2" 
memory = 128
vif=[ 'bridge=xenbr0' ]
disk = [
	"file:/var/xen/freebsd.img,hda,w",
	"phy:/dev/sdb,sda,r"
]
```
I'm trying to "attach" an internal 3TB drive (/dev/sdb), but FreeBSD recognizes it as 764436MB big:

```
xbd1: 764436MB <Virtual Block Device> at device/vbd/2048 on xenbusb_front0
xbd1: attaching as da0
```
and then complains that the GPT is corrupt, probably because it's only seeing part of the drive:

```
GEOM: da0: corrupt or invalid GPT detected.
GEOM: da0: GPT rejected -- may not be recoverable.
```

What can I do?
Thanks.


----------



## mav@ (Apr 5, 2013)

I am not a Xen expert, but a quick look at the xbd driver shows me a variable of "unsigned long" type, used for reading the disk size from Xen. That effectively limits the disk size to 2GB (if sector size is set to 512). I have no idea whether it is a Xen limitation or the driver bug.


----------

