CentMesh Software Installation Procedure

richnessokahumpkaServers

Dec 9, 2013 (3 years and 4 months ago)

68 views

1






CentMesh Software Installation Procedure













Revision history:

Version

Date

Description

Reviewer

Author

0.01

11/5/2008

3 partition installation procedure


phpathak

0.02

9/22/2009

Revision for partition sizes, CVS
checkout procedure


phpathak

0.03

5/6/2010

Improved writing, SVN checkout


phpathak









2


The installation procedure of CentMesh software installation consists of two parts.
In the first part, a desktop computer (CentMesh node) is prepared by installing 3
Linux systems together w
ith few other necessary packages. Once the mesh node
is prepared with operating system, CentMesh software suite can be downloaded
and installed in second part.


PART 1
:
Procedure o
f 3 Partition Installation


In this part, you will install multiple copies o
f Fedora 9 on your desktop machines.
Please have the Fedora 9 CDs/DVD (can be downloaded from any Fedora mirror)
ready along with the desktop on which the installation will be performed. The
desktop machine should have at least 20 GB of hard
-
drive to conta
in the 3
different Fedora 9 installations which we will perform below.


WARNING:
The procedure described here will format the hard
-
drive of your
desktop machine. Hence, please back
-
up any important data from your hard
-
drive.


STEP 1
-

FAIL
-
SAFE MODE INSTAL
LATION


In this step, we will install first fail
-
safe Fedora 9 kernel image and root file system

in the mesh node

(desktop)
.


1.

Put the 1st F9 CD in CD drive and setup to reboot from CD

2.

give root password to be
"meshmesh"
, it will be changed later

3.

follow the

installation steps until you reach
"create partition layout"

screen

4.

out of
the
5 option
s

in top drop
-
down menu, choose
"create custom
layout"

and click

next

5.

delete all existing partitions. You should be able to see just one hard
-
drive

device

-

/dev/sda

or

/dev/hda

3


(In case of multiple hard
-
drives, please select the one which you wish to
i
nstall

with meshbed software)

6.

verify that the entire hard
-
drive space is listed as unused space

7.

now, you want t
o create 3 partitions


(i) first a

boot partition where fai
l
-
safe

kernel will reside,
(ii)
second for roo
t file system of fail
-
safe mode

and
(iii)
third
a
swap

partition


8.

to do so, click on new and create partition prompt will appear.

9.

for 1st partition, click new and choose the mount point to be
/boot
, file
system

ext3

and let the size be 1 GB,
/dev/sda1

will appear

10.

for 2nd partition, choose mount point to be / only, size of the partition be
3 GB

i
f your hard
-
drive is 20 GB, 8 GB if 40 GB or more, [now onwards we
use this

format
-

(3 (20),
8 (40), 8 (60)) to indica
te
size of partition and
hard
-
drive]

GB, file system type is
ext3
,
/dev/sda2

will appear in the table

11.

for 3rd partition, choose the file system to be swap partition, the mount
point

is disabled automatically and give the size of the partition to be
twice t
he size

of you RAM

12.

verify that the rest of the space should be seen as unused space and
only

/sda1
,
/sda2

and
/sda3

will appear in the partition table


13.

click on next and press "write changes t
o the disk", this will complete
c
reating

the partitions

14.

continu
e following the steps until

you reach installation of grub
bootloader.

Since this is the first failsafe image, we will install the grub
bootloader. There

is no action required here because F9 chooses the
correct partition for grub

bootloader. Just click ne
xt

15.

when asked for which packages to install, choose all 3 categories, this
will

require first 4 CDs of fedora


16.

let the installation complete and reboot at the end

17.

once you reboot, follow the rest of the installation steps

18.

create a user name mesh, passw
or
d
meshmesh
, (this user is temporary
and we

will remove it once everything is done)

19.

login as mesh

4


20.

now we want to create 2 more partitions for 2nd and 3rd experimental
images,

4th partition will be an extended partition which contains the 5th
and 6
th
logical p
artitions

21.

open terminal

22.

%>su

23.

%>/sbin/fdisk /dev/sda

24.

press p for printing the current partition table, you can see 3 partitions
that

you created

25.

press
n

for creating new partition, press e for extended

26.

press enter for start as well as end cylinders, this wi
ll create 4th partition
using

entire left unused space

27.

press
p

and verify newly created
/dev/sda4

28.

press
n

again, press enter for start cylinder

29.

for end cylinder, use this formula to enter end
cylinder
, end cylinder =
start

cylinder + ((suggested end cylind
er
-

start cylinder)/2 )

30.

this will divide the unused space of
/sda4

into exact two identical size
parts


31.

press
p

to verify that you created
/dev/sda5

32.

press
n

again

33.

accept the suggested start and end cylinder

34.

press
p

to verify that you created
/dev/sda6

35.

pre
ss
w

to save and quit

36.

%>/sbin/partprobe (to make newly created partitions accessible)

37.

now we want to create file systems on
/sda5

and
/sda6

38.

%>/sbin/mkfs.ext3 /dev/sda5

39.

%>/sbin/mkfs.ext3 /dev/sda6

40.

now we want to create mo
u
nt points for
/sda5

and
/sda6
, we a
lso want
these

two partitions to be mounted on boot

41.

%> cd /

42.

%> mkdir disk2 disk3

43.

%> vim /etc/fstab (make sure that your fstab file looks like below)



5


/dev/sda2

/


ext3


defaults


1

1

/dev/sda1

/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/sda3

swap


swap


defaults


0

0

/dev/sda5

/disk2

ext3


defaults


1

1

/dev/sda6

/disk3

ext3


defaul
ts


1

1



STEP 2: INSTALLING 2ND AND 3RD EXPERIMENTAL FEDORA IMAGE


1.

once you have modified the
/etc/fstab

file as above, we want to install 2
more

fedora in
/sda5

and
/sda6


2.

put F9 CD 1 again in CD

drive and reboot

3.

root password again
"meshmesh"

4.

continue

installation until you reach create pariti
ti
on layout screen

5.

again choose "create custom layout"

6.

you should see all 6 partitions in listed table

7.

click on the one which has size of 1 GB
(/dev/sda1)

and click edit, give
the

mount point to be /boot, click ok
, if it asks for whether or not you
want to

format the partition, press "do not format"

8.

click on
/dev/sda5

and press edit, give mount point to be /, click ok and
"do not

format"

9.

swap partition is detected as it is, so no action required

10.

click next and writ
e changes to disk

11.

IMPORTANT: continue installation and when you reach "install grub?"
s
creen,

do not install grub again. We already installed it once. SO,
UNTICK THE

INSTALL GRUB BOOTLOADER CHECKBOX

12.

again choose all three
categories of packages with 4 CD
s
and carry out
the

installation

6


13.

when ins
tallation in complete, remove CD 4, put CD

1 and reboot (we
want to

install one more fedora yet)

14.

again the installation will start and continue steps

15.

root password
"meshmesh
"

16.

continue installation until you reach crea
te partition layout screen

17.

again choose "create custom layout"

18.

you should see all 6 partitions in listed table

19.

click on the one which has size of 1 GB
(/dev/sda1)

and click edit, give
the

mount point to be /boot, click ok, if it asks for whether or not you

want to

format the partition, press "do not format"

20.

click on
/dev/sda6

and press edit, give mount point to be /, click ok and
"do not

format"

21.

swap partition is detected as it is, so no action required

22.

click next and write changes to disk

23.

IMPORTANT: contin
ue installation and when you reach "install grub?"
screen,

do not install grub again. We already installed it once. SO,
UNTICK THE

INSTALL GRUB BOOTLOADER CHECKBOX

24.

again choose all three
categories of packages with 4 CD
s and carry out
the 3rd

installation


STEP 3: CONFIGURING GRUB BOOT AND FSTAB MOUNTING


1.

at the end of 3rd installation, reboot

2.

though we installed 3 fedoras, we don't see 3
entries

for boot at start of
booting.

T
his is because we have not yet changes the grub configuration
yet, we will do

thi
s next

3.

we will be boot in fail
-
safe mode

4.

login as mesh, passw
or
d
meshmesh

5.

open terminal

6.

%> cd /disk2

7.

%> ls (you should be able to see entire root file
-
system installed here)

8.

similarly for /disk3

9.

%> cd /boot

7


10.

%> ls (you should see one vmlinuz and initrd file
s, we want to rename
them

next)

11.

%> su

12.

%> mv vmlinuz
-
2.6.25
-
14.i686.fc9 vmlinuz
-
failsafe

13.

%> mv initrd
-
2.6.25
-
14.i686.fc9.img initrd
-
failsafe.img

14.

now we want to copy this kernels for 2nd and 3rd experimental image

15.

%> cp vmlinuz
-
failsafe /disk2/boot/vmlinuz
-
E
xp2

16.

%> cp initrd
-
failsafe.ing /disk2/boot/initrd
-
Exp2.img

17.

%> cp vmlinuz
-
failsafe /disk3/boot/vmlinuz
-
Exp3

18.

%> cp initrd
-
failsafe.ing /disk3/boot/initrd
-
Exp3.img

19.

now we want to change the grub config file so that we can boot in
second and

third

experimental
images

20.

%> vim /boot/grub/grub.conf (make the fi
le look same as below
)


# 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 in
itrd paths are relative to /boot/, eg.

# root (hd0,0)

# kernel /vmlinuz
-
version ro root=/dev/sda2

# initrd /initrd
-
version.img

#boot=/dev/sda

default=0

timeout=15

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

hiddenmenu

title Fedora (failsafe)

root (hd0,0)

kernel

/vmlinuz
-
failsafe ro root=/dev/sda2 rhgb quiet

initrd /initrd
-
failsafe.img

title Fedora (Exp2)

root (hd0,0)

8


kernel (hd0,4)/boot/vmlinuz
-
Exp2 ro root=/dev/sda5 rhgb quiet

initrd (hd0,4)/boot/initrd
-
Exp2.img

title Fedora (Exp3)

root (hd0,0)


kernel (hd0,5)/
boot/vmlinuz
-
Exp3 ro root=/dev/sda6 rhgb quiet

initrd (hd0,5)/boot/initrd
-
Exp3.img


2
1.

now we will be changing the fstab file for
/disk2

and
/disk3

installations

2
2
.

vim
/disk2/etc/fstab

(make your fstab file look same as below)


/dev/sda2


/disk1


ext3


defaults,noauto

1 1

/dev/sda1


/boot



ext3


defaults,noauto

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/sd
a3


swap



swap


defaults


0 0

/dev/sda5


/



ext3


defaults


1 1

/dev/sda6


/disk3


ext3


defaults,noauto

1 1


23
.

similarly, %> vim /disk3/etc/fstab (make your fstab file look same as


below)


/dev/sda2


/disk1


ext3


defaults,noauto

1
1

/dev/sda1


/boot



ext3


defaults,noauto

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/sda3



swap



swap


defaults



0 0

/dev/sda5


/disk2


ext3


defaults,noauto

1 1

/dev/sda6


/



ext3


defaults


1 1


9


STEP 4: PACKAGE INSTALLATIONS AND USER CONFIGURATION IN FAILSAFE
MODE


1.

remember that you are currently working in fail
-
safe mode

2.

now we want to shutoff iptables
, firewall and SELinux

3.

%> ntsysv

4.

disable network manager and iptables services on boot

5.

go to top menu of fedora, system
-
> administration
-
> firewall, disable
firewall,

give root password if asked


6.

go to system
-
> administration
-
> SELinux management, chan
ge first line
to

disabled and second to permissive

7.

now we want to remove user mesh from failsafe mode

8.

go to system
-
> logout

9.

login as root, passw
ord

meshmesh
, accept privileged user warning

10.

go to system
-
> administration
-
> users and groups

11.

click on user m
esh and delete it

12.

now we want to change the passw
or
d for root user

13.

from terminal

14.

%> passwd

15.

Give a new root password. (ENHANCEMENT PLANNED


password
distribution
-

phpathak)

16.

we are done with fail
-
safe mode configuration and now we will configure
2nd

and 3r
d installations


STEP 5: CONFIGURATION OF EXP2 AND EXP3 IMAGES


1.

reboot machine, on boot you should see Exp2 and Exp3 in boot options
now


2.

boot in Exp2

3.

since you are booting in this installation for the first time, you will asked
to

follow few installations

step

4.

create user "mesh2" passw
or
d
"meshmesh
"

5.

login as mesh2

10


6.

open terminal

7.

%> su

8.

%> /usr/sbin/visudo (this will open /etc/sudoers file)

9.

add following at the end of the file


mesh2 ALL=ALL, !/bin/mknod * [b|c|u][8] *, !/bin/mount * /dev/sda[0
-
6]

*,
!/sbin/f
disk, !/bin/mount


10.

:wq

11.

make sure that you don't have any errors in this file

12.

by doing this, mesh2 user has almost all privileges as root except few

commands, we will not have need to use root much, to make sure that
no one

becomes root unnecessarily, we wi
ll change root password now

13.

passwd

14.

enter the root password

15.

Repeat the steps 4.2 to 4.6 for Exp2

16.

now we need to do the same for Exp3

17.

reboot machine

18.

boot in Exp3

19.

since you are booting in this installation for the first time, you will asked
to

follow few inst
allations step

20.

create user "mesh3" passwd
"meshmesh"


21.

login as mesh3

22.

open terminal

23.

%> su

24.

%> /usr/sbin/visudo (this will open /etc/sudoers file)

25.

add following at the end of the file


mesh3 ALL=ALL, !/bin/mknod * [b|c|u][8] *, !/bin/mount * /dev/sda[0
-
6]

*,
!/sbin/fdisk, !/bin/mount


26.


:wq

27.

make sure that you don

t have any errors in this file

11


28.

by doing this, mesh2 user has almost all privileges as root except few

commands, we will not have need to use root much, to make sure that
no one

becomes root unnecessari
ly, we will change root password now

29.

passwd

30.

enter the root password

31.

Repeat the steps 4.2 to 4.6 for Exp3


At this point, failsafe mode has only one used
-

root, password to which is only

used when really needed. In Exp2, there are two users
-

root and mesh
2,

mesh2
has almost equal rights are root. All experimentation can be done in

mesh2 user
only and there is no requirement to be root. It is for recovery only.

User
configuration in Exp2 and Exp3 is same. mesh2 and mesh3 users require

to add
sudo before the
ir commands to run superuser mode operations. When

you are
booted in Exp2, you can not know that there exists failsafe or Exp3

kernels and
root file system. This will prevent any mistakes by users which can

affect any other
partitions/installations.


















12


PART 2
:
CentMesh software download and installation


1.

CentMesh software will be installed in 2nd and 3rd installations


Exp2
and Exp3. Boot in Exp2

(base mode)
.

2.

%> su (passwd: meshmesh)

3.

%> cd

4.

%> mkdir mesh

5.

%> cd mesh

6.

Checkout the latest MeshBed
code from SVN

7.

%>
svn co svn+ssh:
//svn@centmesh.csc.ncsu.edu/MeshBed

8.

Once the checkout is complete, do the following to install the meshbed

9.

%> cd <path_to_meshBed>/script/boot/

10.

%> sh ./installMeshBed.sh

11.

When asked for node ID, choose a different node ID for

all the mesh
node
s

in your CentMesh network. E.g. 1, 2, 3 and so on. In most cases,
node with ID 1 will act as the controller node.

12.

Once the installation is complete,
reboot the machine. The meshbed
software will start automatically on reboot. No further
actions are
required.

13.

Boot in Exp3 and r
epeat above mentioned steps 2 to 12 for Exp3.