Difference between revisions of "Hard Disk Install Setup Tips"

From NST Wiki
Jump to navigationJump to search
(NIC Setup)
 
(23 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 +
<div class="wikiNote">[[Image:Warning.png‎]] This page is only relevant to older versions of the NST distribution. If you are using version '''2.11.0''' or later of the NST, the hard disk installation procedure has changed - see the "[[Getting Started#To Install To Hard Disk|To Install To Hard Disk]]" section on the [[Getting Started]] page.</div>
 +
 +
== nsthdinstall tips ==
 +
 +
Try this, assuming your boot partition is sda1, and your swap is sda5:
 +
 +
<div class="screen">
 +
  <div class="screenTitle">''Command:'' "nsthdinstall"</div>
 +
  <div class="userInput"><span class="prompt">[root@probe-9 root]# </span>nsthdinstall --device /dev/sda1 --format --label "NST v1.8.0" --swap-devices /dev/sda5 --swap-format-label --grub-install</div>
 +
</div>
 +
 +
== Partitioning ==
 +
 +
The NST installation will fit into a 2 gigabyte partition nicely, if you move the growing /var directory to it's own partition.  The following partition guide will work well, if you do move the /var directory.
 +
 +
A good partition setup is as follows:
 +
 +
{| cellspacing="0" border="1"
 +
|Partition 1
 +
|NST Installation
 +
|2 Gigabytes
 +
|-
 +
|Partition 2
 +
|NST backup Installation
 +
|2 Gigabytes
 +
|-
 +
|Partition 3
 +
|Linux Swap
 +
|1 Gigabytes
 +
|-
 +
|Partition 4
 +
|/var
 +
|Remaining Disk
 +
|}
 +
 +
== Mounting /var to a new partition ==
 +
 +
After a successful nsthdinstall, and reboot, you will have the /var directory in your base partition.  Since this directory can grow quickly due to log files and such, it is advised you move it to it's own partition. Follow these commands to move /var from the base partition to a newly mounted partition.  This assumes that /var/sda4 is your new /var partition.
 +
 +
 +
mke2fs -c /dev/sda4
 +
mkdir /newvar
 +
mount /dev/sda4 /newvar
 +
cd /var
 +
cp -ax * /newvar
 +
cd /
 +
mv var oldvar
 +
mkdir var
 +
 +
* Edit /etc/fstab to add
 +
/dev/sda4            /var              ext2            defaults                        1 2
 +
 +
* reboot
 +
 
== HD Installation Recipe ==
 
== HD Installation Recipe ==
  
The following details a set of steps to Partition Hard disk to accept two NST installations and 3 ethernet NICs.
+
The following details a set of steps to Partition Hard disk to accept two NST installations and 3 ethernet NICs.  Move /var to a new large partition of it's own.
 
    
 
    
 
=== HD Install ===
 
=== HD Install ===
  
* Boot From CD
+
* Boot From CD
* Log in  
+
* Log in  
* cfdisk  
+
* cfdisk  
  * create 2G NST install #1 /dev/hda1 Make bootable
+
** create 2G NST install #1 /dev/sda1 Make bootable
  * create 2G NST install #2 /dev/hda2
+
** create 2G NST install #2 /dev/sda2
  * Create 1G swap /dev/hda3
+
** Create 1G swap /dev/sda3
  * create /dev/hda4 for /var/nst
+
** create /dev/sda4 for /var/nst
  * reboot
+
* reboot
 +
 
 +
* nsthdinstall
 +
nsthdinstall --device /dev/sda2 --format --label "NST v1.8.0-2" --swap-devices /dev/sda5 --swap-format-label --grub-install 
 +
  nsthdinstall --device /dev/sda1 --format --label "NST v1.8.0-1" --swap-devices /dev/sda5 --grub-install      (waste of time to format the swap partition 2x)
 +
* reboot to HD.
  
* nsthdinstall
+
* Login with nst default password.
  nsthdinstall --device /dev/hda2 --format --label "NST v1.5.0-2" --swap-devices /dev/hda5 --swap-format-label --grub-install 
+
* Create var partition, and move var to it:
  * nsthdinstall --device /dev/hda1 --format --label "NST v1.5.0-1" --swap-devices /dev/hda5 --swap-format-label --grub-install 
+
  * reboot to HD.
+
  mke2fs -c /dev/sda4
 +
mkdir /newvar
 +
mount /dev/sda4 /newvar
 +
  cd /var
 +
cp -ax * /newvar
 +
cd /
 +
  mv var oldvar
 +
mkdir var
  
* Login with nst@2003 password.
+
* Edit /etc/fstab to add  
* Create var partition, and move var to it:
+
/dev/sda4           /var              ext2            defaults                        1 2
  *    {{{
+
* reboot
mke2fs -c /dev/hda4
 
mkdir /newvar
 
mount /dev/hda4 /newvar
 
cd /var
 
cp -ax * /newvar
 
cd /
 
mv var oldvar
 
mkdir var
 
}}}
 
  * Edit /etc/fstab to add  
 
  {{{/dev/hda4           /var              ext2            defaults                        1 2}}}
 
* reboot
 
  
=== Host Name ===
+
if you are not booting from the correct partition:
 +
boot, when the grub menu is showing hit c for command mode
 +
root (hd0,0)
 +
setup (hd0)
 +
this tells grub to use the boot menu (/boot/grub/menu.lst) on disk 0 partition 0
 +
the second line is to write the changes to the Master Boot Record on hd0
  
{{{nsthostname -n nprobe2}}}
+
=== Set Host Name ===
 +
 
 +
nsthostname -n nprobe9
  
 
=== NIC Setup ===
 
=== NIC Setup ===
  
All nodes but gr at 10.x.1.6
+
Set up 3 nics. On my particular system, I used two PCI cards (eth0 and eth1) as probes and the onboard nic (eth2) as the management port
  
 +
* cdnet
 +
** Set probe ports eth0 and eth1 to static
 +
** Set management port eth2 (the onboard nic) to static, and set ip address 10.<campus>.1.6
  
* cdnet
 
  * Set probe ports eth0 and eth1 to static
 
  * Set management port eth2 (the onboard nic) to static, and set ip address 10.<campus>.1.6
 
  
<div class="computerOutput">
+
[root@nprobe9 network-scripts]# cat ifcfg-eth0
[root@nprobe9 network-scripts]# cat ifcfg-eth0
+
DEVICE=eth0
DEVICE=eth0
+
BOOTPROTO=none
BOOTPROTO=none
+
ONBOOT=yes
ONBOOT=yes
+
# PROBE PORT 3com NIC
# PROBE PORT 3com NIC
+
 
</div>
+
[root@nprobe9 network-scripts]# cat ifcfg-eth1
<div class="computerOutput">
+
DEVICE=eth1
[root@nprobe9 network-scripts]# cat ifcfg-eth1
+
BOOTPROTO=none
DEVICE=eth1
+
ONBOOT=yes
BOOTPROTO=none
+
# PROBE PORT 3com NIC #2
ONBOOT=yes
+
 
# PROBE PORT 3com NIC #2
+
[root@nprobe9 network-scripts]# cat ifcfg-eth3
</div>
+
DEVICE=eth3
<div class="computerOutput">
+
BOOTPROTO=static
[root@nprobe9 network-scripts]# cat ifcfg-eth3
+
ONBOOT=yes
DEVICE=eth3
+
IPADDR=10.9.1.6
BOOTPROTO=static
+
GATEWAY=10.9.1.1
ONBOOT=yes
+
NETMASK=255.255.255.0
IPADDR=10.9.1.6
+
BROADCAST=10.9.1.255
GATEWAY=10.9.1.1
+
NETWORK=10.9.1.0
NETMASK=255.255.255.0
+
# onboard nic management interface
BROADCAST=255.255.255.255
+
 
NETWORK=10.9.1.0
+
=== System Time Sync ===
# onboard nic management interface
 
  
</div>
+
Sometimes when using a VMWare session the time will slow down or perhapes speed up. To correct this just
 +
follow these steps.
  
Set the probe nic to monitor the vlan or interlink you wish to monitorFor a campus, this would be typically vlan2 on the core switch, to monitor all traffic inbound/outbound to the campus.
+
- While in X, open a bash prompt and create a script file with a .sh extension in the root directory.
 +
- In the script add the line, "/usr/bin/rdate -s time.chu.nrc.ca". For a list of time servers check this
 +
- don't forget to set it as executable chmod +x /timekeeper.sh
 +
  link [http://support.ntp.org/bin/view/Servers/StratumTwoTimeServers here].
 +
- Open /etc/crontab and add "*/1 * * * root sh timekeeper.sh" (make sure you put the name of the file you
 +
  made earlier.
 +
  - Restart the crond service with "/sbin/service crond restart" and the time will now sync every minute.

Latest revision as of 07:29, 4 November 2010

Warning.png This page is only relevant to older versions of the NST distribution. If you are using version 2.11.0 or later of the NST, the hard disk installation procedure has changed - see the "To Install To Hard Disk" section on the Getting Started page.

nsthdinstall tips

Try this, assuming your boot partition is sda1, and your swap is sda5:

Command: "nsthdinstall"
[root@probe-9 root]# nsthdinstall --device /dev/sda1 --format --label "NST v1.8.0" --swap-devices /dev/sda5 --swap-format-label --grub-install

Partitioning

The NST installation will fit into a 2 gigabyte partition nicely, if you move the growing /var directory to it's own partition. The following partition guide will work well, if you do move the /var directory.

A good partition setup is as follows:

Partition 1 NST Installation 2 Gigabytes
Partition 2 NST backup Installation 2 Gigabytes
Partition 3 Linux Swap 1 Gigabytes
Partition 4 /var Remaining Disk

Mounting /var to a new partition

After a successful nsthdinstall, and reboot, you will have the /var directory in your base partition. Since this directory can grow quickly due to log files and such, it is advised you move it to it's own partition. Follow these commands to move /var from the base partition to a newly mounted partition. This assumes that /var/sda4 is your new /var partition.


mke2fs -c /dev/sda4
mkdir /newvar
mount /dev/sda4 /newvar
cd /var
cp -ax * /newvar
cd /
mv var oldvar
mkdir var
  • Edit /etc/fstab to add
/dev/sda4            /var              ext2            defaults                        1 2
  • reboot

HD Installation Recipe

The following details a set of steps to Partition Hard disk to accept two NST installations and 3 ethernet NICs. Move /var to a new large partition of it's own.

HD Install

  • Boot From CD
  • Log in
  • cfdisk
    • create 2G NST install #1 /dev/sda1 Make bootable
    • create 2G NST install #2 /dev/sda2
    • Create 1G swap /dev/sda3
    • create /dev/sda4 for /var/nst
  • reboot
  • nsthdinstall
nsthdinstall --device /dev/sda2 --format --label "NST v1.8.0-2" --swap-devices /dev/sda5 --swap-format-label --grub-install   
nsthdinstall --device /dev/sda1 --format --label "NST v1.8.0-1" --swap-devices /dev/sda5 --grub-install       (waste of time to format the swap partition 2x)
  • reboot to HD.
  • Login with nst default password.
  • Create var partition, and move var to it:
mke2fs -c /dev/sda4
mkdir /newvar
mount /dev/sda4 /newvar
cd /var
cp -ax * /newvar
cd /
mv var oldvar
mkdir var
  • Edit /etc/fstab to add
/dev/sda4            /var              ext2            defaults                        1 2
  • reboot

if you are not booting from the correct partition:

boot, when the grub menu is showing hit c for command mode
root (hd0,0)
setup (hd0)
this tells grub to use the boot menu (/boot/grub/menu.lst) on disk 0 partition 0 
the second line is to write the changes to the Master Boot Record on hd0

Set Host Name

nsthostname -n nprobe9

NIC Setup

Set up 3 nics. On my particular system, I used two PCI cards (eth0 and eth1) as probes and the onboard nic (eth2) as the management port

  • cdnet
    • Set probe ports eth0 and eth1 to static
    • Set management port eth2 (the onboard nic) to static, and set ip address 10.<campus>.1.6


[root@nprobe9 network-scripts]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
# PROBE PORT 3com NIC
[root@nprobe9 network-scripts]# cat ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
# PROBE PORT 3com NIC #2
[root@nprobe9 network-scripts]# cat ifcfg-eth3
DEVICE=eth3
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.9.1.6
GATEWAY=10.9.1.1
NETMASK=255.255.255.0
BROADCAST=10.9.1.255
NETWORK=10.9.1.0
# onboard nic management interface

System Time Sync

Sometimes when using a VMWare session the time will slow down or perhapes speed up. To correct this just
follow these steps.
- While in X, open a bash prompt and create a script file with a .sh extension in the root directory.
- In the script add the line, "/usr/bin/rdate -s time.chu.nrc.ca". For a list of time servers check this
- don't forget to set it as executable chmod +x /timekeeper.sh 
  link here.
- Open /etc/crontab and add "*/1 * * * root sh timekeeper.sh" (make sure you put the name of the file you
  made earlier.
- Restart the crond service with "/sbin/service crond restart" and the time will now sync every minute.