Jump to: navigation, search

How to create a Scientific Linux 3 rootfilesystem starting from a SLC3 Xen image


Download SLC3 image from

Copy the original rootfs image to a new file, mount it and chroot to it:

cp slc3_root_04.img slc3_root_04.img-v1
mount -o loop slc3_root_04.img-v1 /mnt/
chroot /mnt/

Create /mnt/vnuml directory and umlboot link:

mkdir /mnt/vnuml
ln -s /mnt/vnuml/umlboot /etc/rc.d/rc3.d/S11bootuml

Edit /etc/fstab and include:

 /dev/ubda / ext3 defaults 0 1
 /dev/ubdb /mnt/vnuml iso9660 defaults 0 0

and comment entries about /dev/sda1 and /dev/hda5.

Edit /etc/defaults/ssh and add:


Create the /dev/ubd[a-h] nodes using the script (see the complete script below taken from

vi /tmp/
chmod +x /tmp/ 
cd /dev/

Edit /etc/inittab and create a new tty entry:

0:2345:respawn:/sbin/mingetty tty0

also comment tty3-6 entries.

Edit /etc/ssh/sshd_config to allow root access through ssh:

PermitRootLogin yes

Change root password (set it to "xxxx"):


Edit /etc/securetty and add tty0 to allow root login through the xterm console.

Exit form chroot and install kernel modules:

cd /mnt/lib/modules/
tar xfv /usr/local/share/vnuml/kernels/src/linux-

Unmount the filesystem:

umount /mnt

Create a test scenario slc3.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd">
    <vm_mgmt type="private" network="" mask="24">
       <host_mapping />
       <filesystem type="cow">/usr/local/share/vnuml/filesystems/slc3_root_04.img-v1</filesystem>
       <console id="0">xterm</console>

  <!-- NODES -->
  <vm name="host1">


and test it: -t sl3.xml -v -u root -Z -w 120

Access the host via slogin (root access from the xterm does not work by now):

slogin host1 -l root

Updating the filesystem

To be able to update the filesystem from the network, you can use a virtual virtual scenario with network connectivity using a NAT in the host.

Copy this scenario to a file named slc3n.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd">

    <vm_mgmt type="none"/>
       <console id="0">xterm</console>

  <net name="Net0" mode="uml_switch"/>

  <vm name="vm1">
    <filesystem type="direct">/usr/local/share/vnuml/filesystems/slc3_root_04.img-v1</filesystem>
    <if id="1" net="Net0">
     <ipv4 mask=""></ipv4>
    <route type="ipv4" gw="">default</route>

    <hostif net="Net0">
       <ipv4 mask=""></ipv4>


On the host execute the following commands (eth0 is the name of the network interface with Internet connectivity):

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

Start the scenario: -t slc3n.xml -v -u root -Z -w 120

Login to the virtual machine and check network connectivity (you'll have to configure a dns server in /etc/resolv.conf).


Use "chkconfig --off servicename" to disable services on start script

for u in a b c d e f g h
        do dev=$device$u
        mknod $dev b $major $minor
        chmod 660 $dev
        chgrp disk $dev
        for i in $(seq 1 15)
                mknod $dev$i b $major $(($minor + $i)) 
                chmod 660 $dev$i
                chgrp disk $dev$i
        minor=$(($minor + 16))