Archive for the ‘Linux’ Category

OpenSolaris in XEN

Saturday, February 9th, 2008

So I took on to put (open)Solaris in a Suse Linux 10.3 Dom0 with xen 3.1 64bit. I made a LOT of silly mistakes along the way, the first and most time wasting mistake was trying to work off the first CD instead of the DVD. The reason this was such a waste of time is because the CD doesn’t come with the 64 bit miniroot(boot_archive) so the kernel cant be loaded properly(look out for panic[cpu0]/thread=d30cfe00: HYPERVISOR_mmu_update() failed) , this wouldnt have been a problem if I was using 32 bit but unfortunately I wasn’t.

The general procedure after you download the DVD is as follows. As I’m using suse they like to bastardise things so it doesn’t come with pygrub, which is needed for a simpler install, so i had to fetch the kernel and the boot archive myself by mounting the ISO loop back and fetching the following files:

mount -o loop /home/dmarkey/sol.iso /mnt
mkdir /xen/solaris

cp /mnt/boot/amd64/x86.miniroot /xen/solaris

cp /mnt//platform/i86xpv/kernel/amd64/unix /xen/solaris

OK so now me have our kernel and our boot archive, now to generate our XEN configuration file.

name = ’solaris’
memory = ‘1024′
disk = [ 'file:/home/dmarkey/sol.iso,6:cdrom,r','file:/home/dmarkey/solaris.disk,0,w' ]
vif = [ 'mac=00:16:3e:00:20:11' ]
on_shutdown = ‘destroy’
on_reboot = ‘restart’
on_crash = ‘destroy’
#root=’/dev/dsk/c0d0s0′
kernel = ‘/xen/solaris/unix’
ramdisk = ‘/xen/solaris/x86.miniroot’
extra = ‘/platform/i86xpv/kernel/amd64/unix -B install_media=cdrom’

Because the boot archive is so bloated, you need a LOT of ram to get it booted, thats why I’m allocating 1024 meg of RAM. So now we have to generate the hard disk file, use something like DD to create a >8G file in /home/dmarkey/solaris.disk or wherever you want to put it, remember to change all the file paths in you configuration. I named this configuration file /xen/solaris/solaris.

So now we should be able to boot, so we do:

xm create -c /xen/solaris/solaris

And fingers crossed we should be able to perform a Solaris setup. When the setup is finished we need to edit the config file. First uncomment the #root=’/dev/dsk/c0d0s0′ line, and then we change the extra line to simply extra = ‘/platform/i86xpv/kernel/amd64/unix’ and you can reduce the amount of ram to 512 if you want.

The performance of Solaris under XEN is i would say near to native. The only problem is that solaris need 512mb of ram to even attempt to boot. This is because of the huge boot_archive (x86.miniroot). In another entry I will go through the steps to make a smaller boot_archive and now my Solaris under Xen will successfully boot with 96M of ram!

LVM progress update

Wednesday, January 16th, 2008

So the resize of /home worked but i couldn’t manage to resize the block device size. So fortunately i had a spare 200gb hard disk, so i made a new volume group and added the new hard disc as a physical volume, i then made two logical volumes on that, one for root and one for home and format them both with reiserfs, the root logical volume i mount on /mnt/tmp and copy the root filesystem with cp -vaRx / /mnt/tmp which seems to work properly, and then the same for root.

My next problem is I cant boot off the lvm because the required kernel modules arent in initrd. so I have to run mkinitrd /dev/system/rootlv from the path of the root file system device it works out what modules are required to allow the kernel to mount the root filesystem. Then /boot/grub/menu.lst has to be updated and /etc/fstab to mount the logical volumes instead of the old physical ones.

Cross your fingers and do an init 6, and hopefully you will have a bootable system off the logical volume.

If your in luck you can now start working on moving the volume group back onto the original hard disks, or in my case the dmraid. I’ll update with that later.

Converting to LVM from standard block devices

Wednesday, January 16th, 2008

Ok, This is going to be a challenge, but I think im up to it. I’m going to convert from using standard linux partitions /dev/sda1 /dev/sda2 etc to an LVM setup, without the need to reinstall. The trouble is I have no free space to put a some physical volume space, so step one is to shrink my 200G /home filesystem to 100G making space for me to copy my root filesystem. So now I have to login as root to be able to unmount /home, and make sure nothing is accessing it. I’m also using dmraid which could complicate the issue.

Because I always use reiserfs I can shrink a partition, it takes time but it does work(crosses fingers).

resize_reiserfs -s -100G /dev/mapper/isw_cggibjcgah_Raid_part6
resize_reiserfs 3.6.19 (2003 www.namesys.com)

You are running BETA version of reiserfs shrinker.
This version is only for testing or VERY CAREFUL use.
Backup of you data is recommended.

Do you want to continue? [y/N]:y
Processing the tree: 0%….20%…. left 14597898, 8996 /sec

This is gonna take a while, will update on my progress tomorrow.


Copyright © 2019 All Rights Reserved.
No computers were harmed in the 0.099 seconds it took to produce this page.

dmarkey.com