Restore the Porta-Switch from tar files installation on LVM partitions and from Fedora partition

[]

Updated by David Gómez

2011-12-15

Created by Emin Gabrielyan

2010-09-24

 

 

Table of contents:

Restore the Porta-Switch from tar files installation on LVM partitions and from Fedora partition  1

1.     Introductions. 2

2.     Overview of a Volume Group. 3

3.     Partitioning the physical disk. 5

4.     Creating the volume group and its logical partitions. 7

4.1.       Create the volume group. 7

4.2.       Choice of the Porta-Switch Volume Group name depending on the server 9

4.3.       Creating the logical volumes 12

5.     Formatting the partitions. 15

5.1.       Porta-Switch. 15

5.2.       Fedora 15 x86_64. 16

6.     Mounting the partitions. 23

7.     Configure the network on Live CD system.. 24

8.     Download the tar files. 25

8.1.       Downloading the tar files from the web. 25

8.2.       Downloading the tar files from the ssh location. 26

9.     Extract the contents of tar files. 26

10.       Configure the boot loader 26

11.       Configured network at first boot 28

11.1.     Correctly configure network scripts 29

11.2.     Create a script and run it during the server booting. 30

12.       Replace the initial ram disk files of the Fedora boot partition. 31

12.1.     Download and replace initrd files of the kernel 31

12.2.     The initrd files of 4 servers 32

12.3.     Dismount the partitions and reboot 36

13.       After booting from the hard drive. 36

13.1.     Porta-SIP services do not start 37

13.2.     Check the swap allocation. 38

14.       Download locations. 38

14.1.     switzernet.com.. 38

14.2.     ssh connection. 39

14.3.     Initial RAM disk files for the LVM version. 40

15.       References. 41

16.       Annex: Glossary of conventions. 42

17.       Annex: the field formulas used in this document 43

17.1.     Auto-incrementing reference numbers 43

17.2.     Deleting the auto-incrementing bookmark before printing. 44

17.3.     Styles 45

 

1.       Introductions

 

We already presented how to create backup tar files from an installed and configured porta-switch system consisting of several servers [101] [102] [103]. The porta-switch system installed from DVD installers [104] is not functional immediately. A post-install configuration and upgrade procedure must be carried out by the porta-one team. Once a functional system is obtained, a full backup is mandatory. The porta-switch system consists of 4 machines, configurator, billing master, slave, and porta-sip. The system which we backed up into tar files (see section 15) was installed on an 8 IP address subnet 212.xxx.xxx.104/xx with a default gateway 212.xxx.xxx.105. The IP addresses are associated to the 4 servers as follows [105] [106] [107]:

 

·         212.xxx. xxx.106 billing1.switzernet.com, configurator

·         212.xxx. xxx.108 billing2.switzernet.com, billing master

·         212.xxx. xxx.109 billing3.switzernet.com, billing web server

·         212.xxx. xxx.110 billing4.switzernet.com, SIP server

 

In our previous document we showed how to create primary partitions using the fdisk tool and then how-to restore the contents of the tar files onto these partitions. Each of the porta-one servers uses originally 5 partitions: boot, root1, root2, porta, and swap. On the other hand, the hard disk supports at most 4 primary partitions. The previous installation method was based on the idea that the root1 partition can be skipped as porta-one uses two root partitions uniquely for its upgrade and rollover procedures [108]. As far as no upgrades are assumed, the system is functional with only one root partition. For a full and long-term functionality however, all 5 partitions are required. In this document we mimic the disk management used in the original RHEL installations of porta-one servers [109]. In the initial version of RHEL, the disks are partitioned using the Logical Volume Manager (LVM) [110]. The LVM, being an intermediary layer between the disk and the file system permits a more flexible and manageable partitioning. With LVM it is possible to have more than 4 partitions, one can create a large virtual data volume spanned over more than one physical drive, and the partitions are resizable on the fly.

 

The rest of this document contains step-by-step instructions on how to prepare and restore a system on a brand new computer, and boot from it.

 

2.       Overview of a Volume Group

 

When using an LVM, instead of dealing with a physical hard drive, we work with a uniform volume group. Such a single uniform volume group can be formed in fact from one or several hard drives, or from one or several partitions of the same or different hard drives. Once the volume group is created, irrespectively of its underlying complexity, it can be considered as a single and uniform virtual drive. It can be partitioned flexibly and resizable into logical volumes.

 

The following printout of the vgdisplay command shows the state of the LVM of a restored system. Here we see one volume group VolGroup00 which is partitioned into 4 logical volumes, LogVol00, LogVol01, LogVol02, and LogVol03. In this installation the VolGroup00 occupies one large primary partition of the physical hard drive.

 

# vgdisplay -v 2> /dev/null | egrep "^ *(LV|VG) (Size|Name)"

  VG Name               VolGroup00

  VG Size               463.75 GB

 

  LV Name                /dev/VolGroup00/LogVol00

  VG Name                VolGroup00

  LV Size                19.53 GB

 

  LV Name                /dev/VolGroup00/LogVol01

  VG Name                VolGroup00

  LV Size                19.53 GB

 

  LV Name                /dev/VolGroup00/LogVol03

  VG Name                VolGroup00

  LV Size                31.25 GB

 

  LV Name                /dev/VolGroup00/LogVol02

  VG Name                VolGroup00

  LV Size                393.44 GB

[root@billing4 ~]#

 

Here are notes on the volume group taken from the original installation:

 

  LV Name                /dev/VolGroup00/LogVol00

  VG Name                VolGroup00

  LV Size                20.00 GiB

 

  LV Name                /dev/VolGroup00/LogVol01

  VG Name                VolGroup00

  LV Size                20.00 GiB

 

  LV Name                /dev/VolGroup00/LogVol02

  VG Name                VolGroup00

  LV Size                402.91 GiB

 

  LV Name                /dev/VolGroup00/LogVol03

  VG Name                VolGroup00

  LV Size                2.75 GiB

 

The command pvdisplay shows the details of the drive participating in a formation of a logical volume. The following printout is obtained on a restored system.

 

# pvdisplay /dev/hda2

  --- Physical volume ---

  PV Name               /dev/hda2

  VG Name               VolGroup00

  PV Size               463.75 GB / not usable 2.34 MB

  Allocatable           yes (but full)

  PE Size (KByte)       4096

  Total PE              118720

  Free PE               0

  Allocated PE          118720

  PV UUID               pEXlFJ-twpP-ozv3-8H0j-7IzI-H6Qg-DwdZUL

 

#

 

The following record shows that on the original system the PE Size was different. This parameter, standing for Physical Extent) [111], specifies the granularity of the volume and for our purposes, does not play any significant role.

 

# pvdisplay /dev/sda2

  PV Name               /dev/sda2

  VG Name               VolGroup00

  PE Size               32.00 MiB

 

In all our current installations the single physical disk is partitioned into two primary partitions. The first physical partition is small and is reserved for booting. The second primary disk partition occupying the rest of the space, is allocated to one logical volume group, hosting 4 logical volumes dedicated for root1, root2, swap, and porta partitions respectively.

 

# fdisk /dev/sda

 

Command (m for help): p

 

Disk /dev/sda: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1         262     2104483+  83  Linux

/dev/sda2             263       60801   486279517+  8e  Linux LVM

 

Command (m for help): q

 

#

 

3.       Partitioning the physical disk

 

In this section we show how to start the preparation of a computer hard drive on which a clone of a system must be restored from a set of its tar files. Also, we will do the partitions that we need to install Fedora 15 x86_64 Live CD in the hard disk. Note, that after the completion of instructions of this section, all data on the host computer will be definitively lost.

 

Boot from Fedora 15 x86_64 Live CD [112] [113]. Open a terminal window and enter into root mode.

 

The following notes will guide you how to delete the existing partitions (if any), and create three new partitions, one small for the boot, and two for LVM. You must find the name of the device file corresponding to the hard drive of your computer. In this example the device file name of the hard drive is /dev/sda which must not be necessarily the same also for your computer.

 

# fdisk /dev/sda

p

d

d

...

n (new)

 p (primary)

  1 (partition)

First cylinder...: <return>

Last cylinder...: +2G

p

n (new)

 p (primary)

  2 (partition)

First cylinder...: <return>

Last cylinder...: +50G

p

n (new)

 p (primary)

  3 (partition)

First cylinder...: <return>

Last cylinder...: <return> (full space)

p

 

While still in fdisk tool alter the first partition into a bootable one:

 

a

1

p

 

While still in fdisk set the type of the 2nd and 3rd partition to LVM:

 

t (change a partition's system id)

 2 (partition)

  8e (system id code: lvm)

P

T (change a partition's system id)

 3 (partition)

  8e (system id code: lvm)

p

 

Write/apply the changes, exit from fdisk tool, and reboot the system (boot back from Live CD):

 

w

# reboot

 

If you got warning the first time when writing and exiting from the fdisk tool, after the reboot (again from the Live CD), you must not have warnings anymore when entering into the fdisk tool and exiting from it with the w command.

 

# fdisk /dev/sda

p

w

#

 

The output of your fdisk command shall look similarly to the printout shown below with possible exceptions concerning the exact sizes and the dive file names.

 

# fdisk /dev/sda

...

Command (m for help): p

...

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *        2048     4196351     2097152+  83  Linux

/dev/sda2         4196352   109053951    52428800+  8e  Linux LVM

/dev/sda3       109053951   976773167   433859608+  8e  Linux LVM

 

Command (m for help): q

 

#

 

You are now ready to install Fedora 15 x86_64 in the 2nd LVM partition and to allocate the device file of the 3rd partition of the hard drive to the logical volume manager (LVM).

 

4.       Creating the volume group and its logical partitions

 

4.1.  Create the volume group

 

First, with the pvcreate command, allow the device for a possible usage by the LVM. You can prepare several such devices, but in our example the volume group will use only one device.

 

# pvcreate /dev/sda2

# pvcreate /dev/sda3

 

Once the device is prepared for the possible usage by the LVM, you can display its status with pvdisplay command.

 

# pvdisplay /dev/sda2

  --- NEW Physical volume ---

  PV Name               /dev/sda2

  VG Name              

  PV Size               50.00 GiB

  Allocatable           NO

  PE Size               0

  Total PE              0

  Free PE               0

  Allocated PE          0

  PV UUID               ...

 

# pvdisplay /dev/sda3

  --- NEW Physical volume ---

  PV Name               /dev/sda3

  VG Name              

  PV Size               413.76 GiB

  Allocatable           NO

  PE Size               0

  Total PE              0

  Free PE               0

  Allocated PE          0

  PV UUID               ...

 

#

 

For the moment the physical device is not yet allocated to a volume group. When the physical device is allocated to a volume group, the output of pvdisplay looks as follows:

 

# pvdisplay /dev/sda2

  --- Physical volume ---

  PV Name               /dev/sda2

  VG Name               VolGroup02

  PV Size               50.00 GiB / not usable 4.00 MB

  Allocatable           yes (but full)

  PE Size               4.00 MiB

  Total PE              12799

  Free PE               0

  Allocated PE          12799

  PV UUID               pEXlFJ-twpP-ozv3-8H0j-7IzI-H6Qg-DwdZUL

 

# pvdisplay /dev/sda3

  --- Physical volume ---

  PV Name               /dev/sda3

  VG Name               VolGroup00

  PV Size               413.76 GiB / not usable 3.02 MB

  Allocatable           yes (but full)

  PE Size               4.00 MiB

  Total PE              105922

  Free PE               0

  Allocated PE          105922

  PV UUID               3pdB0n-KzPx-E7Rk-sZ78-1iA1-e0Ae-4NaBLc

 

#

 

Now create a volume group with vgcreate command listing as arguments all physical devices. In our example, we use two physical devices. The first argument (VolGroup00 in the below note) is the name of the volume group being created.

 

# vgcreate VolGroup00 /dev/sda3

Volume group "VolGroup00" successfully created

#

 

Depending on the server being restored (billing1, billing2, billing3, or billing4), a different name might be indicated while creating the volume group. The name must match the volume group name used in /etc/fstab file of the system being restored (see the section 4.2 that comes next).

 

We proceed the same way for the other physical device (in this case we choose the name VolGroup02 to avoid problems with the Porta-Switch volume group’s names).

 

# vgcreate VolGroup02 /dev/sda2

Volume group "VolGroup02" successfully created

#

 

4.2.  Choice of the Porta-Switch Volume Group name depending on the server

 

In order to correctly choose the name of the volume group for Porta-Switch, we show in this section the fstab files extracted from tar files of each root partition of each server:

 

$ for b in 1 2 3 4; do for r in 1 2; do tar -C b$b-r$r -xjvf …data1/*billing$b,root$r.tar.bzip2 ./etc/fstab; done; done

./etc/fstab

./etc/fstab

./etc/fstab

./etc/fstab

./etc/fstab

./etc/fstab

./etc/fstab

./etc/fstab

 

$ ls b?-r?/etc/fstab

b1-r1/etc/fstab  b2-r1/etc/fstab  b3-r1/etc/fstab  b4-r1/etc/fstab

b1-r2/etc/fstab  b2-r2/etc/fstab  b3-r2/etc/fstab  b4-r2/etc/fstab

 

$ u2d b?-r?/etc/fstab

b1-r1/etc/fstab: done.

b1-r2/etc/fstab: done.

b2-r1/etc/fstab: done.

b2-r2/etc/fstab: done.

b3-r1/etc/fstab: done.

b3-r2/etc/fstab: done.

b4-r1/etc/fstab: done.

b4-r2/etc/fstab: done.

 

$

 

The fstab file of the root1 partition of each server shows that the billing1, billing2, and billing3 servers use the name VolGroup01, while billing4 server uses VolGroup00 as the name of its LVM volume group:

 

$ for f in b?-r1/etc/fstab; do echo; echo [$f]; cat $f; done

 

[b1-r1/etc/fstab]

/dev/VolGroup01/LogVol00 /                       ext3    defaults        1 1

/dev/VolGroup01/LogVol02 /porta_var              ext3    defaults        1 2

/dev/VolGroup01/LogVol01 /update_root            ext3    defaults        1 2

LABEL=/boot             /boot                   ext3    defaults        1 2

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

/dev/VolGroup01/LogVol03 swap                    swap    defaults        0 0

 

[b2-r1/etc/fstab]

/dev/VolGroup01/LogVol00 /                       ext3    defaults        1 1

/dev/VolGroup01/LogVol02 /porta_var              ext3    defaults        1 2

/dev/VolGroup01/LogVol01 /update_root            ext3    defaults        1 2

LABEL=/boot             /boot                   ext3    defaults        1 2

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

/dev/VolGroup01/LogVol03 swap                    swap    defaults        0 0

 

[b3-r1/etc/fstab]

/dev/VolGroup01/LogVol00 /                       ext3    defaults        1 1

/dev/VolGroup01/LogVol02 /porta_var              ext3    defaults        1 2

/dev/VolGroup01/LogVol01 /update_root            ext3    defaults        1 2

LABEL=/boot             /boot                   ext3    defaults        1 2

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

/dev/VolGroup01/LogVol03 swap                    swap    defaults        0 0

 

[b4-r1/etc/fstab]

/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1

/dev/VolGroup00/LogVol01 /update_root            ext3    defaults        1 2

/dev/VolGroup00/LogVol02 /porta_var              ext3    defaults        1 2

LABEL=/boot             /boot                   ext3    defaults        1 2

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

/dev/VolGroup00/LogVol03 swap                    swap    defaults        0 0

 

$

 

The same naming of volume groups appears also in the /etc/fstab files of the root2 partition of each server (billing1, billing2, billing3, and billing4). The root2 partition is the one used currently by all servers as the main root / directory.

 

The only difference between the /etc/fstab files of the root1 and root2 partitions is that the logical volumes behind the root / and the /update_root directories are swapped. The fstab of VolGroup00 mounts itself as root /, and similarly the fstab of VolGroup01 mounts itself as root / and VolGroup00 as /update_root. Whether the system at its boot will switch the control to LogVol00 or to LogVol01 depends only on the data accompanying the kernel in the boot partition. The boot partition is backed up in the set of the tar files, so the booting comportment of the original system will be restored without changes.

 

$ for f in b?-r2/etc/fstab; do echo; echo [$f]; cat $f; done

 

[b1-r2/etc/fstab]

/dev/VolGroup01/LogVol01 /                       ext3    defaults        1 1

/dev/VolGroup01/LogVol02 /porta_var              ext3    defaults        1 2

/dev/VolGroup01/LogVol00 /update_root            ext3    defaults        1 2

LABEL=/boot             /boot                   ext3    defaults        1 2

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

/dev/VolGroup01/LogVol03 swap                    swap    defaults        0 0

 

[b2-r2/etc/fstab]

/dev/VolGroup01/LogVol01 /                       ext3    defaults        1 1

/dev/VolGroup01/LogVol02 /porta_var              ext3    defaults        1 2

/dev/VolGroup01/LogVol00 /update_root            ext3    defaults        1 2

LABEL=/boot             /boot                   ext3    defaults        1 2

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

/dev/VolGroup01/LogVol03 swap                    swap    defaults        0 0

 

[b3-r2/etc/fstab]

/dev/VolGroup01/LogVol01 /                       ext3    defaults        1 1

/dev/VolGroup01/LogVol02 /porta_var              ext3    defaults        1 2

/dev/VolGroup01/LogVol00 /update_root            ext3    defaults        1 2

LABEL=/boot             /boot                   ext3    defaults        1 2

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

/dev/VolGroup01/LogVol03 swap                    swap    defaults        0 0

 

[b4-r2/etc/fstab]

/dev/VolGroup00/LogVol01 /                       ext3    defaults        1 1

/dev/VolGroup00/LogVol00 /update_root            ext3    defaults        1 2

/dev/VolGroup00/LogVol02 /porta_var              ext3    defaults        1 2

LABEL=/boot             /boot                   ext3    defaults        1 2

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

/dev/VolGroup00/LogVol03 swap                    swap    defaults        0 0

 

$

 

Examine the /etc/fstab files shown above to create your volume group with a correct name. This doc is continued on the example of billing4 server.

 

4.3.  Creating the logical volumes

 

Once the volume group is created you can find out the space available in the volume group with the vgdisplay command:

 

# vgdisplay VolGroup00

  VG Name               VolGroup00

  Format                lvm2

  VG Size               413.76 GiB

  PE Size               4.00 MiB

  Total PE              105922

# vgdisplay VolGroup02

  VG Name               VolGroup02

  Format                lvm2

  VG Size               50.00 GiB

  PE Size               4.00 MiB

  Total PE              12799

#

 

Create now the logical volumes:

 

·         Fedora 15 x86_64: we create root, home and swap partitions by allocating 21GB per root (LogVol00) and home (LogVol01) respectively, and 8GB per swap (LogVol02)

·         Porta-Switch: we create root1, root2, porta, and swap partitions by allocating about 20GB per root1 (LogVol00) and root2 (LogVol01) respectively, about 32GB to swap (LogVol03), and the rest to porta partition (LogVol02)

 

The argument of the option -l is the number of physical extents. The number of available physical extents is displayed as “Total PE” in the output of vgdisplay command shown above. The same output shows also that the size of physical extent is of 4 MB (see PE Size). Therefore, 2047 extents will give us approximately 8GB of space, 5376 extents give us approximately 21 GB, 5000 extents give us approximately 20 GB and 8000 extents, approximately 32 GB.

 

# lvcreate -l 5376 VolGroup02 -n LogVol00

# lvcreate -l 5376 VolGroup02 -n LogVol01

# lvcreate -l 2047 VolGroup02 -n LogVol02

#

# lvcreate -l 5000 VolGroup00 -n LogVol00

# lvcreate -l 5000 VolGroup00 -n LogVol01

# lvcreate -l 8000 VolGroup00 -n LogVol03

# lvcreate -l 87922 VolGroup00 -n LogVol02

 

The total number of extents must be equal to the total number of available extents shown by vgdisplay command:

 

·         Vgdisplay VolGroup02 : 2047+5376+5376=12799

·         Vgdisplay VolGroup00 : 5000+5000+8000+87922=105922

 

For Porta-Switch, instead of computing the extents in advance, you can first allocate the spaces of 20GB, 20GB, and 32GB of all small partitions (root1, root2, and swap) to LogVol00, LogVol01 and LogVol03 in VolGroup00 respectively. Then only, you can check with vgdisplay the number of remaining extents (Free PE) that we have in VolGroup00 in order to allocate all of them to LogVol02, for the largest partition porta.

 

 

# vgdisplay VolGroup00

...

  Free  PE / Size       87922 / 343.44 GiB

...

# lvcreate -l 87922 VolGroup00 -n LogVol02

 

 

After allocation the vgdisplay output shall look as follows:

 

# vgdisplay VolGroup00

  --- Volume group ---

  VG Name               VolGroup00

  System ID

  Format                lvm2

  Metadata Areas        1

  Metadata Sequence No  5

  VG Access             read/write

  VG Status             resizable

  MAX LV                0

  Cur LV                4

  Open LV               4

  Max PV                0

  Cur PV                1

  Act PV                1

  VG Size               413.76 GiB

  PE Size               4.00 MiB

  Total PE              105922

  Alloc PE / Size       105922 / 413.75 GiB

  Free  PE / Size       0 / 0

  VG UUID               S3x5DA-93re-2h6a-m6y7-ToJe-6buA-3bJRoJ

 

# vgdisplay VolGroup02

  --- Volume group ---

  VG Name               VolGroup02

  System ID

  Format                lvm2

  Metadata Areas        1

  Metadata Sequence No  4

  VG Access             read/write

  VG Status             resizable

  MAX LV                0

  Cur LV                3

  Open LV               3

  Max PV                0

  Cur PV                1

  Act PV                1

  VG Size               50.00 GiB

  PE Size               4.00 MiB

  Total PE              12799

  Alloc PE / Size       12799 / 50.00 GiB

  Free  PE / Size       0 / 0

  VG UUID               rgz13D-ChXS-BGxf-yo0w-RNnk-OM0w-8ABDN9

 

#

 

Once the logical volumes are created, you will see in the /dev directory a folder of the name of the volume group (VolGroup00 and VolGroup02 in our case) containing files (or symbolic links) with the names of logical volumes (LogVol00, LogVol01,… ):

 

#

# ls /dev/VolGroup00/

LogVol00  LogVol01  LogVol02  LogVol03

# ls /dev/VolGroup02/

LogVol00  LogVol01  LogVol02

#

 

The files /dev/VolGroup00/LogVol00, etc, are block devices (or links to block devices) and can be treated (for example by disk formatting tools) similarly to a hard disk partition device.

 

5.       Formatting the partitions

 

After allocation of the extents of the volume group, we now have a primary disk partition for boot and seven logical volumes (four in VolGroup00 and three in VolGroup02). They must be formatted.

 

5.1.  Porta-Switch

 

In order to format the Porta-Switch’s logical volumes, we proceed as the example below:

 

# mkfs –t ext3 /dev/VolGroup00/LogVol00

# mkfs –t ext3 /dev/VolGroup00/LogVol01

# mkfs –t ext3 /dev/VolGroup00/LogVol02

# mkswap /dev/VolGroup00/LogVol03

# mkfs –t ext3 /dev/sda1

 

The /etc/fstab files provided in section 4.2 show that the boot partition is mounted using the label “LABEL=/boot  /boot” instead of the device file name such as “/dev/sda1  /boot”. The use of labels makes the /etc/fstab file less dependent from the names of the device files (a subject of change from machine to machine).

 

Associate the label “/boot” to the boot partition with the following command:

 

# e2label /dev/sda1 /boot

 

5.2.  Fedora 15 x86_64

 

After format all the Porta-Switch’s logical volumes and the primary boot partition, we are going to format and prepare the installation for Fedora 15 x86_64, so we launch the Fedora install assistant.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Once the install assistant is launched we proceed as the following screens show:

 

 

 

 

Next screen configuration should be complete according with the location of the server:

 

 

At this step, we have to choose “Create Custom Layout” option because we need to specify in which partitions we want to install Fedora.

 

 

 

 

 

 

 

 

 

 


Next screenshot show us how we have partitioned the disk. We should find the Fedora’s volume group (VolGroup02) inside the partition layout. As we can see, the logical partitions that owns to VolGroup02 have an “Unknown” format type.

 

 

 

 

 

 

 

 

 

 

 

 


We choose each logical volume group (volume group always inside the VolGroup02):

 

 

 

 

 


And edit it:

 

 

 

 

 

 


For the first and the second logical volume group (root and home partition respectively) we choose the following parameters:

 

 

 

 

 

 

 

 

 

 


For the third and last logical volume group partition (swap partition) we choose the following parameters:

 

 

 

 

 

 

 

 

 

At the end, we should see a partition layer like the following:

 

 

 

 

 

 

 

 

 

 


If we proceed with the installation, we will get an error message. It is because we don’t have assigned a boot partition despite we have one.

 

 

So we choose our boot partition /dev/sda1 and configure it like that:

 

 

 

 

 

 

 

 

 

 


Finally, we will see a layout like shows the figure below:

 

 

 

 

 

 


Now we click on “Next” button again and proceed with the format of the logical volume groups:

 

 

We apply the changes to the disk:

 

 

And then we install the boot loader on /dev/sda. At this point we can choose or not to install the boot loader, because anyway we will install and configure the Grub manually later (configure the boot loader).

 

 

Finally, we have been complete the installation successfully.

 

 

Before reboot the server as suggest the last message we follow the next chapters of this manual in order to complete the Porta-Switch installation

 

In order to complete the Porta-Switch installation, we should check the volume groups in /dev. Just in case we aren’t able to find them we need to proceed as follow:

 

# vgscan

# vgchange –ay VolGroup00

# vgchange –ay VolGroup02

 

We will get the following output:

 

# vgscan

  Reading all physical volumes. This may take a while…

  Found volume group “VolGroup00” using metadata type lvm2

  Found volume group “VolGroup02” using metadata type lvm2

# vgchange –ay VolGroup00

  4 logical volume(s) in volume group “VolGroup00” now active

# vgchange –ay VolGroup02

  3 logical volume(s) in volume group “VolGroup02” now active

 

6.       Mounting the partitions

 

As the partitions are all formatted, you can now mount them as follows:

 

# cd /mnt

# mkdir boot

# mkdir root1

# mkdir root2

# mkdir porta

# mount /dev/sda1 boot

# mount /dev/VolGroup00/LogVol00 root1

# mount /dev/VolGroup00/LogVol01 root2

# mount /dev/VolGroup00/LogVol02 porta

# df

 

On a restored system the output of the df command looks as follows:

 

# df

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/mapper/VolGroup00-LogVol01

                      20158332   2896332  16238000  16% /

/dev/mapper/VolGroup00-LogVol00

                      20158332   2798968  16335364  15% /update_root

/dev/mapper/VolGroup00-LogVol02

                     406074960   2427000 383020504   1% /porta_var

/dev/hda1              2071384     81464   1884696   5% /boot

tmpfs                  1011792         0   1011792   0% /dev/shm

#

 

7.       Configure the network on Live CD system

 

In order to configure network services while we still running within the OS of the Live CD, we have two options:

 

·         Use the network assistant, that configure automatically our network card

·         Use the command line in order to create manually the network files that the system need to configure the network card

 

If we choose the second option, we should use an IP address of the subnet that is unused (we can check it with the ping command) to configure the network.  This way we will avoid any eventual conflicts with running servers billing1, billing2, billing3, and billing4. The following commands must be typed in super user mode.

 

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

 

DEVICE=eth0

BOOTPROTO=static

BROADCAST=212.xxx.xxx.xxx

IPADDR=212.xxx.xxx.xxx

HWADDR=xx:xx:xx:xx:xx:xx

NETMASK=255.xxx.xxx.xxx

NETWORK=212.xxx.xxx.xxx

ONBOOT=yes

TYPE=Ethernet

 

# vi /etc/sysconfig/network-scripts/ route-eth0

 

0.0.0.0/0 via 212.xxx.xxx.xxx

 

#  vi /etc/resolv.conf

 

nameserver 212.xxx.xxx.xxx

 

# service network restart

# ping google.com

 

Upon this setup you must be able to ping Google by its name.

 

8.       Download the tar files

 

Note that all examples below correspond to the billing4 server (the SIP server). You must adapt your execution to the server currently being installed by yourself.

 

8.1.  Downloading the tar files from the web

 

The next commands allow us to download the tar files from the Switzernet web site into the right folder in the server:

 

# cd /mnt/boot

# wget --http-user=xxxx --http-password=xxxx http://switzernet.com/3/company/111206-tar-pb-mr23/data1/111202,1810,billing4,boot.tar.bzip2

 

# cd /mnt/root1

# wget --http-user=xxxx --http-password=xxxx http://switzernet.com/3/company/111206-tar-pb-mr23/data1/111202,1810,billing4,root1.tar.bzip2

 

# cd /mnt/root2

# wget --http-user=xxxx --http-password=xxxx http://switzernet.com/3/company/111206-tar-pb-mr23/data1/111202,1810,billing4,root2.tar.bzip2

 

# cd /mnt/porta

# wget --http-user=xxxx --http-password=xxxx http://switzernet.com/3/company/111206-tar-pb-mr23/data1/111202,1810,billing4,porta.tar.bzip2

 

After download all the files we should check their integrity:

 

# cd /mnt

# wget --http-user=xxxx --http-password=xxxx http://switzernet.com/3/company/111206-tar-pb-mr23/data1/111202,md5sum-localhost,billing4.txt

 

8.2.  Downloading the tar files from the ssh location

 

Also, we can download the tar files throw a ssh connection from other location (212.xxx.xxx.108).

 

# scp –c blowfish xxxx@212.xxx.xxx.108:/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing4,boot.tar.bzip2 /mnt/boot

 

# scp –c blowfish xxxx@212.xxx.xxx.108:/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing4,root1.tar.bzip2 /mnt/root1

 

# scp –c blowfish xxxx@212.xxx.xxx.108:/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing4,root2.tar.bzip2 /mnt/root2

 

# scp –c blowfish xxxx@212.xxx.xxx.108:/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing4,porta.tar.bzip2 /mnt/porta

 

As usual, after download the files we have to check their integrity.

 

# scp –c blowfish xxxx@212.xxx.xxx.108/share/MD0_DATA/porta-billing-mr23/tar/111202,md5sum-localhost,billing4.txt /mnt

 

9.       Extract the contents of tar files

 

Extract the tar files into their respective partitions, as shown in the notes below:

 

# cd /mnt/boot

# tar –xjvf 111202,1810,billing4,boot.tar.bzip2

#

# cd /mnt/root1

# tar –xjvf 111202,1810,billing4,root1.tar.bzip2

#

# cd /mnt/root2

# tar –xjvf 111202,1810,billing4,root2.tar.bzip2

#

# cd /mnt/porta

# tar –xjvf 111202,1810,billing4,porta.tar.bzip2

#

 

10. Configure the boot loader

 

Install the grub boot loader. Pay attention to use device filenames corresponding to your hard drive and its boot partition. In this example the device /dev/sda corresponds to the entire hard disk and /dev/sda1 to its boot partition.

 

# cd /mnt/boot

# grub-install --root-directory=/mnt/boot /dev/sda

# grub-install --root-directory=/mnt/boot /dev/sda1

 

Follow the notes below:

 

# cd /mnt/boot

# grub

grub> root

grub> root (hd0,0)

grub> setup (hd0,0)

grub> setup (hd0)

grub> quit

#

 

Create a hard link:

 

# ln /mnt/boot/grub/grub.conf /mnt/boot/boot/grub/grub.conf

#

 

List the /boot directory and edit the Grub menu:

 

# ls /mnt/boot/

111202,1810,billing2,boot.tar.bzip2

Boot

config-2.6.18-164.0.0.0.1.el5

config-2.6.38.6-26.rc1.fc15.x86_64

efi

elf-memtest86+-4.10

grub

initramfs-2.6.38.6-26.rc1.fc15.x86_64.img

initrd-2.6.18-164.0.0.0.1.el5.img

initrd-plymouth.img

lost+found

memtest86+-4.10

symvers-2.6.18-164.0.0.0.1.el5.gz

System.map-2.6.18-164.0.0.0.1.el5

System.map-2.6.38.6-26.rc1.fc15.x86_64

vmlinuz-2.6.18-164.0.0.0.1.el5                                                                                                 vmlinuz-2.6.38.6-26.rc1.fc15.x86_64

#

 

# vi /mnt/boot/grub/menu.lst

 

When we have finished the edition of the file we should have something like that:

 

# grub.conf generated by anaconda

#

# Note that you do not have to rerun grub after making changes to this file

# NOTICE:  You have a /boot partition.  This means that

#          all kernel and initrd paths are relative to /boot/, eg.

#          root (hd0,0)

#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00

#          initrd /initrd-version.img

#boot=/dev/sda

default=0

timeout=15

splashimage=(hd0,0)/grub/splash.xpm.gz

#hiddenmenu

title Enterprise Linux (2.6.18-164.0.0.0.1.el5)

        root (hd0,0)

        kernel /vmlinuz-2.6.18-164.0.0.0.1.el5 ro root=/dev/VolGroup00/LogVol00 elevator=deadline

        initrd /initrd-2.6.18-164.0.0.0.1.el5.img

 

title  Fedora 15 (2.6.38.6-26.rc1.fc15.x86_64)

        root (hd0,0)

        kernel /vmlinuz-2.6.38.6-26.rc1.fc15.x86_64 ro root=/dev/VolGroup02/LogVol00 elevator=deadline

        initrd /initramfs-2.6.38.6-26.rc1.fc15.x86_64.img

 

11. Configured network at first boot

 

RedHat and Fedora use some files to configure the network at first boot. These files are located under /etc/sysconfig/network-scripts/.

 

At first boot of any of these servers after the restoration from tar files, the ifcfg-ethX configuration files are moved to a new file called ifcfg-ethX.bak, even if you have previously changed the hardware address of the corresponding NIC (Network Interface Controller) in the file.

 

This issue is not important in case of you can physically access the machine to rename back the ifcfg-ethX.bak file to ifcfg-ethX. But in our case, we will not be able to access the machine physically, and we will not be able to remotely access it until the network is configured.

 

This is why this step has to be done with high priority, otherwise we will never know if the machine booted and access it.

 

11.1.           Correctly configure network scripts

 

After having untar all files in the new created partitions from your running Fedora or Debian distribution and before rebooting on the new partitions, configure the network scripts for the new system you just installed.

 

Get all data from ifconfig (including the VLANs if you have. If you are restoring on OVH, you HAVE to configure VLANs on your running distribution. Past them into /etc/sysconfig/network-scripts/ configuration files of the mounted new partitions.

 

# ifconfig

 

eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx

          inet addr:212.xxx.xxx.xxx  Bcast:212.xxx.xxx.xxx  Mask:255.xxx.xxx.xxx

          inet6 addr: fe80::215:f2ff:fe5d:de9f/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:1388083 errors:0 dropped:6591 overruns:0 frame:0

          TX packets:563878 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:166230900 (158.5 MiB)  TX bytes:81559393 (77.7 MiB)

          Interrupt:23 Base address:0x2400

      

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:10884 errors:0 dropped:0 overruns:0 frame:0

          TX packets:10884 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:1226832 (1.1 MiB)  TX bytes:1226832 (1.1 MiB)

 

vlan5     Link encap:Ethernet  HWaddr 00:15:F2:5D:DE:9F

          inet addr:87.98.163.86  Bcast:87.98.163.86  Mask:255.255.255.255

          inet6 addr: fe80::215:f2ff:fe5d:de9f/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 b)  TX bytes:804 (804.0 b)

 

vlan6     Link encap:Ethernet  HWaddr 00:15:F2:5D:DE:9F

          inet addr:91.121.39.62  Bcast:91.121.39.62  Mask:255.255.255.255

          inet6 addr: fe80::215:f2ff:fe5d:de9f/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 b)  TX bytes:804 (804.0 b)

 

And past them into the /etc/sysconfig/network-scripts/ configuration files of the mounted new partitions.

 

# vi /mnt/root1/etc/sysconfig/network-scripts/ifcfg-eth0

 

DEVICE=eth0

BOOTPROTO=static

BROADCAST=212.xxx.xxx.xxx

IPADDR=212.xxx.xxx.xxx

HWADDR=xx:xx:xx:xx:xx:xx

NETMASK=255.xxx.xxx.xxx

NETWORK=212.xxx.xxx.xxx

ONBOOT=yes

TYPE=Ethernet

 

# vi /mnt/root1/etc/sysconfig/network-scripts/ifcfg-vlan5

 

VLAN=yes

VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD

DEVICE=vlan5

PHYSDEV=eth0

BOOTPROTO=static

ONBOOT=yes

TYPE=Ethernet

IPADDR=87.98.163.86

NETMASK=255.255.255.255

 

# vi /mnt/root1/etc/sysconfig/network-scripts/ifcfg-vlan6

 

VLAN=yes

VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD

DEVICE=vlan6

PHYSDEV=eth0

BOOTPROTO=static

ONBOOT=yes

TYPE=Ethernet

IPADDR=91.121.39.62

NETMASK=255.255.255.255

 

11.2.           Create a script and run it during the server booting

 

Create the script in order to move ifcfg-eth0.bak to ifcfg-eth0.

 

# vi /mnt/root1/root/network-reconf-first-boot.sh

 

#!/bin/bash

 

if [ -f /etc/sysconfig/network-scripts/ifcfg-eth0.bak ]

then

        mv /etc/sysconfig/network-scripts/ifcfg-eth0.bak /etc/sysconfig/network-scripts/ifcfg-eth0

        /etc/init.d/network restart

fi

exit 0

 

Now we program the script to be launched at booting.

 

# chmod +x /mnt/root1/root/network-reconf-first-boot.sh

# vi /mnt/root1/etc/rc.d/rc.local

 

#!/bin/sh

#

# This script will be executed *after* all the other init scripts.

# You can put your own initialization stuff in here if you don't

# want to do the full Sys V style init stuff.

 

touch /var/lock/subsys/local

/root/network-reconf-first-boot.sh

 

Then we can reboot on hard disk.

 

12. Replace the initial ram disk files of the Fedora boot partition

 

You can shuffle the computers when restoring the system. The computer where the system is being restored can be different from the computer where it was originally installed. Your computer risks to not boot, if the current computer’s hard disk controller driver is missing in the restored kernel.

 

12.1.           Download and replace initrd files of the kernel

 

To avoid the risk of a missing driver, we included the RAID controller driver in all initial ram disks for all servers [114]. The extended initrd files are available on the web (see section 14.3 for a complete list of locations).You have to download these files and replace the original initrd files before booting from the hard disk:

 

# cd /mnt/boot/

# wget http://www.switzernet.com/3/public/100926-mr21-tar-lvm/data1/100926,1740,billing4,initrd.gz

# mv initrd-2.6.18-164.0.0.0.1.el5.img initrd-2.6.18-164.0.0.0.1.el5.img.bak

# cp 100926,1740,billing4,initrd.gz initrd-2.6.18-164.0.0.0.1.el5.img

#

 

The next section 12.2 describes how the initrd files are created. You do not need this section for restoring and can jump directly to section 12.3 for the next step. However it is recommended to read and understand the procedure of section 12.2.

 

12.2.           The initrd files of 4 servers

 

First of all we need to examine all differences between the initrd files of each of 4 servers (billing1, billing2, billing3, and billing4). For this purpose the boot partitions of each server is downloaded:

 

bash-3.2$ ls -F -1

100829,2000,billing1,boot.tar.bzip2

100830,1845,billing3,boot.tar.bzip2

100830,1925,billing4,boot.tar.bzip2

100830,2130,billing2,boot.tar.bzip2

b1/

b2/

b3/

b4/

bash-3.2$

 

The initrd image files of each server’s boot partition are extracted:

 

bash-3.2$ for b in 1 2 3 4; do tar -C b$b -xvf *,*,billing$b,boot.tar.bzip2 ./initrd-2.6.18-164.0.0.0.1.el5.img; done

./initrd-2.6.18-164.0.0.0.1.el5.img

./initrd-2.6.18-164.0.0.0.1.el5.img

./initrd-2.6.18-164.0.0.0.1.el5.img

./initrd-2.6.18-164.0.0.0.1.el5.img

bash-3.2$

 

The initrd image files of each server are extracted in a respective folder.

 

bash-3.2$

bash-3.2$ ls -F -1 b*

b1:

initrd-2.6.18-164.0.0.0.1.el5.img

 

b2:

initrd-2.6.18-164.0.0.0.1.el5.img

 

b3:

initrd-2.6.18-164.0.0.0.1.el5.img

 

b4:

initrd-2.6.18-164.0.0.0.1.el5.img

bash-3.2$

bash-3.2$

 

Now the RAM disk hierarchy is extracted from each image file into an rd subfolder.

 

bash-3.2$ for b in 1 2 3 4; do cd b$b; mkdir rd; cd rd; zcat ../initrd-2.6.18-164.0.0.0.1.el5.img | cpio -i; cd ..; cd ..; done

17005 blocks

17005 blocks

16743 blocks

16743 blocks

bash-3.2$

bash-3.2$

 

A text file init, in each RAM disk contains the initial instructions of the temporary OS that the kernel of the server will mount first of all, before mounting the root system and all partitions of the hard drive.

 

 

The following printout shows the differences between the init file of initial ram disks of billing1 compared to the corresponding init files of billing2, billing3, and billing4. There is no difference between init files of billing1 and billing2, as both of them were installed on the same type of HP Proliant DL120 G5 blade servers, both with E200 RAID controller [115]. We see also, that the two servers, billing3 and billing4, do not load the cciss.ko driver (that corresponds to the RAID controller) as they were installed on conventional computers. Finally, in the server billing4, we see another difference (remember section 4.2). The OS of the initial ram disk mounts the hard disk partitions using a volume group name VolGroup00 in contrast to VolGroup01 used by the other three servers (billing1, billing2, and billing3). This difference, seen also in section 4.2 for fstab files, requires an attention when naming the volume groups on the empty system (section 4.1).

 

bash-3.2$

bash-3.2$ for b in 2 3 4; do echo; echo [b1 vs b$b]; echo; diff b1/rd/init b$b/rd/init; done

 

[b1 vs b2]

 

 

[b1 vs b3]

 

59,60d58

< echo "Loading cciss.ko module"

< insmod /lib/cciss.ko

 

[b1 vs b4]

 

59,60d58

< echo "Loading cciss.ko module"

< insmod /lib/cciss.ko

94,95c92,93

< lvm vgchange -ay --ignorelockingfailure  VolGroup01

< resume /dev/VolGroup01/LogVol03

---

> lvm vgchange -ay --ignorelockingfailure  VolGroup00

> resume /dev/VolGroup00/LogVol03

97c95

< mkrootdev -t ext3 -o defaults,ro /dev/VolGroup01/LogVol00

---

> mkrootdev -t ext3 -o defaults,ro /dev/VolGroup00/LogVol00

bash-3.2$

 

We must examine and compare not only the init files, but also all other files of each of the 4 initial RAM disks. By comparing the MD5 checksums, we discover that the only difference between these four temporary file systems consists in the content of their init files (already discussed) and in the presence and absence of one driver  cciss.ko corresponding to the RAID controller.

 

bash-3.2$

bash-3.2$ for b in 1 2 3 4; do cd b$b/rd; /bin/find . -type f -exec md5sum {} \; ; cd ../..; done | sort | uniq -c | egrep -v "^ *4 "

      1 4a660c0ede47b7130c86bb4f5b0762fb *./init

      2 6c0051b1cf195c350f32e8094b8ae164 *./init

      2 906232f8795752b71a58e070f1e11392 *./lib/cciss.ko

      1 e916de6b697ab8b43e31fa410866a4e5 *./init

bash-3.2$

 

To make the initrd disk images portable across the set of our servers, we must edit the init files so as to load the RAID controller driver, add the cciss.ko file in the library, and compress the hierarchy back into initial ram disk image format.

 

bash-3.2$ cd rd1

bash-3.2$ ls -F

bin/  dev/  etc/  init*  init.bak*  lib/  proc/  sbin@  sys/  sysroot/

bash-3.2$ /bin/find . | cpio -o -H newc > ../100926,1740,billing1,initrd

17013 blocks

bash-3.2$ cd ..

bash-3.2$ cd rd4

bash-3.2$ ls -F

bin/  dev/  etc/  init*  init.bak*  lib/  proc/  sbin@  sys/  sysroot/

bash-3.2$ /bin/find . | cpio -o -H newc > ../100926,1740,billing4,initrd

17013 blocks

bash-3.2$ cd ..

bash-3.2$ ls -1 -F

100926,1740,billing1,initrd

100926,1740,billing4,initrd

initrd-2.6.18-164.0.0.0.1.el5.img*

rd1/

rd4/

bash-3.2$ gzip 100926,1740,billing1,initrd

bash-3.2$ gzip 100926,1740,billing4,initrd

bash-3.2$ ls -1 -F

100926,1740,billing1,initrd.gz

100926,1740,billing4,initrd.gz

initrd-2.6.18-164.0.0.0.1.el5.img*

rd1/

rd4/

bash-3.2$

 

The initrd image files of billing2, billing3 are the copies of the initrd file of billing1. The image file of billing3 is different due to a different volume group name. These image files are uploaded to the web server (see section14.3) and must replace the default image files when the boot partition is restored.

 

12.3.           Dismount the partitions and reboot

 

# cd /mnt

# umount boot

# umount root1

# umount root2

# umount porta

# reboot

 

Remove the Live CD from the drive.

 

13. After booting from the hard drive

 

If the system successfully booted and you got the login prompt on the console, you deserve congratulations. First of all you need to shut down the other clone running the same installation to avoid IP address conflicts.

 

As soon as the previous clone is down, login as root to the newly installed server in order to configure its network. As you changed the server and its network card, maybe the interface will not come up automatically at the boot. If it happens, check IP and MAC address parameters:

 

Login: root

...

# cd /etc/sysconfig/network-scripts/

# vi ifcfg-eth0

 

Write and exit.

 

:w

:q

 

Reboot the system. If the restored server is billing4 (porta-SIP server) or billing2 (master), you have to insert also the security dongle. Take out the dongle from the stopped clone. The dongles of the master (billing2) and SIP (billing4) servers are identical.

 

13.1.           Porta-SIP services do not start

 

If the services porta-sip (billing4) does not come up, login as root, and follow the notes below:

 

# cd /porta_var/sipenv-212.xxx.xxx.xxx/etc/rc.d/

# ./sip.sh status

# ./sip.sh restart

# ./sip.sh stop

# reboot

 

After this procedure, the Porta-SIP services must come up after the reboot. The slave server must also show that everything is fine with the porta-sip server. If not, restart the services from the console once more, or do in two steps, by first stopping then starting the service with the ./sip.sh utility.

 

 

13.2.           Check the swap allocation

 

Follow the printout below to make sure that everything is fine with the swap space.

 

#

# cat /proc/swaps

Filename                                Type            Size    Used    Priority

/dev/mapper/VolGroup00-LogVol03         partition       32767992        0       -1

#

# cat /proc/meminfo | grep Swap

SwapCached:          0 kB

SwapTotal:    32767992 kB

SwapFree:     32767992 kB

#

 

14. Download locations

 

The tar files of all partitions of all servers can be downloaded via HTTP from the following web locations. More help for downloading can be found in our previous publication [116]. The tar files of partitions are not available in the public version of this document.

 

14.1.           switzernet.com

 

In the below table the columns represent the servers and the rows represent the partitions. For each partition on each server there is one tar file compressed with bzip2 method.

 

 

billing1 212.147.8.106 Configurator

billing2 212.147.8.101 Billing Master

billing3 212.147.8.102 Billing Slave (web)

billing4 212.147.8.104 SIP Server

Boot

billing1,boot.tar.bzip2

(5.6M)

billing2,boot.tar.bzip2 (5.6M)

billing3,boot.tar.bzip2 (5.6M)

billing4,boot.tar.bzip2 (5.6M)

Porta

billing1,porta.tar.bzip2 (5.1M)

billing2,porta.tar.bzip2 (33M)

billing3,porta.tar.bzip2 (20M)

billing4,porta.tar.bzip2 (9.9M)

Root #1

billing1,root1.tar.bzip2 (656M)

billing2,root1.tar.bzip2 (680M)

billing3,root1.tar.bzip2 (664M)

billing4,root1.tar.bzip2 (659M)

Root #2

billing1,root2.tar.bzip2 (135)

billing2,root2.tar.bzip2 (138)

billing3,root2.tar.bzip2 (142)

billing4,root2.tar.bzip2 (144)

Md5

111202,md5sum-localhost,billing1.txt

111202,md5sum-localhost,billing2.txt

111202,md5sum-localhost,billing3.txt

111202,md5sum-localhost,billing4.txt

 

14.2.           ssh connection

 

The same files are available also throw ssh connection.

 

 

billing1 212.147.8.106 Configurator

billing2 212.147.8.101 Billing Master

billing3 212.147.8.102 Billing Slave (web)

billing4 212.147.8.104 SIP Server

Boot

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing1,boot.tar.bzip2

(5.6M)

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing2,boot.tar.bzip2

(5.5M)

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing3,boot.tar.bzip2

(5.5M)

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing4,boot.tar.bzip2

(5.5M)

Porta

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing1,porta.tar.bzip2

(5.1M)

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing2,porta.tar.bzip2

(32.9M)

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing3,porta.tar.bzip2

(19.5M)

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing4,porta.tar.bzip2

(9.9M)

Root #1

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing1,root1.tar.bzip2

(655.1M)

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing2,root1.tar.bzip2

(679.8M)

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing3,root1.tar.bzip2

(663.5M)

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing4,root1.tar.bzip2

(659.0M)

Root #2

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing1,root2.tar.bzip2

(135)

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing2,root2.tar.bzip2

(138)

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing3,root2.tar.bzip2

(142)

/share/MD0_DATA/porta-billing-mr23/tar/111202,1810,billing4,root2.tar.bzip2

(144)

Md5

/share/MD0_DATA/porta-billing-mr23/tar/111202,md5sum-localhost,billing1.txt

(283)

/share/MD0_DATA/porta-billing-mr23/tar/111202,md5sum-localhost,billing2.txt

(283)

/share/MD0_DATA/porta-billing-mr23/tar/111202,md5sum-localhost,billing3.txt

(283)

/share/MD0_DATA/porta-billing-mr23/tar/111202,md5sum-localhost,billing4.txt

(283)

 

The server has the following IP address:

 

212.xxx.xxx.108

 

14.3.           Initial RAM disk files for the LVM version

 

The Initial RAM disk files for the LVM version are available under these locations:

http://www.switzernet.com/3/public/100926-mr21-tar-lvm/data1/

http://www.unappel.ch/2/public/100926-mr21-tar-lvm/data1/

 

The files can be downloaded via HTTP (a browser or a command line tool):

 

 

An example of downloading session with a command line tool is shown below. Other alternatives to wget tool exist.

 

bash-3.2$

bash-3.2$ wget http://www.switzernet.com/3/public/100926-mr21-tar-lvm/data1/100926,1740,billing1,initrd.gz

--18:20:37--  http://www.switzernet.com/3/public/100926-mr21-tar-lvm/data1/100926,1740,billing1,initrd.gz

           => `100926,1740,billing1,initrd.gz'

Resolving www.switzernet.com... 94.23.49.17

Connecting to www.switzernet.com|94.23.49.17|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 3,441,690 (3.3M) [application/x-gzip]

 

100%[====================================================================================================================>] 3,441,690    667.94K/s    ETA 00:00

 

18:20:42 (638.28 KB/s) - `100926,1740,billing1,initrd.gz' saved [3441690/3441690]

 

bash-3.2$ ls

100926,1740,billing1,initrd.gz

bash-3.2$

 

These initrd files are extended versions of original images. They contain a driver for HP E200 RAID controllers. If servers are shuffled, you need to download and replace the original initrd file with these files. Section 12.1 shows when and how these files must be downloaded and used. Section 12.2 describes why and how these updated files are created.

 

15. References

 

Restoring the Porta-Switch installation from tar files on LVM partitions [this page]

http://switzernet.com/3/public/111215-mr23-tar-lvm

 

For restoring previous Porta-Switch versions

http://switzernet.com/3/public/100926-mr21-tar-lvm/

http://www.unappel.ch/2/public/100926-mr21-tar-lvm/

 

Restoring the Porta-Switch installation on primary disk partitions using tar files

http://switzernet.com/3/company/111206-tar-pb-mr23/

http://unappel.ch/2/company/100830-tar-pb-mr21/

http://www.unappel.ch/2/public/100830-tar-pb-mr21/

http://switzernet.com/2/public/100830-tar-pb-mr21/

 

Upgrades and rollbacks of Porta-Switch system:

http://portaone.com/news/news_detail.php?ID=1642

 

Set up Logical Volume Manager in Linux

http://articles.techrepublic.com.com/5100-10878_11-6166001.html

 

Red Hat Enterprise Linux

http://fr.wikipedia.org/wiki/Red_Hat_Enterprise_Linux

 

Fedora 15 Live CD:

http://fedoraproject.org/get-fedora

http://switzernet.com/3/company/111215-fedora15-x8664-iso/

 

The original installation disk of MR21 (without post-install and configuration):

http://switzernet.com/3/company/111026-portaswitch-mr23-iso/

 

The original installation disk of MR21 (without post-install and configuration):

http://unappel.ch/2/company/100811-portabilling-mr21-iso/

 

16. Annex: Glossary of conventions

 

Codes:

 

The text appearing in this format represents a printout or file content.

 

Hand notes:

 

The text appearing in this format represents a note on commands or on an output made by hand (misspellings are not excluded).

 

Important:

 

Pay special attention on a text highlighted as this one.

 

Commands, device names, file names:

 

The text appearing in-line with the paragraph in this format is usually a command.

 

17. Annex: the field formulas used in this document

 

This section is not related to the porta-switch system and is not required for the installation. Refer to this section only for editing and creating similar documents.

 

17.1.           Auto-incrementing reference numbers

 

For auto-incrementing reference numbers, we use in this document MS Word field codes. The following is an example of a link to Google [117]. There is a set function at the beginning of the document for initializing the counter to 100. Further on, there is an auto-increment before each use of the bookmark variable refnum.

The text to display for a hyperlink is refnum.

However when toggling the field codes it is not possible to see this text. If you press Ctrl-K on the link, the text to display will indicate on a non-editable field:

The text to display will be visible only if you remove the hyperlink (by pressing on Ctrl-K or by using the right click pop-up menu):

Then you can put the hyperlink back by selecting the { refnum \* mergeformat } and pressing on Ctrl-K. Associate to it the same hyperlink.

Before printing the document, select the document from the definition square brackets down to the end (Ctrl-Shift-End). Right click on the selection and choose Update Field from the pop-up menu. Such an update will reinitialize the counter, and renumber the references in the right order.

You do not have to worry about the numbering, when inserting the references. During the documentation, at insertion of a reference, you need to copy-paste another reference, including the surrounding square brackets, and change only the link location by using the Edit Hyperlink pane that appears when pressing on Ctrl-K. The numbering throughout the document will be corrected, when you update all fields as described.

 

17.2.           Deleting the auto-incrementing bookmark before printing

 

When the numbering is updated, before printing, delete the bookmark refnum using the Bookmark pane (Alt-I-K).

 

 

If you do not delete the bookmark, all displaying field codes will be refreshed again when you click on the print button. The last value of refnum will be used for all occurrences of refnum resulting in the same reference number throughout the doc.

 

17.3.           Styles

 

The styles used in this document are limited uniquely by the list shown below.

No other styles must be generated when updating this document.

 

*   *   *

Copyright © 2011 by Switzernet