Sherry L. Frasier
2007-Jul-17 14:34 UTC
front-end block device behavior in solaris guest (b44)
hi, i noticed that if i pass a disk partition (phy) through to a solaris guest, the guest sees the whole disk rather than the specific partition handed through. example: disk = [ ''phy:sdb3,5,w'' ] with this example, other guests (NetBSD, various linuxes) front end block driver presents the sdb3 partition as a "virtual disk", which can then be partitioned, etc as if it were a complete disk. the solaris xvbd, however, presents all of sdb to the guest, rather than just sdb3: # devfsadm -c disk -i xvbd # ls /devices/xendev/xvbd@5* /devices/xendev/xvbd@5:a /devices/xendev/xvbd@5:k,raw [...] # fdisk /dev/rdsk/c0d5p0 Total disk size is 3149 cylinders Cylinder size is 4096 (512 byte) blocks Cylinders Partition Status Type Start End Length % ====== ===== =========== ==== === ===== === 1 Active Linux native 0 62 63 2 2 Linux native 62 1658 1597 51 3 Linux native 1659 2172 514 16 4 EXT-DOS 2172 3148 977 31 [...] Is this expected behavior, or is it a bug? tia, Sherry ps: i''m using a redhat dom0 on Xen 3.1 This message posted from opensolaris.org
There could be some stale fdisk info on sdb3 which is read and interpreted in Solaris domU. Please try to clear the first 8k space on sdb3 by dd''ing ''\0'' to it, then try it again. Max Sherry L. Frasier wrote:> hi, > i noticed that if i pass a disk partition (phy) through to a solaris guest, the guest sees the whole disk rather than the specific partition handed through. example: > > disk = [ ''phy:sdb3,5,w'' ] > > with this example, other guests (NetBSD, various linuxes) front end block driver presents the sdb3 partition as a "virtual disk", which can then be partitioned, etc as if it were a complete disk. the solaris xvbd, however, presents all of sdb to the guest, rather than just sdb3: > > # devfsadm -c disk -i xvbd > # ls /devices/xendev/xvbd@5* > /devices/xendev/xvbd@5:a /devices/xendev/xvbd@5:k,raw > [...] > # fdisk /dev/rdsk/c0d5p0 > Total disk size is 3149 cylinders > Cylinder size is 4096 (512 byte) blocks > Cylinders > Partition Status Type Start End Length % > ====== ===== =========== ==== === ===== ===> 1 Active Linux native 0 62 63 2 > 2 Linux native 62 1658 1597 51 > 3 Linux native 1659 2172 514 16 > 4 EXT-DOS 2172 3148 977 31 > [...] > > Is this expected behavior, or is it a bug? > tia, > Sherry > ps: i''m using a redhat dom0 on Xen 3.1 > > > This message posted from opensolaris.org > _______________________________________________ > xen-discuss mailing list > xen-discuss@opensolaris.org >
Sherry L. Frasier
2007-Jul-18 22:22 UTC
Re: front-end block device behavior in solaris guest (b44)
> There could be some stale fdisk info on sdb3 which is > read and > interpreted in Solaris domU. > Please try to clear the first 8k space on sdb3 by > dd''ing ''\0'' to it, > then try it again. > > Maxhi max, your suggestion worked (dd if=/dev/zero of=/dev/sdb3 bs=1K count=8). i didn''t notice that the size of the disk reported was correct (it was the size of the partition handed through), however as you pointed out, fdisk was getting confused about some data in the first 8K. i went ahead and used fdisk to create a solaris2 partition for the whole "disk" (100%), and then had fun creating slices using fmthard. luckily, our CTO is an old unix hack who helped me ensure the slices fell on cylinder boundaries. is there a more user-friendly way to create slices on a x86 disk partition than fmthard? thanks, Sherry> > Sherry L. Frasier wrote: > > hi, > > i noticed that if i pass a disk partition (phy) > through to a solaris guest, the guest sees the whole > disk rather than the specific partition handed > through. example: > > > > disk = [ ''phy:sdb3,5,w'' ] > > > > with this example, other guests (NetBSD, various > linuxes) front end block driver presents the sdb3 > partition as a "virtual disk", which can then be > partitioned, etc as if it were a complete disk. the > solaris xvbd, however, presents all of sdb to the > guest, rather than just sdb3: > > > > # devfsadm -c disk -i xvbd > > # ls /devices/xendev/xvbd@5* > > /devices/xendev/xvbd@5:a > /devices/xendev/xvbd@5:k,raw > > > # fdisk /dev/rdsk/c0d5p0 > > Total disk size is 3149 cylinders > > Cylinder size is 4096 (512 byte) > blocks > > > > ylinders > > Partition Status Type > Start End Length % > ===== =========== ==== === ====> ===> 1 Active Linux native > 0 62 63 2 > 2 Linux native > 62 1658 1597 51 > 3 Linux native > 1659 2172 514 16 > 4 EXT-DOS > 2172 3148 977 31 > s this expected behavior, or is it a bug? > > tia, > > Sherry > > ps: i''m using a redhat dom0 on Xen 3.1 > > > > > > This message posted from opensolaris.org > > _______________________________________________ > > xen-discuss mailing list > > xen-discuss@opensolaris.org > > > _______________________________________________ > xen-discuss mailing list > xen-discuss@opensolaris.orgThis message posted from opensolaris.org
Sherry L. Frasier wrote:>> There could be some stale fdisk info on sdb3 which is >> read and >> interpreted in Solaris domU. >> Please try to clear the first 8k space on sdb3 by >> dd''ing ''\0'' to it, >> then try it again. >> >> Max >> > > hi max, > > your suggestion worked (dd if=/dev/zero of=/dev/sdb3 bs=1K count=8). i didn''t notice that the size of the disk reported was correct (it was the size of the partition handed through), however as you pointed out, fdisk was getting confused about some data in the first 8K. > > i went ahead and used fdisk to create a solaris2 partition for the whole "disk" (100%), and then had fun creating slices using fmthard. luckily, our CTO is an old unix hack who helped me ensure the slices fell on cylinder boundaries. is there a more user-friendly way to create slices on a x86 disk partition than fmthard? >Yes. You may want to use ''format'', then choose the disk you want to create slice on by inputing the number with it, then input ''partition'' command. OK, now you can see the menu to play with partitions(slices). Don''t forget to use ''label'' command to flush all your changes onto the disk(virtual disk), when you''re done ;-). Max> thanks, > Sherry > >> Sherry L. Frasier wrote: >> >>> hi, >>> i noticed that if i pass a disk partition (phy) >>> >> through to a solaris guest, the guest sees the whole >> disk rather than the specific partition handed >> through. example: >> >>> disk = [ ''phy:sdb3,5,w'' ] >>> >>> with this example, other guests (NetBSD, various >>> >> linuxes) front end block driver presents the sdb3 >> partition as a "virtual disk", which can then be >> partitioned, etc as if it were a complete disk. the >> solaris xvbd, however, presents all of sdb to the >> guest, rather than just sdb3: >> >>> # devfsadm -c disk -i xvbd >>> # ls /devices/xendev/xvbd@5* >>> /devices/xendev/xvbd@5:a >>> >> /devices/xendev/xvbd@5:k,raw >> >> >>> # fdisk /dev/rdsk/c0d5p0 >>> Total disk size is 3149 cylinders >>> Cylinder size is 4096 (512 byte) >>> >> blocks >> >> ylinders >> >>> Partition Status Type >>> >> Start End Length % >> ===== =========== ==== === ====>> ===>> 1 Active Linux native >> 0 62 63 2 >> 2 Linux native >> 62 1658 1597 51 >> 3 Linux native >> 1659 2172 514 16 >> 4 EXT-DOS >> 2172 3148 977 31 >> s this expected behavior, or is it a bug? >> >>> tia, >>> Sherry >>> ps: i''m using a redhat dom0 on Xen 3.1 >>> >>> >>> This message posted from opensolaris.org >>> _______________________________________________ >>> xen-discuss mailing list >>> xen-discuss@opensolaris.org >>> >>> >> _______________________________________________ >> xen-discuss mailing list >> xen-discuss@opensolaris.org >> > > > This message posted from opensolaris.org > _______________________________________________ > xen-discuss mailing list > xen-discuss@opensolaris.org >