Your Ad Here

Sunday, December 5, 2010

Boot Disk Mirroring Using Solaris Volume Manager Software

Applicable OS Version: Solaris 9 Operating System (OS), Solaris 8 OS with Solstice DiskSuite 4.2.1 Software with Patch 108693-06 (SPARC Platform Edition)
Note: I do not guarantee that this will work as it is for every one. Please tweak as needed.
The following steps might have used random controllers and targets. They might vary from host to host.
Also, it's a good idea to mirror across controllers instead of mirroring across the same controller and still having the controller as a single point of failure.
1) Important precaution:
Copy /etc/vfstab and /etc/system before you go ahead:
cp -p /etc/system /etc/system.orig."date"

cp -p /etc/vfstab /etc/vfstab.orig."date"


In case /etc/system gets messed up, we can still use the command boot -a from the OK prompt and specify by using:
/etc/system.orig."date"

2) Make sure that you have an extra disk to mirror the root disk and there is no data on it.
3) Create a small slice of 25 Mbyte (10 Mbyte is also fine) for storing volume databases on the "rootdisk" and label the disk.
If you don't have any space on your root disk, create a small slice by deleting and re-adding swap space.
Make sure that there is not a lot of activity on the box while you do this.
3.1) To list your swap, use: swap -l
(It's good if you have more than one slice configured as swap.)
3.2) Execute:
swap -d swap-name ( /dev/dsk/c?ct?d?s?)


Change your partition table to incorporate a new slice by reducing the size or cylinder length of the swap partition.
3.3) Execute:
swap -a swap-name ( /dev/dsk/c?t?d?s?) 

4) The VTOC (volume table of contents) on the root disk and root mirror must be the same. Copy the VTOC using prtvtoc and fmthard.
# prtvtoc /dev/rdsk/c?t?d?s2 | fmthard -s - /dev/rdsk/c?t?d?s2


5) Create metadatabases on the small slice created on rootdisk:
# metadb -f -a -c3 c?t?d?s6 (Slice 6 is my small slice here)
# metadb -a -c3 c?t?d?s6 (Slice 6 on rootmirror)

6) Now we can create a mirror for each and every slice in the partition table.
For root or / partition:
# metainit -f d10 1 1 c?t?d?s? 

# metainit d20 1 1 c?t?d?s?

(create a md d0 and attach one submirror)
# metainit d0 -m d10 

(set up system files for root (/) metadevice, that is, 
     changes to /etc/system and /etc/vfstab)
# metaroot d0 

# lockfs -fa (clear improper file locks on all mounted UFS file systems) 


7) Naming convention for other metadisks follow. (Note for those who are new to this software: We will not do metaroot and lockfs steps on other file systems.)
The submirrors will be named d10d20, and so on.
In d10, 1 is the submirror number, and 0 is the slice number.
If we have swap on partition/slice 1, we would do this:
# metainit -f d11 1 1 c?t?d?s1

# metainit d21 1 1 c?t?d?s1

# metainit d1 -m d11

8) Repeat for as many file systems you have on your boot disk.
9) Make changes to your /etc/vfstab. The md entry for root will already be updated by the metaroot command.
A sample copy of /etc/vfstab looks like this:
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
##/dev/dsk/c1t1d0s1 - - swap - no -
/dev/md/dsk/d1 - - swap - no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -
##/dev/dsk/c1t1d0s7 /dev/rdsk/c1t1d0s7 /export/home ufs 2 yes -
/dev/md/dsk/d7 /dev/md/rdsk/d7 /export/home ufs 2 yes -
##/dev/dsk/c1t1d0s3 /dev/rdsk/c1t1d0s3 /opt/uc4 ufs 2 yes -
/dev/md/dsk/d3 /dev/md/rdsk/d3 /opt/uc4 ufs 2 yes -
swap - /tmp tmpfs - yes -


10) Configure your dump device using dumpadm.
11) Make the following entry in the /etc/system file, in the mdd info section:
set md:mirrored_root_flag=1

When the root disk becomes unavailable, the database copies stored on the root disk are also unavailable.
Solaris Volume Manager software expects more than 50 percent of the databases to be available to boot up normally or else it may complain about the insufficient number of database replicas. The preceding change is made in order for Solaris Volume Manager software to boot up with at least 50 percent of the copies.
12) Execute:
sync; sync; init 6


13) Once the system comes up, attach the other submirror:
# metattach d0 d20

(Note: It's "metattach" and not "metaattach")
# metattach d1 d21 


and so on.
14) To see whether the FS syncing is done or not, do this:
metastat | grep progress 

15) Determine the device path to the boot devices for both the primary and mirror:
ls -l /dev/dsk/c1t1d0s0 /dev/dsk/c1t0d0s0
lrwxrwxrwx 1 root root 43 Dec 23 17:51 /dev/dsk/c1t0d0s0 -> \
   ../../devices/pci@1c,600000/scsi@2/sd@0,0:a
lrwxrwxrwx 1 root root 43 Dec 23 17:51 /dev/dsk/c1t1d0s0 -> \
   ../../devices/pci@1c,600000/scsi@2/sd@1,0:a

# eeprom "nvramrc=devalias rootdisk /pci@1c,600000/scsi@2/disk@1,0 
devalias rootmirror /pci@1c,600000/scsi@2/disk@0,0"


(Please note the change "sd" to "disk" in using ls -l output.)
# eeprom "use-nvramrc?=true"

You can also change the boot-device values so that the system tries to boot from the mirror in case one of them is not available.
# eeprom boot-device="rootdisk rootmirror net"


16) Once the syncing is complete, test your system by removing the root disk.

Recovering a Bad Sector Disk on the Solaris 9 OS

A disk can start creating trouble if sectors on it are bad. We can try to verify and repair the defective sectors. For example, the following message shows that the block 100 is defective:
WARNING: /io-unit@f,e0200000...
   Error for command 'read' Error Level: Retryable
   Requested Block 243, Error Block 100
   Sense Key: Media Error
   Vendor ...
   ASC = 0x11 (unrecovered read error) ...


We can try to take corrective action by performing a surface scan analysis. First we need to unmount all slices on the defective disk and then invoke the format utility. (Note: This example shows only s0 mounted on target 2.)
# umount /dev/dsk/c0t2d0s0 
# format

When we are asked to select the disk, provide the number:
Specify disk (enter its number): 1
selecting c0t2d0:
[disk formatted]
Warning: Current Disk has mounted partitions.


Now we should invoke the analyze menu and provide the parameters as asked:
format> analyze
analyze> setup
Analyze entire disk [yes]? n
Enter starting block number [0, 0/0/0]: enter start block
Enter ending block number [2052287, 2035/13/71]: enter end block
Loop continuously [no]: y
Repair defective blocks [yes]: n
Stop after first error [no]: n
Use random bit patterns [no]: n
Enter number of blocks per transfer [126, 0/1/54]: 1
Verify media after formatting [yes]: y
Enable extended messages [no]: n
Restore defect list [yes]: y
Create defect label [yes]: y

analyze> read
Ready to analyze (won't harm SunOS). This takes a long time,
but is interruptible with Control-C. Continue? Y
   pass 0
   ...
   pass 1
   block 100, Corrected media error (hard data ecc)
   ...
   Total of 1 defective blocks repaired.

Now we have found the absolute block number of the defective block on the disk, and we will repair it.
analyze> q
format> repair
Enter absolute block number of defect: 100
Ready to repair defect, continue? y
Repairing block 100 ...ok.
format> q

Changing Hostname on RHEL

1. Change the ^HOSTNAME line in /etc/sysconfig/network

2. Change the hostname (FQDN and alias) in /etc/hosts

3. Run /bin/hostname new_hostname for the hostname change to take effect immediately.

4. Run /sbin/service syslog restart for syslog to log using the new hostname.

A reboot is not required to change the system hostname.

Thursday, December 2, 2010

Understanding /proc/cpuinfo

 Example:

$ uname -r
2.6.18-8.el5

How many physical processors are there?

$ grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l
2

How many virtual processors are there?

$ grep ^processor /proc/cpuinfo | wc -l
4

Are the processors dual-core (or multi-core)?

$ grep 'cpu cores' /proc/cpuinfo
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2

"2" indicates the two physical processors are dual-core, resulting in 4 virtual processors.

If "1" was returned, the two physical processors are single-core. If the processors are single-core, and the number of virtual processors is greater than the number of physical processors, the CPUs are using hyper-threading. Hyper-threading is supported if ht is present in the CPU flags and you are using an SMP kernel.

Are the processors 64-bit?

A 64-bit processor will have lm ("long mode") in the flags section of cpuinfo. A 32-bit processor will not.

flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8legacy ts fid vid ttp tm stc

Changing IP address

The following steps may be used to change the IP address of a Solaris system.

  • Change the host's IP in /etc/hosts for the change to take effect after reboot. If you are using Solaris 10, you must also change the host's IP in /etc/inet/ipnodes for the change to take effect after reboot.
  •  Run ifconfig interface ip_address netmask broadcast_address for the IP address change to take effect immediately. The netmask and broadcast_address should be specified if you are using variable length subnet masks (VLSM), but may be omitted otherwise.
  • If you are using variable length subnet masks (VLSM), add the host's network number and subnet mask to /etc/netmasks.
If the new IP address places the system on a different network:
  • Place the host's new default gateway in /etc/defaultrouter
  • Run route add default new_gateway for the new default gateway to take effect immediately.
  • Run route delete default old_gateway to delete the old default gateway from the routing table.

Creating a Flash archive

1. If the root disk is encapsulated by Veritas Volume Manager (VxVM), unencapsulate it before continuing.

2. I recommend booting to single-user mode, as you generally do not want to include NFS mounts or other file systems mounted in later run levels as part of your Flash archive.


#reboot -- -s
3. Create the Flash archive.

flarcreate -n name -a author -S -c archive_name
eg: flarcreate -n "Solaris 9 image" -a "shiroy" /var/tmp/sol8.archive

Notes:
flarcreate will not determine the size of the archive beforehand when using the -S flag. Personally, I have seen flarcreate take an inordinate amount of time calculating the size of the archive.The -c flag enables archive compression via the compress command.

4. If applicable, re-encapsulate the rootdisk with the vxdiskadm command. Reboot the system for the encapsulation to take effect.

NixCraft – Linux Administration

Here is a great Linux Admin blog with plenty of content for the both the beginner and the advanced Linux Admin. The name of the blog is nixCraft and it has been in my RSS reader for a while, and I wanted to share with you a couple of the scripts and links that I pulled out and have used.

The first is a quick and easy MySql database backup that you can put in cron to backup your MySql database. Many open source projects use MySql and it always pays to have a backup especially when upgrading, so take a look at this post called backing up your mysql database server.
The second script is a rsync replication script that we can use between a couple of clustered web servers. The script is called resync backup replication script.
And the last example is for the beginner administrator. This post identifies a number of Unix/Linux commands and cheat sheets that was worthwhile to the new administrator.
If you are into Linux from a support or development perspective than I encourage you to take a look at the nixCraft site as I am sure that you will find something useful.

Friday, November 26, 2010

How can I create a disk partition on a disk that is greater than 2TB in size?

  • The fdisk command only supports the legacy MBR partition table format (also known as msdos partition table)
    • MBR partition table do not support disks greater than 2.1TB, and therefore fdisk is also unable to create partition tables on these devices.
    • Note that some older versions of fdisk may permit a larger size to be created but the resulting partition table will be invalid.
  • The parted command can create disk labels using MBR (msdos), GUID Partition Table (GPT), SUN disk labels and many more types.
    • The GPT disk label overcomes many of the limitations of the DOS MBR including restrictions on the size of the disk, the size of any one partition and the overall number of partitions.
    • Note that booting from a GPT labelled volume requires firmware support and this is not commonly available on non-EFI platforms (including x86 and x86_64 architectures).

    Procedure:
  • Use the parted tool to access the partition table of the device:
    # parted /dev/sdj
    Using /dev/sdj
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted)
    
    
  • Once at the parted prompt, create a GPT label on the disk:
    (parted) mklabel
    Warning: The existing disk label on /dev/sdj will be destroyed and all data on this disk will be lost. Do you want to continue?
    Yes/No? Yes                                                                 
    New disk label type?  [gpt]? gpt                                          
    (parted)
    Note: This will remove any existing partition table and partitions on the device.
  • Use the print command to show the size of the disk as reported by parted.  We need this later:
    (parted) print                                                            
    
    Model: Linux device-mapper (dm)
    Disk /dev/sdj: 5662310.4MB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    
    Number  Start  End  Size  File system  Name  Flags
    
    
  • Create a primary partition on the device.  In this example, the partition will encompass the entire disk (using size from the step above):
    (parted) mkpart primary 0 5662310.4MB
    
    
  • Unlike fdisk, you do not have to write out the partition table changes with parted.  Display your new partition and quit.
    (parted) print
    
    Model: Linux device-mapper (dm)
    Disk /dev/mapper/VolGroup00-gpttest: 5662310.4MB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    
    Number  Start   End          Size         File system  Name     Flags
     1      17.4kB  5662310.4MB  5662310.4MB               primary       
    
    (parted) quit                                                             
    Information: Don't forget to update /etc/fstab, if necessary.
    
    
  • You can now create a filesystem on the device /dev/sdj1

Tuesday, April 13, 2010

Which communication ports does Symantec Endpoint Protection 11.0 use?

The Symantec Endpoint Protection Manager (SEPM) use two web servers: Internet Information Services (IIS) and Tomcat. IIS uses port 80 (or 8014) and 443 - Tomcat uses port 9090 and 8443. The communication between IIS and Tomcat uses the HTTP protocol. IIS uses port 9090 to talk to Tomcat, Tomcat uses port 80 to talk to IIS.


Client-Server Communication:
For IIS SEP uses HTTP or HTTPS between the clients or Enforcers and the server. For the client server communication it uses port 80 (or 8014) and 443 by default. In addition, the Enforcers use RADIUS to communicate in real-time with the manager console for clients authentication. This is done on UDP port 1812.


Remote Console:
9090 is used by the remote console to download .jar files and display the help pages.
8443 is used by the remote console to communicate with SEPM and the Replication Partners to replicate data.


Client-Enforcer Authentication:

The clients communicate with the Enforcer using a proprietary communication protocol. This communication uses a challenge-response to authenticate the clients. The default port for this is UDP 39,999.

View System Logs Live

If you want to monitor the system logs in a live environment, you can use the tail command with an option -f or -F.
This will work in any Linux/UNIX environment.
To exit from the view, you can use Ctrl + C. The same option can be used with any text based files to find the updation to the file in live environment.

Usage:

# tail -f /var/log/messages

or

# tail -F /var/adm/messages


tail -f will work as long as the underlying file we’re trying to read doesn’t change. If you’re trying to read a link to a file and the original file (and thus the link) changes, tail -f will not work.

For that reason, its better to use tail -F for such files as described above … or tail -f –retry

How Network Access Controls Work?

Network access control is the process of restricting the access to network resources by devices that are used by the end user. Network access controls implement a defined security policy for access which is supported by a network access server that performs the authentication and authorization. The server also restricts the data that each user can access, as well as the activities that can be performed by the end user once they gain access to the network.




How Network Access Controls Work

There are several different types of network access controls that perform different functions according to the needs of the organization and the level of security that is required for performing daily functions.



•Agent-Based Network Access Control: An agent-based network access control operates through the endpoint device (user's device) which provides a higher level of security and ensures that the end-user is complying with security policies. The unit continually operates in the background of the device to monitor security compliance and then sends periodic updates to the policy server.

•Agentless Network Access Control: An agentless network access control does not require any added installations. Instead this type of network access control assesses compliancy on both endpoints before the user is allowed to access the network. The problem with this type of network access control is that authorization is provided through the assessment of network traffic. This makes the application easier to exploit to gain unauthorized access to the network system.

•Hardware-Based Network Access Control: A hardware-based network access control works through an appliance that is installed on the network and functions in conjunction with the network traffic. This type of network access control requires changes in the infrastructure and operational practices to allow for defined access by the end user. Because implementation requires significant server configuration changes, the chances of failure are greater than other network access control systems.•Dynamic Network Access Control: Dynamic network access control is the easiest form of deployment for controlling access by end users. This is because the system does not require any software or hardware appliance installation or changes in the network configuration. Instead a dynamic network access control works on specific computers that are connected to a local area network and are considered to be trusted systems. When an unauthorized user attempts to access the network, the trusted systems will restrict access and then communicate the action to the main policy server.

The type of network access control you choose for your organization depends upon your network configuration and set up. Before choosing an option that suits your organization, it is necessary to evaluate the network configuration and the different reasons for defining access by the end users.

Run Levels of various Operating Systems

The term runlevel refers to a mode of operation in one of the computer operating systems that implement Unix System V-style initialization. Conventionally, seven runlevels exist, numbered from zero to six; though up to ten, from zero to nine, may be used. S is sometimes used as a synonym for one of the levels.




In standard practice, when a computer enters runlevel zero, it halts, and when it enters runlevel six, it reboots. The intermediate runlevels (1-5) differ in terms of which drives are mounted, and which network services are started. Lower run levels are useful for maintenance or emergency repairs, since they usually don’t offer any network services at all. The particular details of runlevel configuration differ widely among operating systems, and slightly among system administrators.



The runlevel system replaced the traditional /etc/rc script used in Version 7 Unix.



Run Levels in Solaris

S, s

Single user mode. Doesn’t require properly formated /etc/inittab. Filesystems required for basic system operation are mounted.



0

Go into firmware (sparc)



1

System Administrator mode. All local filesystems are mounted. Small set of essential system processes are running. Also a single user mode.



2

Put the system in multi-user mode. All multi-user environment terminal processes and daemons are spawned.



3

Extend multi-user mode by making local resources available over the network.



4

Is available to be defined as an alternative multi-user environment configuration. It is not necessary for system operation and is usually not used.



5

Shut the machine down so that it is safe to remove the power. Have the machine remove power, if possible.



6

Reboot



a, b, c

Process only those /etc/inittab entries having the a, b, or c run level set. These are pseudo-states, which may be defined to run certain commands, but which do not cause the current run level to change.



Q, q

Re-examine /etc/inittab.



Run Levels in HP-UX

0

System is completely shut down. All processes are terminated and all file systems are unmounted.



1,s,S

Single-user mode. All system services and daemons are terminated and all file systems are unmounted.



2

Multi-user mode, except NFS is not enabled.



3

Multi-user mode. This is the normal operational default state. NFS is enabled.



4

Multi-user mode with NFS and VUE. (VUE is HP’s desktop, kinda like CDE)



6

Reboot.



Run Levels in OpenBSD

-1

Permanently insecure mode – always run system in level 0 mode.



0

Insecure mode – immutable and append-only flags may be changed. All devices may be read or written subject to their permissions.



1

Secure mode – system immutable and append-only flags may not be turned off; disks for mounted filesystems, /dev/mem, and /dev/kmem are read-only.



2

Highly secure mode – same as secure mode, plus disks are always read-only whether mounted or not and the settimeofday(2) system call can only advance the time.



Run Levels in ULTRIX, Digital UNIX / Tru64

0

System is completely shut down. All processes are terminated and all file systems are unmounted.



1

Single-user mode. All system services and daemons are terminated and all file systems are unmounted.



2

Multi-user mode, except NFS is not enabled.



3

Multi-user mode. This is the normal operational default state. NFS is enabled.



4

Not Used



5

Not Used



6

Reboot



Run Levels in Irix

0

Shut the machine down so it is safe to remove the power. Have the machine remove power if it can.



1

Put the system into system administrator mode. All filesystems are mounted. Only a small set of essential kernel processes run. This mode is for administrative tasks such as installing optional utilities packages. All files are accessible and no users are logged in on the system.



2

Put the system into multi-user state. All multi-user environment terminal processes and daemons are spawned. Default.



3

Start the remote file sharing processes and daemons. Mount and advertise remote resources. Run level 3 extends multi-user mode and is known as the remote-file-sharing state.



4

Define a configuration for an alternative multi-user environment. This state is not necessary for normal system operations; it is usually not used.



5

Stop the IRIX system and enter firmware mode.



6
Stop the IRIX system and reboot to the state defined by the initdefault entry in inittab.



a,b,c

Process only those inittab entries for which the run level is set to a, b, or c. These are pseudo-states that can be defined to run certain commands but do not cause the current run level to change.



Q,q

Re-examine inittab.



S,s

Enter single-user mode. When the system changes to this state as the result of a command, the terminal from which the command was executed becomes the system console.



Run Levels in SYSV

The following is from a SYSV text book, it’s the generally used run level for SYSV systems.



0

Power-down state. Shuts machine down gracefully so that it can be turned off. Some models turn off automatically.



s

Single user state. This run level should be used when installing or removing software utilities, checking file systems, or using Maintenance (/install) file system. It is similar to run level 1; however, in run level s, multi-user file systems are unmounted and daemons are stopped. The terminal issuing the init s becomes the console.



1

Administrative state. In run level 1, file systems required for multi-user operations are mounted. And loggias requiring access to multi-user file systems can be used.



2

Multi-user state. File systems are mounted and normal user services are started.



3

Network File System (NFS) state. Prepares your system to use NFS.



4

User-defined



5

Virtually the same as System State 6. See /sbin/rc0 script for details. Early versions of UNIX used this as an entry to a firmware interface.



6

Power-down and reboot to the state defined by the initdefault entry in the /etc/inittab file.



Run Levels in Linux

0

Halt the system.



1

Single-user mode.



2-4

Multi-user modes. Usually identical. Level 2 or 3 is default (dependent on distro).



5

Multi-user with graphical environment. This applies to most (but not all) distros.



6

Reboot the system and return to default run level.

Booting microchannel systems into Service mode

To boot microchannel systems into Service mode, turn the key to the Maintenance position and press the yellow reset button twice. You must boot from bootable media, such as an installation CD-ROM, installation tape, or a bootable backup tape made via the mksysb command or the Sysback product of the correct level for this machine.




For AIX Version 3.2, you may use bootable bosboot diskettes. To boot from these, insert the first bosboot diskette into the diskette drive. When you see LED c07, insert the next diskette, which is usually the display extensions diskette. After this diskette is read, you should receive a menu prompting you for the installation diskette.



For information on accessing your rootvg volume group, see the section entitled “Accessing rootvg and mounting file systems”.

The preceding discussion assumes that the Service mode bootlist has not been modified from the default bootlist. If the bootlist has been modified, it must be reset such that one of the boot media types from the preceding selections is before the standard boot media, such asthe hard disk.



If the machine is an SMP model (7012-Gxx, 7013-Jxx, and 7015-Rxx) and the Autoservice IPL flag is disabled, then a menu like the following will display when it is booting in Service mode:

MAINTENANCE MENU (Rev. 04.03)

0> DISPLAY CONFIGURATION

1> DISPLAY BUMP ERROR LOG

2> ENABLE SERVICE CONSOLE

3> DISABLE SERVICE CONSOLE

4> RESET

5> POWER OFF

6> SYSTEM BOOT

7> OFF-LINE TESTS

8> SET PARAMETERS

9> SET NATIONAL LANGUAGE

SELECT:

You can boot these machines into Service mode or even Normal mode with the Fast IPL Flag set. If you do not, the machine can take anywhere from 30 to 60 minutes to boot up. There are a few ways to set the Fast IPL Flag for these machines.

NOTE: The console must be an ASCII type and connected to the S1 port of the system. Graphic monitors will not work.

Use the following instructions to boot SMP machines into service with Fast IPL set.

1. Insert the bootable media of the same OS Level. Use the mksysb/cd-rom command.

2. Turn off the machine by pressing the white button on front.

3. Turn the key to the Wrench or Service position.

4. The LCD should read STAND-BY.

5. Press the Enter key on the console.

6. A greater-than prompt (>) should display on the monitor.

7. Type in sbb followed by the Enter key.

8. The menu Stand By Menu should now display.

9. Select 1 Set Flags. This will take you to another set of menus.

10. Select 6 Fast IPL. This should change to enable after it is selected.

11. Enter x to exit the second set of menus.

12. Enter x to exit the first menu.

13. At a blank screen, press the Enter key to obtain the greater-than prompt (>).

14. Type in the word power followed by the Enter key.

15. Turn the machine back on. It should start to boot up. A prompt may display asking if you want to update the firmware. Do not respond; let it continue.

16. Now you may be at the Maintenance Menu with 10 options displayed, 0 through 9. If that is the case, select option 6, System Boot. This will take you to another menu. Select option 0, Boot from the list.

17. The Standard Maintenance Menu should display. System recovery and maintenance can be completed from here.

18. After system recovery and maintenance has been performed, the system is ready to be rebooted into Normal mode. Enter the command mpcfg -cf 11 1 at the command line prompt, then press Enter. This will set the Fast IPL Flag. The system is ready to reboot.

19. Turn the key back to the OK/Normal position.

20. Enter shutdown -Fr, followed by the Enter key.

________________________________________

Booting PCI-based systems into Service mode

When booting a PowerPC into Service mode, cd0 or rmt0 must be before the hdisk in the bootlist. If not, change the bootlist at boot time. On some models, you can set the machine to use a default bootlist that includes both cd0 and rmt0. If a bootable CD or tape is in the CD-ROM or tape drive, the machine will boot from this device.

For most of the newer PCI-based models, selecting the default bootlist, with a bootable tape or CD loaded in the machine, causes the system to automatically boot from that device. Generally, the next menu on the screen asks the administrator to define the system console.

For all machines discussed here, if you are using a graphical terminal, you will use a function key such as F5. If you are using an ASCII terminal, use an equivalent number key such as 5. Use the numbers across the top of the keyboard, not the numbers on the numeric keypad. On ASCII terminals, the icons may not be displayed on the screen; the number can be pressed between the second and third beeps, the second beep being a series of three clicks.

________________________________________

PCI machine-specific information

The following systems all use the F5 or 5 key to read from the default boot list, which is written into the system firmware:

MODEL 7017 7024 7025 7026 7043 7137

——- ——- ——- ——- ——- ——- ——-

TYPE S70 E20 F30 H10 43P-140 F3L

S7A E30 F40 H50 43P-150

S80 F50 H70 43P-240

B80 43P-260

On these machines, use 5 (on the keyboard, not the keypad) if you are using an ASCII terminal. On a locally attached graphics console, use the F5 function key. The F5 or 5 key must be pressed just after the keyboard icon or message is displayed on the console. If you have either a 7026-M80, 7026-H80 or a 7025-F80, then the 5 key will be the default whether you have an ascii or graphics console.

The following systems use the F1 key to enter System Management Services mode (SMS):

MODEL 6040 7042 7247 7249

——- ——- ——- ——- ——-

TYPE 620 850 82x 860

You should be in an Easy-Setup menu. Select the Start Up menu. Clear the current bootlist settings and then select the CD-ROM for choice 1 and hdd (the hard disk) for choice 2. Select OK. Insert the CD-ROM and select the EXIT icon. The machine should now boot from the CD-ROM.

The following systems use the F2 key to enter SMS:

MODEL 6015 6050 6070 7020 7248

——- ——- ——- ——- ——- ——-

TYPE 440 830 850 40P 43P

Select Select Boot Device from the initial menu on the screen, and then select Restore Default Settings from the list. Press the Esc key to exit all the menus, and then reboot the machine. The system should boot from your bootable media.

For information on accessing the rootvg volume group, see the next section in this document.

________________________________________

Accessing rootvg and mounting file systems

For AIX Version 3, choose the limited function maintenance shell (option 5 for AIX 3.1, option 4 for AIX 3.2).

If you only have one disk on the system, then hdisk0 will be used in the execution of the getrootfs or /etc/continue commands, which follow. If you have more than one disk, determine which disk contains the boot logical volume in this manner:

AIX 3.2.4 or AIX 3.2.5:

Run getrootfs; the output will indicate which disk contains the hd5 logical volume.

AIX 3.1 to AIX 3.2.3e:

Run lqueryvg -Ltp hdisk# for each hdisk. You can obtain a listing of these with the command lsdev -Cc disk. Repeat this command until you get output similar to the following:

00005264feb3631c.2 hd5 1

If more than one disk contains this output, use any disk when running getrootfs.

Now, access the rootvg volume group by running one of the following commands, using the disk you obtained in the preceding step:

AIX 3.1: /etc/continue hdisk#

AIX 3.2.0-3.2.3e: getrootfs -f hdisk#

AIX 3.2.4-3.2.5: getrootfs hdisk#

NOTE: If you want to leave the primary OS file systems (/, /usr, /tmp, and /var) unmounted after this command has completed, to run fsck, for instance, place a space and the letters sh after the hdisk in the preceding command. For example:

getrootfs hdisk0 sh

For AIX Versions 4 and 5, choose Start Maintenance Mode for System Recovery , option 3. The next screen will be called Maintenance; select option 1, Access a Root Volume Group. At the next screen, type 0 to continue, and select the appropriate volume group by typing the number next to it. A screen like the following will display.

Example:

Access a Root Volume Group

Type the number for a volume group to display the logical volume information and press Enter.

1) Volume Group 0073656f2608e46a contains these disks:

hdisk0 2063 04-C0-00-4,0

Once a volume group has been selected, information will be displayed about that volume group.

Example:

Volume Group Information

——————————————————————————

Volume Group ID 0073656f2608e46a includes the following logical volumes:

hd6 hd5 hd8 hd4 hd2 hd9var

hd3 hd1

——————————————————————————

Type the number of your choice and press Enter.

1) Access this Volume Group and start a shell

2) Access this Volume Group and start a shell before mounting filesystems

99) Previous Menu

If the logical volumes listed do not include logical volumes like hd4, hd2, hd3, and so on, you may have selected the wrong volume group. Press 99 to back up one screen and select again.

Now you may select one of two options: Access this volume group and start a shell , option 1, or Access this volume group and start a shell before mounting file systems , option 2. Option 2 allows you to perform file system maintenance on /, /usr, /tmp, and /var before mounting them.

NOTE: If you intend to use SMIT or vi, set your terminal type in preparation for editing the file. xxx stands for a terminal type such as lft, ibm3151, or vt100.

TERM=

export TERM

Errors from these steps may indicate failed or corrupt disks in rootvg. These problems should be corrected. For additional assistance, contact your vendor, your local branch office, or your AIX support center.

________________________________________

Known problems

NOTE: Ensure you are using an original AIX base media to boot from, rather than a burned copy.

You may receive the following error when trying to access rootvg in service mode at AIX 5.1:

Examine .loader section symbols with the ‘dump -Tv’ command.

Could not load program /usr/bin/ksh: Symbol resolution failed for /usr/lib/libc.a (shr.o)

because: OID Symbol getvtid (number 258) is not exported from dependent RS4

module /unix.

This error is likely due to a mismatch of the boot media and the system’s AIX level.

Solution

Use a non-auto install mksysb from the same system, or use AIX CD media labeled LCD4-1061-04 or higher (9/23/2002, integranted ML03)

________________________________________

Related documentation

For more in-depth coverage of this subject, the following IBM publication is recommended:

AIX Version 4.3 System Management Guide: Operating System and Devices

AIX Version 5.1 System Management Guide: Operating System and Devices

Installing AIX from Tape Backup

The AIX operating system can be installed from a system backup tape created using smitty mksysb




To install AIX from a system backup:

1. Make sure that the tape drive is turned ON.

2. Make sure that the server is turned ON.

3. Open the tape drive door.

4. Turn the key to “Service”.

5. Insert the AIX Operating System backup tape into the tape drive.

6. Close the tape drive door.

7. On the server, press the “Reset” button twice.

If the TESTING COMPLETED screen displays, press [[Enter]] to continue.

Note: For a few minutes the system might appear idle. Do not open the tape drive door. Wait for the next screen to display.

8. The following message displays: “Please define the system Console”

Press [[F1]] to define the system console and then press [[Enter]]. The INSTALLATION AND MAINTENANCE screen appears.

9. Select Install a System that was created with SMIT “Backup The System” function or the “mksysb” command

Press [[Enter]] to install the operating system from the backup tape. The CURRENT SYSTEM SETTINGS screen displays.

10. Verify that the system settings are correct. If the correct settings are displayed, select Install a SMIT “Backup The System” image with the current setting. Press [[Enter]]. The Final Warning screen displays.

11. Select Continue with installation. Press [[Enter]].

12. Press [[Enter]] to start the tape. The installation takes 45 minutes to 1.5 hours.

13. Turn the key to “Normal” before the installation completes. When the installation is complete, a screen displays indicating that the AIX Base Operating System installation is complete.

14. Remove the AIX Operating System backup tape from the tape drive.

15. Press [[Enter]] to reboot the server.

16. During rebooting ignore the following error messages:

The System Resouce Controler daemon is not active. Machine not identical previous configuration. Shutdown, rebooting



Note: If the system used to create the backup tape is not the same as the system on which it is now being installed, the server might reboot two or three times.



Each time the server reboots, the system reconfigures. When the server reboots successfully, a login prompt displays.

Thursday, April 8, 2010

Manage a Linux RAID 10 Storage Server

Linux Software RAID10

Creating RAID Arrays in Linux during installation is an easy task (using the disk druid or any such graphical installers).  it's best to keep your root filesystem out of both RAID and LVM for easier management and recovery.



Linux RAID and Hardware

 

I've seen a lot of confusion about Linux RAID, so let's clear that up. Linux software RAID has nothing to do with hardware RAID controllers. You don't need an add-on controller, and you don't need the onboard controllers that come on most motherboards. In fact, the lower-end PCI controllers and virtually all the onboard controllers are not true hardware controllers at all, but software-assisted, or fake RAID. There is no advantage to using these, and many disadvantages. If you have these, make sure they are disabled.
Ordinary PC motherboards support up to six SATA drives, and PCI SATA controllers provide an easy way to add more. Don't forget to scale up your power and cooling as you add drives.
If you're using PATA disks, only use one per IDE controller. If you have both a master/slave on a single IDE controller, performance will suffer and any failure risks bringing down both the controller and the second disk.

 

GRUB Follies

 

GRUB Legacy's (v. 0.9x) lack of support for RAID is why we have to jump through hoops just to boot the darned thing. Beware your Linux's default boot configuration, because GRUB must be installed to the MBRs of at least the first two drives in your RAID1 array, assuming you want it to boot when there is a drive failure. Most likely your Linux installer only installs it to the MBR of the drive that is first in the BIOS order, so you'll need to manually install it on a secondary disk.
First open the GRUB command shell. This example installs it to /dev/sdb, which GRUB sees as hd1 because it is the second disk on the system:


root@uberpc ~# grub
GNU GRUB version 0.97 (640K lower / 3072K upper memory)

Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.

grub> root (hd1,0)
Filesystem type is ext2fs, partition type 0xfd

grub> setup (hd1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd1)"... 17 sectors are embedded. succeeded
Running "install /boot/grub/stage1 (hd1) (hd1)1+17 p (hd1,0)/boot/grub/stage2 /boot/grub/grub.conf"... succeeded
Done. 


You can do this to every disk in your RAID 1 array. /boot/grub/menu.lst should have a default entry that looks like something like this:

title Ubuntu 7.10, kernel 2.6.22-14-generic, default root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=/dev/md0 ro
initrd /boot/initrd.img-2.6.22-14-generic 


Let's say hd0,0 is really /dev/sda1. If this disk fails, the next drive in line becomes hd0,0, so you only need this single default entry.
GRUB sees PATA drives first, SATA drives second. Let's say you have two PATA disks and two SATA disks:

/dev/hda
/dev/hdb
/dev/sda
/dev/sdb


GRUB numbers them this way:

hd0
hd1
hd2
hd3

If you have one of each, /dev/hda=hd0, and /dev/sda=hd1. The safe way to test your boot setup is to power off your system and disconnect your drives one at a time.

 

Managing Linux RAID With mdadm

 

There are still a lot of howtos on the Web that teach the old md command and raidtab file. Don't use these. They still work, but the mdadm command does more and is easier.

 

Creating and Testing New Arrays

 

Use this command to create a new array:


# mdadm -v --create /dev/md1 --level=raid10 --raid-devices=2 /dev/hda2 /dev/sda2

You may want to have a hot spare. This is a partitioned, formatted hard disk that is connected but unused until an active drive fails, then mdadm (if it is running in daemon mode, see the Monitoring section) automatically replaces the failed drive with the hot spare. This example includes one hot spare:


# mdadm -v --create /dev/md1 --level=raid10 --raid-devices=2 /dev/hda2 /dev/sda2 --hot-spares=1 /dev/sdb2

 
You can test this by "failing" and removing a partition manually:


# mdadm /dev/md1 --fail /dev/sda2 --remove /dev/sda2

 
Then run some querying commands to see what happens.
When you have more than one array, they can share a hot spare. You should have some lines in /etc/mdadm.conf that list your arrays. All you do is create a share group by adding lines as shown in bold:
 

ARRAY /dev/md0 level=raid1 num-devices=2 UUID=004e8ffd:05c50a71:a20c924c:166190b6
shared-group=share1
ARRAY /dev/md1 level=raid10 num-devices=2 UUID=38480e56:71173beb:2e3a9d03:2fa3175d
shared-group=share1


View the status of all RAID arrays on the system:
 

$ cat /proc/mdstat
Personalities : 'linear' 'multipath' 'raid0' 'raid1' 'raid6' 'raid5' 'raid4' 'raid10'
md1 : active raid10 hda2'0' sda2'1'
6201024 blocks 2 near-copies '2/2' 'UU'

md0 : active raid1 hda1'0' sda1'1'
3076352 blocks '2/2' 'UU'

The "personalities" line tells you what RAID levels the kernel supports. In this example you see two separate arrays: md1 and md0, that are both active, their names and BIOS order, and the size and RAID type of each one. 2/2 means two of two devices are in use, and UU means two up devices.

You can get detailed information on individual arrays:


# mdadm --detail /dev/md0
Is this partition part of a RAID array? This displays the contents of the md superblock, which marks it as a member of a RAID array:

# mdadm --examine /dev/hda1
You can also use wildcards, like mdadm --examine /dev/hda*.

 

Monitoring

 

mdadm itself can run in daemon mode and send you email when an active disk fails, when a spare fails, or when it detects a degraded array. Degraded means a new array that has not yet been populated with all of its disks, or an array with a failed disk:
 
# mdadm --monitor --scan --mail=shiroy.p@hcl.in --delay=2400 /dev/md0

Your distribution may start the mdadm daemon automatically, so you won't need to run this command. Kubuntu controls it with /etc/init.d/mdadm, /etc/default/mdadm, and /etc/mdadm/mdadm.conf, so all you need to do is add your email address to /etc/mdadm/mdadm.conf.

 

Starting, Stopping, and Deleting RAID

 

Your Linux distribution should start your arrays automatically at boot, and mdadm starts them at creation. 
This command starts an array manually:

 # mdadm -A /dev/md0

This command stops it:

# mdadm --stop /dev/md0

You'll need to unmount all filesystems on the array before you can stop it.
To remove devices from an array, they must first be failed. You can fail a healthy device manually:

# mdadm /dev/md1 --fail /dev/sda2 --remove /dev/sda2

If you're removing a healthy device and want to use it for something else, or just want to wipe everything out and start over, you have to zero out the superblock on each device or it will continue to think it belongs to a RAID array:

# mdadm --zero-superblock /dev/sda2

Adding Devices

You can add disks to a live array with this command:

# mdadm /dev/md1 --add /dev/scd2

This will take some time to rebuild, just like when you create a new array.
That wraps up ourtour of RAID 10 and mdadm.

 

Resources

 

     
Visit my BLOG