Now in Tamil தமிழ்

Now you can read this blog in Tamil தமிழ், thanks to Google by clicking here . You can view in other languages too.

Watchout for mistakes in translation of technical posts. தொழில்நுட்ப பதிவுகளின் மொழிபெயர்ப்பில் பிழைகளை எதிர்பார்க்கவும்.

Note : Posts are getting summarized in categories view.

Posts are getting summarized in categories view. You have to open the post, to view it completely in proper format.

All ye anarchist who feeleth bound – Thou shalt dwell happily in India

Yes, I’m ashamed to say this about my own nation. But that’s the bitter truth. Its been this way for around 60 years and won’t change because of corruption starting from any minor government(nowadays even private) employee/security to the shameless politicians who are hardwired to get heart-attack when accused. Seriously, I don’t understand what good is crores and crores of money when you are in jail, and the money may not be yours anymore, your children do not have any moral (they would have had if you spent time on them and been a good example). You would have given the title “A theif’s son” and let your children to fend for themselves. Its all a gamble of getting caught or not. It means you either have a short term wealthy future(yes, its not cheap to protect illegal wealth, so it will eat itself up very quickly) or no future at all. I’d say its foolish to gamble on your future. Now that’s kind of opposite to what securing your future means. But people never learn the benifits of living honestly peacefully even after seeing bad examples.

If anybody is angry about my comment on India, you can slap me after India is free from corruption – see my confidence ? Its the same confidence the law-breakers have. Just because I’m angry on corruption, you can’t judge that I’m pure. Everybody here in India is forced to break the rules.

For example, you stop in the traffic at red signal, no ambulance behind, there’s a van behind you, he’s honking, you try to see if anybody is crossing, by this time everybody is shouting at you for “blocking” their way. What would you do ? If everybody thinks you are a fool for following a rule, they must be right, right ? I for one, did not move because I saw a bike approaching – green signal for him. Now the van guy  behind me decided his threatening van with its horn and size and his swear words were not enough, so he nudged my bike. So I crossed without the signal, got scolding from the bike guy also, but I was very late for a meeting, so I kept going and did’nt care to catch up the van and …. . Now this does’nt mean I’m always a law abiding citizen, just pushed to the corner by others.

You know, if you can’t beat them, join them. But why are we Indians like this? Why we never care for the law and order? I guess I know. My helmet got wet in rain last week. So I went without it for three days. No one stopped me. Fouth day traffic police stopped me. As per protocol, I started reasoning with the police that my helmet is wet and all.. The police was kind enough to ask me to save my breath and not to worry because the fine is not much but only Rs.50  (on Nov-2011). Even one litre petrol costs Rs.70 these days (That’s another story. Why government blames oil company decisions but cannot control them ?). But to my consolation, I got e-chellan for that, so I know it did’nt go as a bribe.

So now I know the reason why India is the anarchists heaven. Its because, its cheap to do a crime and get away here, than any developed country. Even if I had done something more serious like speeding, I could have got away by bribing which could go as low as Rs.50 for a Rs.500 offence. Its even better if you know somebody in the department – you can get away without paying anything.

Want to see how bad this corruption can get ? Just see the link below:

http://indiatoday.intoday.in/video/fake-drugs-racket-exposed/1/158530.html

Survival of the fittest is the motto here. We act like we care for the poor, exploit them(How? I’ve seen labourers getting negligible wage for their hard work, which may not even be sufficient for food – who do they work for?), we work for ourselves, and let them die while we flourish. All this happens sometimes with and mostly without our knowledge.

Since nothing has helped so far, I’ve lost all hope. I wish Anna Hazare good luck getting Lokpal passed and curbing corruption among the hypocratic society which talks against corruption but embraces the same corruption shamelessly.

Veritas Volume Manager

Volume Manager Administration


Syntaxes of commands used in this guide:

You can find details of these commands beyond this list. Obviously I have referred the cuddletech and symantec documentation. I have tried to make is as short as I can. If you don’t understand anything, you can read about them in wikipedia or other documentation. This micro-guide is a work in progress, so provide suggestions as comments.

# drvconfig;devlinks;disks (To detect the disk in solaris)

# devfsadm (To detect the disk in solaris)

# format (To verify the detected disk)

# /usr/sbin/vxdiskadm (To verify the detected disk) or (To bring disk into VxVM)

# vxdiskadd <diskname> (Shortcut to add disk or diskset)

# vxedit set reserve=<option> <diskname> (Option can be “on” or “no”)

# vxassist set spare=<option> <diskname> (Option can be “on” or “off”)

# vxmake sd <subdiskname> <VMDiskName>,<offset>,<len>

# vxmake plex <plexname> layout=<layouttype> ncolumn=<#> stwidth=<#>k sd=<disk1>,<disk2>,..

# vxsd assoc <plexname> <subdisk> <subdisk> …..

# vxmake -U <usagetype> vol <volname> plex=<plexname>

# vxvol start <volname>

#  vxassist -g <diskgroup> -U <usagetype> make <volname> <size> \

layout=<layouttype> stwidth=<#> ncolumn=<#> \

nmirror=<#> <disk1> <disk2> ….

# vxassist -g <diskgroup> mirror <volname>

# vxassist -g <diskgroup> maxgrow <volume> [ <disk1> < disk2> .. ] (To check)

# vxassist -g <diskgroup> growby <volume> <len_to_grow_by>

# vxassist -g <diskgroup> growto <volume> <new_len>

# vxassist addlog <volumename> (To enable DRL)

# newfs /dev/vx/dsk/datavol

# mount /dev/vx/dsk/datavol /vxrocks

RAID Concept:

1) Concatenation – Data in a concatenation is layered across the disks in a linear fashion from one disk to the next.

2) RAID-0(Striping) – Data is written in a round-robin fashion into all the disks. After writing “stripe width” amount of data, writing is switched to the next disk(column).

3) RAID-1(mirroring) – Just as its name suggests, a mirror will replicate from the original disk. RAID-0+1 means a striped RAID, mirrored by an identically configured RAID. RAID-1+0 means mirrors have been striped.

4) RAID-5 – Takes care of error correction and detection by writing parity for data using. Slower but gives most space from a particular set of disks with protection

Basic set-up and understanding:

Following are components of VxVM:

1) Disk – Physical disk name like c0t0d0. Not partition but full disk

2) VM Disk (dm) – A disk that is brought under VxVM control, example disk01

3) Sub Disk (sd) – A section of dm used to build plexes. One can assume it as a Veritas partition

4) Plex (pl) – Group of subdisks. The RAID layouts are implemented here. The type (concat, striped …..) of volume depends upon type of plex. If you assign more than one similar plex to a volume, then it becomes a mirror .

5) Volume (v) – In point of view of anything or anybody outside VxVM, a volume is a virtual disk, which contains data and can be accessed in the device path /dev/vx . But according to VxVM, a volume is nothing but a container of plexes(or subvolumes).

Daemons:

VxVM relies on the following constantly-running daemons and kernel threads for its operation:

1) vxconfigd – Maintains disk and group configurations and communicates configuration changes to the kernel, and modifies configuration information stored on disks.

2) vxiod – This kernel threads provide extended I/O operations without blocking calling processes. By default, 16 I/O threads are started at boot time, and at least one I/O thread must continue to run at all times

3) vxrelocd – This hot-relocation daemon monitors VxVM for events that affect redundancy, and performs hot-relocation to restore redundancy.

Procedures you will have to do if you are starting from scratch:

1) Attach the disks that you are planning to use. Then type:

# drvconfig;devlinks;disks

Above command is for solaris 8. The command “devfsadm” should be sufficient for newer versions.

2) Verify using “format” command, and list option from the command “/usr/sbin/vxdiskadm”. Avoid partitioning a disk that you want to use within veritas.

3) Using the menu driven tool “/usr/sbin/vxdiskadm”

, bring the disk into VxVM control by selecting either the “initialize” (wipe-out) or “encapsulate” (preserve data) option. Typically, the disks will be absorbed and named as VM disks (dm) under rootdg (dg) by default, if you don’t specify a dg. It can be verified using vxprint command .

As an alternative, there is a shortcut interactive command with the following syntax:

# vxdiskadd <diskname>

The <diskname> is in cxtxdx form. For example, c2t0d0

Any leading portion of this address may be specified to indicate that all disks that match that leading portion should be used. For example c2t0 may be used to specify all  disks  on  controller  2,  target 0.

Note: At this point, the disk is assigned to the spare pool of the relevant diskgroup, which may be automatically used by vxassist. To reserve and unreserve, use following commands:

# vxedit set reserve=on <diskname>

# vxedit set reserve=no <diskname>

However vxassist cannot be stopped from using the disk if you explicitly ask it to use it. Another trick is to assign the disk as a hotspare(which will substitute a failed disk) and it cannot be used as sparedisk using following commands:

# vxassist set spare=on <diskname>

# vxassist set spare=off <diskname>

Building and managing volumes out of VM disks – The “vxmake” way:

The following are typical steps:

1) Create subdisk(s), using following syntax:

# vxmake sd <subdiskname> <VMDiskName>,<offset>,<len>

<len> is nothing but the length of the subdisk, mentioned as number of sectors

Typically we give <subdiskname> as <dm(vmdiskname)>-0x . Example disk01-01 if <dm>=disk01

2) Create plex(es), using following syntax:

# vxmake plex <plexname>

Above is a simple plex creation command. Below is an example of a more detailed striped plex creation along with option to associate to subdisks

# vxmake plex vol01-01 layout=stripe ncolumn=4 stwidth=32k \

sd=disk01-01,disk02-01,disk03-01,disk04-01

3) Associate the plex to subdisk(s), using following syntax:

# vxsd assoc <plexname> <subdisk> <subdisk> …..

4) Create volume associated with the plex:

# vxmake -U <usagetype> vol <volname> plex=<plexname>

<usagetype> is generally “fsgen” for filesystems and “gen” for raw volumes

At this level, we can use “vxprint -hrt” command for detailed output

5) Enable(“start”) the volume:

# vxvol start <volname>

Building and managing volumes out of VM disks – The “vxassist” way:

1) Here we can give all options and directly create volume

# vxassist -g <diskgroup> -U <usagetype> make <volname> <size>

by default vxassist creates concatinated volumes

#  vxassist -g <diskgroup> -U <usagetype> make <volname> <size> \

layout=<layouttype> stwidth=<width> ncolumn=<#> \

nmirror=<number of mirrors> <disk1> <disk2> <disk3> ….

Typical <layouttype> are as following:

a) mirror-concat

b) raid5 (Minimum of 3 VM disks required, minimum 4 recommended for the purpose of raid5 log plex)

c) stripe-mirror

2) We can also make a mirror from an “unmirrored” volume

# vxassist -g <diskgroup> mirror <volname>

3) We can resize a volume

a. First we check if there is enough room to grow

# vxassist -g <diskgroup> maxgrow <volume> [ <disk1> <disk2> <disk3> ]

b. Now to grow the volume, there are two options in vxassist

# vxassist -g <diskgroup> growby <volume> <len_to_grow_by>

or

# vxassist -g <diskgroup> growto <volume> <new_len>

4) And then, we can relayout volumes

5) We can enable DRL(Dirty Region Logging)

# vxassist addlog <volumename>

Here dirty means currently updating (or updated recently). Before writing in a region, the region is marked as dirty. This way, when the system recovers from a crash, instead of checking the whole volume, whichever region is marked DRL is alone checked. By default, maximum number of dirty regions is 2048 (The least recently touched will be unmarked).

Typical ways to use the volumes that you have created:

1) Create a filesystem & mount it:

# newfs /dev/vx/dsk/datavol

# mount /dev/vx/dsk/datavol /vxrocks

2) Use it as a raw volume for example in oracle:

Topics I’m planning to include later:

a) Config files

c) log files

d) stop/start

f) troubleshoot

g) GUI

h) Quorum

i) Metadb

j) disk set

k) Implementing RAID concepts

l) clustered volume manager

m) DAD devices integration with vmware

n) SAN devices: configuration, mirroring, troubleshooting

o) DR

p) veritas volume replicator

linpus rpm repo modify

http://icesquare.com/wordpress/solvedfedora-repository-error-errno-14-pycurl-error-6/

Building RPM packages

Building RPM packages
———————
Part 1 – The Inputs
——————-

 Three types of inputs:

 1) The Sources – In the case of packaging someone else’s software, the sources should be kept as the author      distributed them, which usually means a compressed tar file. RPM can handle other archive formats,     but a bit more up-front effort is required.

 3) The Patches – Usually, the nature of these patches falls into one of the following categories:
   a) The patch addresses an issue specific to the target system. This could include changing makefiles     to install the application into the appropriate directories, or resolving cross-platform conflicts,     such as replacing BSD system calls with their SYSV counterparts.
   b) The patch creates files that are normally created during a configuration step in the installation     process. Many times, it’s necessary to either edit configuration files or scripts in order to set     things up for compilation. In other cases, a configuration utility needs to be run before the sources    are compiled. In either instance, the patches create the environment required for proper compilation.

 2) The Spec File – The spec file is at the heart of RPM’s packaging building process. Similar in concept to a      makefile, it contains information required by RPM to build the package, as well as       instructions telling RPM how to build it. The spec file also dictates exactly what files are a part     of the package, and where they should be installed.
Creating the Patches:
While it might sound a bit daunting to take into account the types of patches outlined above, it’s really quite simple. Here’s how it’s done:
 1) Unpack the sources.
 2) Rename the top-level directory. Make it end with “.orig”, for example.
 3) Unpack the sources again, leaving the top-level directory name unchanged.
The source tree that you created the second time will be the one you’ll use to get the software to build.

If the software builds with no changes required, that’s great — you won’t need a patch. But if you had to make any changes, you’ll have to create a set of patches. To do so, simply clean the source directory of any binaries. Then, issue a recursive diff command to compare the source tree you used for the build, against the original, unmodified source tree. It’s as easy as that!

Part 2 – The Engine:RPM
———————–

At the center of the action is RPM. It performs a number of steps during the build process:
1) Executes the commands and macros in the prep section of the spec file.
2) Checks the contents of the file list.
3) Executes the commands and macros in the build section of the spec file.
4) Executes the commands and macros in the install section of the spec file. Any macros in the file list are executed at this time, too.
5) Creates the binary package file.
6) Creates the source package file.
By using different options on the RPM command line, the build process can be stopped at any of the steps above. This makes the initial building of a package that much easier, as it is then possible to see whether each step completed successfully before continuing on to the next step.
The following are steps to be followed:

1) Create the Build Directory Structure
/usr/src/redhat/SOURCES — Contains the original sources, patches, and icon files.
/usr/src/redhat/SPECS — Contains the spec files used to control the build process.
/usr/src/redhat/BUILD — The directory in which the sources are unpacked, and the software is built.
/usr/src/redhat/RPMS — Contains the binary package files created by the build process.
/usr/src/redhat/SRPMS — Contains the source package files created by the build process.

2) Place the source tar file in “SOURCES” directory
3) Create the Spec files (Refer ducumentation for spec related documentation)
4) cd /usr/src/redhat/SPECS
5) rpm -ba cdplayer-1.0.spec
 The “b” directs rpm to build. The “a” directs rpm to perform all phases of the build process.

Part 3 – The Outputs
——————–

 Two main categories:

1) The Source Package File
The source package file is a specially formatted archive that contains the following files:
 a) The original compressed tar file(s).
 b) The spec file.
 c) The patches.

Since the source package contains everything needed to create the binary package, the source package, and provide the original sources, it’s a great way to distribute source code. As mentioned earlier, it’s also a great way to archive all the information needed to rebuild a particular version of the package.

2) The Binary RPM
The binary package file is the one part of the entire RPM building process that is most visible to the user. It contains the files that comprise the application, along with any additional information needed to install and erase it.