Create local ISO Storage in XenServer from remaining space on boot Disk

imageWhen installing a XenServer there is a question in the setup wizard which asks where to place the virtual machine files. You can choose your storage and even the remaining space on the boot disk. But where to place to ISO files then? You have to create a NFS share or SMB or whatever Knipogende emoticon to accomplish that. But in a 1 host environment it handy to have it on the same host. I will explain how-to use the remaining free space on the boot disk for an ISO storage repository.

First open the XenServer host console.

image

Check the current partition table: fdisk –l

image

As you can see in the screenshot, my boot partition is the /dev/sda1 (SD = Mass Storage Drive, A = First Registered Device, 1 = First Partition)

To get more info on this disk type: gdisk /dev/sda –l

image

Now you see that there are 3 partitions on my disk: 2x 4GB (SDA1/SDA2) and 1 with the rest (SDA3).

I will use the /dev/sda3 for ISO repository.

Format the /dev/sda3 with the following command: mkfs.ext3 /dev/sda3

After the format is done, we are gone mount it to /mnt/iso.

Create the iso directory: mkdir /mnt/iso

Mount the partition: mount –t ext3 /dev/sda3 /mnt/iso/

The mount must be active after a reboot. So add it to the fstab script: echo “/dev/sda3 /mnt/iso ext3 defaults 1 1” >> /etc/fstab

Make it available in XenServer: xe-mount-iso-sr /mnt/iso –o bind

Use FileZilla to make a SFTP connection to the XenServer host and to upload the ISO files to /mnt/iso

image

And now the ISO files are ready to use in XenServer.

image

9 thoughts on “Create local ISO Storage in XenServer from remaining space on boot Disk

  1. Hi Jeroen,

    Great post, very usefull!

    The statement to mount the partition should be
    # mount –t ext3 /dev/sda3 /mnt/iso/
    instead of
    # mount –t ext /dev/sda3 /mnt/iso/

    Regards,
    Ingmar Verheij

    1. I know 😉 I thought that I had changed the post, but I didn’t ;). But now I have hahahaha. Thanks for the head up.

      (damn five times “I” in 1 post… nice :))

  2. Hi Jeroen. This information is just what i am looking for and seems to be the clearest I have found.
    However I have two disks installed 80gb which is system and 250Gb for the vm storage. The problem I have is that the remaining space on the system disk is not being allocated to sdb3.

    Found valid GPT with protective MBR; using GPT.
    Disk /dev/sdb: 156250000 sectors, 74.5 GiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): 0964B78A-0653-443A-9F37-036C08B5C132
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 156249966
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 139476745 sectors (66.5 GiB)

    Number Start (sector) End (sector) Size Code Name
    1 2048 8388641 4.0 GiB 0700
    2 8390656 16777249 4.0 GiB 0700

    Are you able to point me in the correct direct to create sbd3

    Thanks

    1. There is no partition for your remaining space. So you have to create a partition (sdb3).

      I dond’t have a XenServer environment at this moment, so I cant help you.

      But with good goole skills you can find an answer )

    2. You can create a new partition using gdisk. Do something like this:

      gdisk /dev/gdb

      Press “?” to see the list of available commands… you can see that pressing ‘n’ will start a wizard to create a new partition. To use the remaining available space on your disk, just accept all the default settings by pressing ‘enter’ repeatedly. This will not format the partition, so you will start back at that point in Jeroen’s guide above.

      MVG,
      Jonathan

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top