Mailing List Archive

Existing partitions on xvda
Hi Xen Users,

I've installed Xen and attempted to run a user domain (dom1) that has a
config with the line:

/disk = [ "file:/opt/isos/linux.iso,xvdb,cdrom", "phy:/dev/sda1,xvda,w" ]/

/dev/sda1, on dom0, is a 100GiB partition, on which I'd like to install
from linux.iso. After booting from the iso, I want to partition

/dev/xvda for /boot, /home and /. However, running fdisk /dev/xvda gives
output:

------------------

Disk /dev/xvda: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x73736572

Device     Boot      Start        End    Sectors   Size Id Type
/dev/xvda1      1920221984 3736432267 1816210284   866G 72 unknown
/dev/xvda2      1936028192 3889681299 1953653108 931.6G 6c unknown
/dev/xvda3               0          0          0     0B  0 Empty
/dev/xvda4            2048  209715199  209713152   100G 83 Linux

Partition table entries are not in disk order.

--------------------

Why are there 4 pre-existing partitions on my block device? What
accounts for their sizes? It looks like /dev/sda1 is mapped to xvda4,
when I wanted it to appear as a block device rather than a partition.

Many thanks,

Joe
Re: Existing partitions on xvda [ In reply to ]
Hi Joe,

On Sat, Feb 16, 2019 at 01:13:07PM +0000, Joe Kearney wrote:
> /disk = [ "file:/opt/isos/linux.iso,xvdb,cdrom", "phy:/dev/sda1,xvda,w" ]/

[…]

> ------------------
>
> Disk /dev/xvda: 100 GiB, 107374182400 bytes, 209715200 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 4096 bytes
> I/O size (minimum/optimal): 4096 bytes / 4096 bytes
> Disklabel type: dos
> Disk identifier: 0x73736572
>
> Device     Boot      Start        End    Sectors   Size Id Type
> /dev/xvda1      1920221984 3736432267 1816210284   866G 72 unknown
> /dev/xvda2      1936028192 3889681299 1953653108 931.6G 6c unknown
> /dev/xvda3               0          0          0     0B  0 Empty
> /dev/xvda4            2048  209715199  209713152   100G 83 Linux
>
> Partition table entries are not in disk order.
>
> --------------------
>
> Why are there 4 pre-existing partitions on my block device? What accounts
> for their sizes? It looks like /dev/sda1 is mapped to xvda4, when I wanted
> it to appear as a block device rather than a partition.

Well by partitioning your sda device on your dom0 I suspect that places
data that the installer inside the domU reads and tries to interpret as
a pre-existing partition table. Just deleting it and partitioning from
inside the domU would sort things out, I'd expect.

Though exporting a fixed partition to a guest like that is a bit
unusual. Normally you'd either create an LVM volume and export that, or
place a sparse file on your dom0 filesystem and export that. I don't
think it is wise to use a real disk partition.

Cheers,
Andy

_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Existing partitions on xvda [ In reply to ]
Hi,

Depends on the usecase, sometimes it imho can be crucial for the
performance (will not fragment somewhere on lvm level etc) but is more
difficult to scale the disk size if needed. So that's about priorities,
what is more important to your usecase.

(Sorry first sent it only to andy)
Gh.

On Sun, Feb 17, 2019, 00:47 Andy Smith <andy@strugglers.net wrote:

> Hi Joe,
>
> On Sat, Feb 16, 2019 at 01:13:07PM +0000, Joe Kearney wrote:
> > /disk = [ "file:/opt/isos/linux.iso,xvdb,cdrom", "phy:/dev/sda1,xvda,w"
> ]/
>
> […]
>
> > ------------------
> >
> > Disk /dev/xvda: 100 GiB, 107374182400 bytes, 209715200 sectors
> > Units: sectors of 1 * 512 = 512 bytes
> > Sector size (logical/physical): 512 bytes / 4096 bytes
> > I/O size (minimum/optimal): 4096 bytes / 4096 bytes
> > Disklabel type: dos
> > Disk identifier: 0x73736572
> >
> > Device Boot Start End Sectors Size Id Type
> > /dev/xvda1 1920221984 3736432267 1816210284 866G 72 unknown
> > /dev/xvda2 1936028192 3889681299 1953653108 931.6G 6c unknown
> > /dev/xvda3 0 0 0 0B 0 Empty
> > /dev/xvda4 2048 209715199 209713152 100G 83 Linux
> >
> > Partition table entries are not in disk order.
> >
> > --------------------
> >
> > Why are there 4 pre-existing partitions on my block device? What accounts
> > for their sizes? It looks like /dev/sda1 is mapped to xvda4, when I
> wanted
> > it to appear as a block device rather than a partition.
>
> Well by partitioning your sda device on your dom0 I suspect that places
> data that the installer inside the domU reads and tries to interpret as
> a pre-existing partition table. Just deleting it and partitioning from
> inside the domU would sort things out, I'd expect.
>
> Though exporting a fixed partition to a guest like that is a bit
> unusual. Normally you'd either create an LVM volume and export that, or
> place a sparse file on your dom0 filesystem and export that. I don't
> think it is wise to use a real disk partition.
>
> Cheers,
> Andy
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@lists.xenproject.org
> https://lists.xenproject.org/mailman/listinfo/xen-users