[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-users] installing fc6 as domU directly on lv´s - howto




> -----Original Message-----
> From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
> [mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx]On Behalf Of Daniel P.
> Berrange
> Sent: Dienstag, 22. Mai 2007 14:55
> To: Philippe Trolliet
> Cc: Xen-Users
> Subject: Re: [Xen-users] installing fc6 as domU directly on lv´s
> 
> 
> On Tue, May 22, 2007 at 02:41:06PM +0200, Philippe Trolliet wrote:
> > hi,
> > since 2 days i´m trying to install fedora core 6 directly on logical
> > volumes. my host system is FC6 too.
> > i want to have following layout in my domU:
> > /dev/group/ServerRoot               mounted in domU as /
> > /dev/group/ServerVar                mounted in domU as /var
> > /dev/group/ServerSwap               mounted in domU as swap 
> device for the server
> > 
> > my xen-config looks like this:
> > 
> > name = "mailserver-FC6"
> > kernel = "/boot/vmlinuz-2.6.20-1.2948.fc6xen"
> > memory = 512
> > disk = ['phy:VolGroup00/MailserverRoot,sda1,w',
> > 'phy:VolGroup00/MailserverVar,sda2,w',
> > 'phy:VolGroup00/MailserverSwap,sda3,w']
> 
> That isn't going to work - the Anaconda installer will only look for
> block devices, not partitions. Having partitions which are not a part
> of a block device is a Xen driver hack which is not supportable. If 
> you want to have 3 completely separate volumes in the host be visible
> as 3 separate volumes inside the guest, then you can export them as 
> individual devices 'xdva', 'xvdb', 'xvdc'. Then in Anaconda create a 
> single partition on each one, eg  xvda1, xvdb1, xvdc1  which you can 
> then map to /, /var and swap respectively. 
> 

i didn´t use anaconda. i followed these steps from a howto for fc4 and
changed the partitioning stuff according to my logical volume layout:
First, create an image file to use as the storage for our Fedora guest
system. This acts as a virtual hard drive for the guest
system.

1. create the logical volumes on the dom0 and create ext3 filesystems and
swap filesystems on it.

2.  mount partitions according to the layout you want to have:
e.g. later layout on domU:
/dev/group/ServerRoot           mounted in domU as /
/dev/group/ServerVar            mounted in domU as /var
/dev/group/ServerSwap           mounted in domU as swap 

mount /dev/group/ServerRoot /mnt/serverRoot
mount /dev/group/ServerVar /mnt/serverRoot/var

--- snip

        Now for the ugly part. To install a guest system on to the image we
need to set up some basic files on the filesystem of the image
        that have to be different for Xen (and for the system installation
with yum).

        First, create the /dev/ directory on the image with some required
device nodes, since we're not using an initrd4:

        # for i in console null zero ; do /sbin/MAKEDEV -d /mnt/dev -x $i ;
done

        Second, create an /etc/ directory in the image that contains an
/etc/fstab file. For the /etc/fstab file something simple like
        the following should work:

--- snip
        
----------------------------------------------------------------------------
        /dev/sda1       /       ext3    defaults        1 1
        /dev/sda2       /var    ext3    defaults        1 2
        /dev/sda3       swap    swap    defaults        0 0
        none            /dev/pts     devpts  gid=5,mode=620 0 0
        none            /dev/shm     tmpfs   defaults 0 0
        none            /proc        proc    defaults 0 0
        none            /sys         sysfs   defaults 0 0
        
----------------------------------------------------------------------------

--- snip
        Third, make sure /proc/ is mounted inside the image, because of a
bug in the groupadd utility (this is fixed with version 4.0.7-7
of the shadow-utils package):

        # mkdir /mnt/serverRoot/proc
        # mount -t proc none /mnt/serverRoot/proc


        Now we can install whatever base operating system we want.
        If you want to use a local Fedora mirror, then you'll want to
download  this yum.conf and modify it appropriately before using it;
        otherwise, it will point to the default set of mirror Websites.
        Then, decide which package group(s) you want to install. Start with
Base (or for the space constrained, Core, but this is more
difficult).

        Install the guest system with the package groups by running yum. For
example, to install with Base use the command:
--- snip
for FC 6 i created my own yum.conf:

[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
exclude=*-debuginfo
distroverpkg=redhat-release
pkgpolicy=newest
tolerant=1
#exactarch=1
obsoletes=1
gpgcheck=0
reposdir=/dev/null

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

[base]
name=Fedora Core 6 - $basearch - Base
#mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-6
baseurl=http://ftp-stud.fht-esslingen.de/pub/Mirrors/fedora.redhat.com/linux
/core/6/$basearch/os/
enabled=1

[updates-released]
name=Fedora Core 6 - $basearch - Released Updates
#mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc6
baseurl=http://ftp-stud.fht-esslingen.de/pub/Mirrors/fedora.redhat.com/linux
/core/updates/6/$basearch/
enabled=1

--- snip

        # yum -c yum-xen.conf --installroot=/mnt/serverRoot -y groupinstall
Base

--- snip
create a new ramdisk according to the layout of your domU:

mkinitrd -f --with=ext3 --preload=ext3 --with=xennet --builtin=aic7xxx
--builtin=serverworks --preload=xenblk --omit-raid-modules
--omit-lvm-modules --fstab=/mnt/serverRoot/etc/fstab /boot/xen-initrd.img
2.6.20-1.2948.fc6xen

the copy the new initrd to /mnt/serverRoot/boot

--- snip

        Do any other configuration you want to on the filesystem and then
unmount it:

        # umount /mnt/serverRoot/proc
        # umount /mnt/serverRoot

                        Registering a Guest System as a Domain

        Now, we just have to create a configuration file in /etc/xen/. As a
simple example, the following configuration file is /etc/xen/<name>:

        ----------------------------------------------
        name = "mailserver-FC6"
        kernel = "/boot/vmlinuz-2.6.20-1.2948.fc6xen"
        ramdisk = "/boot/xen-initrd.img"
        memory = 512
        disk = ['phy:VolGroup00/MailserverRoot,sda1,w',
'phy:VolGroup00/MailserverVar,sda2,w',
'phy:VolGroup00/MailserverSwap,sda3,w']
        root = "/dev/sda1"
        extra = "ro selinux=0 3"
        vcpus = 1
        vif = [ 'mac=00:16:3e:1a:c5:ad, bridge=xenbr0' ]
        nographic=1
        -----------------------------------------------

        Now, create a new domain:

        # xm create -c /etc/xen/<name>

END of HOWTO

is the way described in the howto correct?

this worked for me but i don´t know how to set the root password... i
mounted and chrooted into the domU´s partition and tried to change the
password but it didn´t work. i also tried to overwrite /etc/shadow and
/etc/shadow-. when i try to execute passwd in the chroot i get following
error message:
Changing password for user root.
passwd: Authentication token manipulation error

regards
philippe


-- 
I am using the free version of SPAMfighter for private users.
It has removed 6509 spam emails to date.
Paying users do not have this message in their emails.
Get the free SPAMfighter here: http://www.spamfighter.com/len

<<attachment: winmail.dat>>

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.