Skip to contentSkip to conversation

Xen and 4K Sectors (was blkback and bcache)

DISCUSSION Jonathan Tripathy 3 participants 3 messages Aug 28, 2012 – Aug 29, 2012

lore
Share & tools
lore
#0 lore raw
Quoted 8 lines · James Harper
/  >/
/  > I think the problem is definitely related to the 4K sector issue./
/  >/
/  > qemu appears to always present 512 byte sectors, thus only booting from a/
/  > 512 byte sector partition table. Once the PV drivers take over though it all/
/  > falls down because PV drivers are passed a 4K sector size and nothing/
/  > matches up anymore./
/  >

/Hi James,

I'm curious as to how you came to the conclusion that qemu always presents 512 byte sectors?
When using bcache formatted to a 4k sector size, Windows Server 2008 just flat out refuses to install... This is true regardless of whether I'm passing an LV directly to the DomU (phy), or whether I'm using tap::aio or file.

When formatting the bcache to 512 byte size, Windows tries to install. I say "tries" as then my system kernel panics and reboots, but that's a bcache issue (I've posted the trace to the bcache list).

Thanks

//

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#1 lore raw
Quoted 3 lines

I'm curious as to how you came to the conclusion that qemu always presents 512 byte sectors?

I checked the code. I could be wrong but the value 512 seemed pretty much hardcoded.

Quoted 9 lines

When using bcache formatted to a 4k sector size, Windows Server 2008 just flat out refuses to install...
This is true regardless of whether I'm passing an LV directly to the DomU (phy), or whether I'm using tap::aio or file.

When formatting the bcache to 512 byte size, Windows tries to install. I say "tries" as then my system kernel panics and reboots, but that's a bcache issue (I've posted the trace to the bcache list).

I'm watching your thread on bcache list too.

Ideally, we'd be able to emulate 512e so windows can know that the underlying block size is 4k and will (in win7 and newer) align to that boundary where possible.

lvm seems pretty flexible wrt block size. I had my lvm with a pv with 4k block size and wanted 512 byte block size, so I split my raid, created a new raid with the now spare disk and created bcache with 512 byte block size, added the 512 byte pv to the lvm (which is now 2 pv's one 512, one 4k), pvmove'd everything across, then removed the 4k pv and joined it to the new raid.

James

#2 lore raw
In reply to Jonathan Tripathy

Word of warning:
Since you are messing with 4k size bocks:

If you add a 4k dm device to a 512b dm device, the dm becomes a 4k device.
If you combine this with a phy:// disk and you are using a Windows it starts trashing your data.

I don't think this bug has been fixed yet, but strictly speaking, it's windows not supporting block-size changes on the fly.

Quoted 25 lines · Jonathan Tripathy
Quoted 8 lines · James Harper
/  >  /
/  >  I think the problem is definitely related to the 4K sector issue./
/  >  /
/  >  qemu appears to always present 512 byte sectors, thus only booting from a/
/  >  512 byte sector partition table. Once the PV drivers take over though it all/
/  >  falls down because PV drivers are passed a 4K sector size and nothing/
/  >  matches up anymore./
/  >

/Hi James,

I'm curious as to how you came to the conclusion that qemu always presents 512 byte sectors?
When using bcache formatted to a 4k sector size, Windows Server 2008 just flat out refuses to install... This is true regardless of whether I'm passing an LV directly to the DomU (phy), or whether I'm using tap::aio or file.

When formatting the bcache to 512 byte size, Windows tries to install. I say "tries" as then my system kernel panics and reboots, but that's a bcache issue (I've posted the trace to the bcache list).

Thanks

Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel