XenServer: Creating an ISO Partition on DOM0

Intro

I recently updated my lab machine to XenServer 6.0 and I wanted to create a local ISO repository on the DOM0 partition. I have 3 physical drives, one 250GB drive that holds the host partition and its backup and two 500GB drives that host VM’s. I know that only 8GB on the 250 GB drive are used for the host and its backup, so I wanted to create the local ISO repository in the remaining space.

Stop! Linux Time

Connect to the CLI of your XenServer.

fdisk –l shows my current partition tables

[root@MARLINSPIKE ~]# fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sda doesn't contain a valid partition table

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sdc: 250.0 GB, 250059350016 bytes
256 heads, 63 sectors/track, 30282 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1       30283   244198583+  ee  EFI GPT

Dom0 contains 3 partitions. The first is where the XenServer host resides. The second is the host backup. The final partition is the rest of the unused space on the 250GB drive. In my file system, this is /dev/sdc3. The following commands will format and mount this space as an ISO partition.


[root@MARLINSPIKE ~]# mkfs.ext3 /dev/sdc3
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
29491200 inodes, 58952233 blocks
2947611 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
1800 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@MARLINSPIKE]# mkdir /mnt/iso/
[root@MARLINSPIKE]# mount -t ext3 /dev/sdc3 /mnt/iso/
[root@MARLINSPIKE]# echo "/dev/sdc3 /mnt/iso ext3 defaults 1 1" >> /etc/fstab
[root@MARLINSPIKE]# xe-mount-iso-sr /mnt/iso -o bind

Now the new ISO partition shows up in my XenCenter console.

image

Sources:

Citrix Forums: Thread: Dom0 Partitions

Citrix Forums: Thread: xe sr-create, local ISO SR on larger drive

How to add an additional local disk to your XenServer 5.5 host

XenServer create local ISO Repository (LVM)

How To Re-partition a Xen Virtual Machine Using GParted LiveCD

LinuxQuestions.org: Having problems mounting hd. (mount: you must specify the filesystem type)

Thanks,
Alain

Advertisements

5 thoughts on “XenServer: Creating an ISO Partition on DOM0”

  1. when I did this it all worked except the new folder was a copy of sda1 size of 4gb. How do I expand sda2 which is now /mnt/iso to use the rest of the 250gb drive? There should be at least 200gb available for the iso’s or vm backups.

    1. Brian,

      What version of XenServer did you try this on? What is the result of running fdisk -l on your XenCenter console? You can also run fdisk /dev/sda3 -l.

      Thanks,
      Alain

  2. [root@XenServer ~]# fdisk /dev/sdb1 -l

    Disk /dev/sdb1: 134 MB, 134217728 bytes
    255 heads, 63 sectors/track, 16 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Disk /dev/sdb1 doesn’t contain a valid partition table

    should be over 250g here not 134mb

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s