Link to home
Start Free TrialLog in
Avatar of basraj
basrajFlag for India

asked on

Installing Xenserver 5.5 on USB

I have trouble running Xenserver from a USB. I'm trying to run xenserver from my laptop using USB drive.

Specifications of my laptop: 4GB RAM, I5 processor, Win 7 OS, VT enabled

I do not want to wipe off Win-7, so I would like to use my USb stick for xenserver (16GB stick).

* Using Unetbootin software, I copied xenserver iso to another 2GB USB stick.
* Renamed the following:

Rename \syslinux.cfg to syslinux_cfg.old
Rename \boot\isolinux to syslinux
Rename \boot\syslinux\isolinux.cfg to syslinux.cfg

* Rebooted my PC and selected boot device as 2GB drive
* Xenserver installation screen appeared, now inserted 16GB stick
* Now pressed F2 to enter shell
* mkdir /tmp/sda command worked
* mount -t ext3 /dev/sda1 /tmp/sda - This did not work as it gave an error/message "mount: wrong fs type, bad option, bad superblock"

I don't know why it was not working, so I gave up this option and rebooted again.

* Instead of pressing F2 and entering shell, I gave F1 to continue installation
* Showed option to install Xenserver. Selected 16GB drive for installation
* Didn't select VM storage option as I planned to give it later
* Gave no to Linux
* Installed xenserver, unplugged 2Gb drive and rebooted
* Xenserver started from my 16GB stick. I saw the Citrix Xenserver (black and blue design screen).
* After 5 seconds, it went black and Win 7 started booting from my hard disk
* Disabled HDD, restarted, Xenserver screen appeared again it rebooted and started from first.

Please help to resolve this issue.

May be Xenserver on USB installation will not be successful without Shell and running the following commands?

mkdir /tmp/sda
mount -t ext3 /dev/sda1 /tmp/sda
chmod -R 664 /sys/block
cp -R /sys/block/ /tmp/sda/sys/block/
chroot /tmp/sda
cd /boot
mv initrd-2.6.18-53.1.13.el5.xs4.1.0.254.273xen.img initrd-2.6.18-53.1.13.el5.xs4.1.0.254.273xen.img.old
mkinitrd --with-usb initrd-2.6.18-53.1.13.el5.xs4.1.0.254.273xen.img 2.6.18-53.1.13.el5.xs4.1.0.254.273xen

If yes, then mount -t ext3 /dev/sda1 /tmp/sda didn't work. This is because I have to boot OS from a CD drive instead of my 2GB pen drive?

Please help!
Avatar of Kerem ERSOY
Kerem ERSOY

Hi,

mount -t ext3 /dev/sda1 /tmp/sda

requires you to have a previously formatted physical volume..  In your case it should be mkfs.ext3. Are you really sure you need to mount the drive before installation ??

Cheers,
K.
If you are trying to mount USB, try type vfat

mount -t vfat

If you are trying to mount CD/DVD, try type iso9660

If it still doesn't work, you can also try type auto
First of all:
- Boot XenServer from the CD
- On the command prompt hit F2
- On the following screen type shell and hit enter
- On the command prompt execute this:

fdisk -l

it should list the existing drivers for you (I'll suggest you to remove your Vista dirve first becasue sometimes installation could disturb the MBR of the first disk and it might be a problem for you to restore it back. But your USSB should lokk like tihs:

/dev/sdc1    *      51     49178      3930176     b    W95 FAT32

So you can't install Xen over FAT32!!.. So remove and recreate:

d
1
n
p
1
a
p

now you have a Linux partition and it should display such as this:


/dev/sdc1    *      1     49177      3934144     83    Linux

w

This will writie and quit.

Now you can format it

mkfs -t ext3 /dev/sdc1


now you can only mount it. I guess you're following the tutorial here: http://community.citrix.com/display/ocb/2009/03/12/Installing+XenServer+on+an+USB+Drive



It is obviously skipped some steps involved.

Cheers,
K.
In fact What I've done was following the document here:

http://www.xenappblog.com/2010/how-to-install-xenserver-5-6-beta-to-external-usb/

- I've launched the system BIOS and added my external driver to the boot order:
CDROM, External, Disk
- Removed disk data connectors..
- Boot to shell as per the document suggests.
- Removed all partitions from the external USB.
- Reboot (not hitting F2).
- Installed XenServer to my USB disk.
- Reboot from the CD hitting F2
- Followed the instructions:
    - mkdir /tmp/sda
    - mount -t ext3 /dev/sda1 /tmp/sda
    - chmod -R 664 /sys/block
upto to this point.

- Then noticed that cp won't go through since the /syys/block does not exist over my USB disk and created it.
    - mkdir -p /tmp/sda/sys/block
    - cp -R /sys/block/ /tmp/sda/sys/block/
    - chroot /tmp/sda
    - cd /boot
    - dir
    - mv initrd-2.6.27.42-0.1.1.xs5.5.901.760.1073xen.img initrd-2.6.27.42-0.1.1.xs5.5.901.760.1073xen.img.old
    - mkinitrd –with-usb initrd-2.6.27.42-0.1.1.xs5.5.901.760.1073xen.img 2.6.27.42-0.1.1.xs5.5.901.760.1073xen
and reboot. Voila!!

Please make sure that the parameter after the mkinitrd is :
- - with - usb   (without spaces: 2 dashes then with and another single dash and usb alltogether without any space)

- My actual versions were different since I've used 5.6FP1


Cheers,
K.



Avatar of basraj

ASKER

Thank you all for your responses.

I have zero knowledge with linux commands hence I'm trying to understand most of the commands. I do not know what ext3 is or what dev/sda1 mean.

Ok we may discuss this later. coming to the point, I followed this document for installing Xenserver

http://community.citrix.com/display/ocb/2009/03/12/Installing+XenServer+on+an+USB+Drive

This user had same requirement as mine as he do not want to wipe off the OS, so he preferred USB.

The reason why I used 2GB USB drive instead  of CD rom is that it didn't boot from CD drive. I'm not sure if I didn't burn the ISO image of Xenserver properly. I have VM workstation and can boot Xenserver using ISO image. When I do the same using CD, it didn't boot. Same if I boot from my physical machine. So I gave up this option and used UNetBootin to boot Xen OS from 2GB stick and instead of hard drive, I used 16GB drive for installing Xen on it.

If you see the above article, 4th paragraph says "This is where the trouble will begin. USB support is not preloaded by the mkinitrd image, by default, which will eventually cause a kernel panic and automatic reboot when XenServer starts."

I could install the Xen OS without going to Shell or typing the commands. Once the installation is complete, Xen boots with a Blue welcome screen showing "Citrix Xenserver" and immediately restarts after that.

So I think it's necessary to go to Shell commands and do some priliminary steps before installing Xen. Now the problem is mount -t doesn't work. May be this is happening as I do from USB to USB? Or will this mount -t command will work if I have bootable Xenserver CD and using 16GB USB drive?
ASKER CERTIFIED SOLUTION
Avatar of Kerem ERSOY
Kerem ERSOY

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of basraj

ASKER

Hi KeremE> Thank you so much for your valuable inputs.

I will try this tonight. I have now downloaded Xenapp 5.6 from the Citrix site now.

This is what I'm going to try tonight. Correct me if am wrong:

1. Copy Xenserver 5.6 TO CD (If CD boot doesn't work will use 2GB pen drive to boot with help of UNetBootin)
2. Format my 16GB USB from Windows (By default it will have FAT32)
2. BIOS setting>boot order> CDROM, External, Disk
3. Removed disk data connectors (or will remove hard drive)
4. Boot the Xen and press F2
5. Enter Shell
6. mkdir /tmp/sda -This will work
7. mount -t ext3 /dev/sda1 /tmp/sda - This may not work, so I will follow your instructions:

fdisk -l

/dev/sdc1    *      51     49178      3930176     b    W95 FAT32

So you can't install Xen over FAT32!!.. So remove and recreate:

d
1
n
p
1
a
p

what is this d,1,n,p,1...? Should I type them when I enter shell and after confirming it's a FAT32?

now you have a Linux partition and it should display such as this:


/dev/sdc1    *      1     49177      3934144     83    Linux

w

This will writie and quit.

Now you can format it

mkfs -t ext3 /dev/sdc1

(Between 7 to 8 point am getting confused, please clear it)

8. chmod -R 664 /sys/block
9. mkdir -p /tmp/sda/sys/block (if it doesn't exist, then will try this step)
10. cp -R /sys/block/ /tmp/sda/sys/block/
11. chroot /tmp/sda
12. cd /boot
13. dir
14. mv initrd-2.6.27.42-0.1.1.xs5.5.901.760.1073xen.img initrd-2.6.27.42-0.1.1.xs5.5.901.760.1073xen.img.old
15. mkinitrd –with-usb initrd-2.6.27.42-0.1.1.xs5.5.901.760.1073xen.img 2.6.27.42-0.1.1.xs5.5.901.760.1073xen
1. Copy Xenserver 5.6 TO CD (If CD boot doesn't work will use 2GB pen drive to boot with help of UNetBootin)
OK
2. Format my 16GB USB from Windows (By default it will have FAT32)
Not Necessary The XenServer would format it
2. BIOS setting>boot order> CDROM, External, Disk
Yeah IF you want to boot from the external disk this is a must.
3. Removed disk data connectors (or will remove hard drive)
Definiely. Just in case !!
- Boot from the CD do the install over USB Stick (you've omitted this before booting to F2)
4. Boot the Xen and press F2
After installtion ends you reboot the system.
5. Enter Shell
OK
6. mkdir /tmp/sda -This will work
OK
7. mount -t ext3 /dev/sda1 /tmp/sda - This may not work, so I will follow your instructions:
OK. The whole trick is copying /sys/block and rebuilding the initrd.

Good Luck.
Avatar of basraj

ASKER

I have successfully installed Xenserver 5.6, though I was able to mount ext3 when working with 5.5 I had some problems to make it boot after installation. But it took more time to boot not sure if it's common for the first time or since am using USB it's slow.

These instructions worked perfectly, i didn't give any extra commands

http://www.xenappblog.com/2010/how-to-install-xenserver-5-6-beta-to-external-usb/