Custom Search

Thursday, January 28, 2010

Using a Scipt to configure filesystems with Logical Volume Manager (LVM) under HP-UXScenario:

Using a Scipt to configure filesystems with Logical Volume Manager (LVM) under HP-UXScenario:

I have just created 15 luns on a san for use by HP-UX to create a new filesystem. Now, I need to have those luns recognized by the operating system and to be made into a single filesystem. Because there are 15 luns, it is likely I will have to repeat the same step 15 times. To better utilize my time, and to eliminate mistakes, here are the steps required to script much of the process.

1. Make the luns visible to the server as disk devices. The steps for this are:
Determine what the server sees now - the "before" picture"
ioscan -fnkC disk
Scan for new disk devices - this should be the luns allocated from the san (the will be just a hardware path and will not have a device file yet)
ioscan -fnC disk
Create the device files
insf
Check to make sure the the luns now have device files associated with them
ioscan -fnC disk
Use the xpinfo command from HP to list the device to lun association (available with the HP "XP" series of sans).
xpinfo -il
2. Verify that none of the luns are already being used

This should not be the case, but I am paranoid and this is a very easy to do sanity check.
Redirect the xpinfo -il command to a file and with vi save just the devices for the new luns - use awk '{print N$}' to print out just the device. Save the file (/tmp/wte_devices.txt). The file should look something like this:/tmp/wte_devices.txt:/dev/rdsk/c5t0d1/dev/rdsk/c5t9d0/dev/rdsk/c5t9d1/dev/rdsk/c5t9d2/dev/rdsk/c5t0d2/dev/rdsk/c5t1d7/dev/rdsk/c5t2d0/dev/rdsk/c5t2d1/dev/rdsk/c5t3d0/dev/rdsk/c5t3d6/dev/rdsk/c5t8d3/dev/rdsk/c5t8d4/dev/rdsk/c5t8d5/dev/rdsk/c5t8d6/dev/rdsk/c5t8d7For each device in the file check to see if there is an existing device in an existing volume group. Use the command vgdisplay -vgrep . Here is the command line script to do this.
for disk in `cat wte_devices.txt sed 's/\/dev\/rdsk\///g'` do echo "Disk device /dev/rdsk/$disk: " vgdisplay -vgrep $disk echo " " done

3. Initialized the luns for use by LVMFirst create the script to do this by issuing the following command:cat wte_devices.txt sed 's/\/dev/pvcreate -f \/dev/g' > wte_pvcreate.shThis should result in a script that contains the following lines:server: /tmp # cat wte_pvcreate.shpvcreate -f /dev/rdsk/c5t0d1pvcreate -f /dev/rdsk/c5t9d0pvcreate -f /dev/rdsk/c5t9d1pvcreate -f /dev/rdsk/c5t9d2pvcreate -f /dev/rdsk/c5t0d2pvcreate -f /dev/rdsk/c5t1d7pvcreate -f /dev/rdsk/c5t2d0pvcreate -f /dev/rdsk/c5t2d1pvcreate -f /dev/rdsk/c5t3d0pvcreate -f /dev/rdsk/c5t3d6pvcreate -f /dev/rdsk/c5t8d3pvcreate -f /dev/rdsk/c5t8d4pvcreate -f /dev/rdsk/c5t8d5pvcreate -f /dev/rdsk/c5t8d6pvcreate -f /dev/rdsk/c5t8d7chmod +x and running the script:server: /tmp # ./wte_pvcreate.shPhysical volume "/dev/rdsk/c5t0d1" has been successfully created.Physical volume "/dev/rdsk/c5t9d0" has been successfully created.Physical volume "/dev/rdsk/c5t9d1" has been successfully created.Physical volume "/dev/rdsk/c5t9d2" has been successfully created.Physical volume "/dev/rdsk/c5t0d2" has been successfully created.Physical volume "/dev/rdsk/c5t1d7" has been successfully created.Physical volume "/dev/rdsk/c5t2d0" has been successfully created.Physical volume "/dev/rdsk/c5t2d1" has been successfully created.Physical volume "/dev/rdsk/c5t3d0" has been successfully created.Physical volume "/dev/rdsk/c5t3d6" has been successfully created.Physical volume "/dev/rdsk/c5t8d3" has been successfully created.Physical volume "/dev/rdsk/c5t8d4" has been successfully created.Physical volume "/dev/rdsk/c5t8d5" has been successfully created.Physical volume "/dev/rdsk/c5t8d6" has been successfully created.Physical volume "/dev/rdsk/c5t8d7" has been successfully created.
4. Extend an existing volume group.For this example I was able to extend an existing volume group - if this is not possible then a new volume group would have to be created.vgextend /dev/vgdata11 /dev/dsk/diskidserver: /tmp # cp wte_pvcreate.sh wte_vgextend.shserver: /tmp # chmod +x wte_vgextend.shusing the vi substitution command, change the "pvcreate -f" to "vgextend /dev/vgdata11" and change rdsk to dsk%s/pvcreate -f/vgextend \/dev\/vgdata11/gserver: /tmp # cat wte_vgextend.shvgextend /dev/vgdata11 /dev/rdsk/c5t0d1vgextend /dev/vgdata11 /dev/rdsk/c5t9d0vgextend /dev/vgdata11 /dev/rdsk/c5t9d1vgextend /dev/vgdata11 /dev/rdsk/c5t9d2vgextend /dev/vgdata11 /dev/rdsk/c5t0d2vgextend /dev/vgdata11 /dev/rdsk/c5t1d7vgextend /dev/vgdata11 /dev/rdsk/c5t2d0vgextend /dev/vgdata11 /dev/rdsk/c5t2d1vgextend /dev/vgdata11 /dev/rdsk/c5t3d0vgextend /dev/vgdata11 /dev/rdsk/c5t3d6vgextend /dev/vgdata11 /dev/rdsk/c5t8d3vgextend /dev/vgdata11 /dev/rdsk/c5t8d4vgextend /dev/vgdata11 /dev/rdsk/c5t8d5vgextend /dev/vgdata11 /dev/rdsk/c5t8d6vgextend /dev/vgdata11 /dev/rdsk/c5t8d7Run the script:server: /tmp # ./wte_vgextend.shVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.confVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.confVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.confVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.confVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.confVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.confVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.confVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.confVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.confVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.confVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.confVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.confVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.confVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.confVolume group "/dev/vgdata11" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.conf


5. Create the logical volume

server: /tmp # lvcreate -L 100000 -n lvol_u20 /dev/vgdata11
Logical volume "/dev/vgdata11/lvol_u20" has been successfully created withcharacter device "/dev/vgdata11/rlvol_u20".Logical volume "/dev/vgdata11/lvol_u20" has been successfully extended.Volume Group configuration for /dev/vgdata11 has been saved in /etc/lvmconf/vgdata11.conf

6. Make the new filesystem

server: /tmp # mkfs -F vxfs -o bsize=8192,largefiles /dev/vgdata11/lvol_u20 version 3 layout 102400000 sectors, 12800000 blocks of size 8192, log size 256 blocks unlimited inodes, 12800000 data blocks, 12799232 free data blocks 391 allocation units of 32768 blocks, 32768 data blocks last allocation unit has 20480 data blocks first allocation unit starts at block 0 overhead per allocation unit is 0 blocks

7. Mount the new filesystem

Make the mountpoint:
server: /tmp # mkdir -p
Edit /etc/fstab
/dev/vgdata11/lvol_u20 vxfs rw,suid,largefiles,delaylog,datainlog 0 2
Mount the filesystem
server: /tmp # mount
Change ownership of the filesystemserver: /tmp # chown oracle:dba

8. Verify the size and permissions

bdf
ls -ld

thanks to http://networktechnologist.com/tips-hpux-lvm-script.html

Wednesday, December 23, 2009

Monkey in the year 2010

I was browsing now for the Wood Monkey signs for the year 2010 but this was the only things ive seen.

Monkey Traits 2010,Chinese Monkey 2010 ForecastMonkey Borns: (1908, 1920, 1932, 1944, 1956, 1968, 1980, 1992. 2004, 2016)

Best Monkey Compatibility: Pig, Monkey, Rat
Worst Monkey Compatibility: Tiger, Dog, SnakeMonkey

Positive Traits: Faithful, Successful, InventiveMonkey
Negative Traits: Careless, Gullible, Immature

General Monkey Chinese Horoscope 2010:
According to Monkey Horoscope 2010, these people are going to face some difficulties in the Tiger year 2010.There are chances of these people to have conflicts with Horses and Tigers in the Tiger Chinese Year 2010.Monkey Horoscope 2010 also predicts that these people need to avoid getting to emotional in the coming year to maintain their mental peace and save their relationships.

Thursday, October 22, 2009

Pesto + Roast Beef Sandwich

This is the 2nd all girls' day out in my team.

Though we are exhausted about everything happening right now. A good food always makes a stressful soul satiatied.

Well, If everything was not good, do i have to give a damn thinking about it?

Hope, next time we will have another round of it. Hope it will be free again.

Monday, October 5, 2009

KIM BUM in Manila

I love the character of Kim Bum or Bumi in Boys over flowers

NANDITO AKO (Nagmamahal sa 'yo)

My Nanay loves Aljur Abrenica and Cris Bernal but i dont why?

Sunday, September 27, 2009

ONDOY

A facebook shoutout tells " When it rains it pours.", nature is still unpredictable and one of the strongest in this world. We should not intervine with nature, we just go with the flow.

Last Saturday i was not able to go to work because of the signal number 1 storm named ONDOY.

Ondoy was a history in the Philippines. More than a day raining that cause a lot of damage in Manila and other areas in Luzon. Left more than 200 people killed and millions of property was destroyed by Ondoy. Millions are stranded. MRT and LRT was 24hours open.

People in all levels were affected by this natural phenomenom.

Although Ondoy passed the Philippines in a most tragic way as it was reported. On the one way or another i think theres still some lesson learned and values that were taught.

Ondoy taught us that family should come first in all aspect in life that family is still the reason we are able to work and be responsible in everything we do.
Humanity in one way or another is still thinking of other people's safety. As we are not that affected we are still praying for those who are affected by Ondoy.
Eventhough, you are the most richest person in your place, you still need other people's help.

I supposed that there are some weird lesson learned in Ondoy.
First, to those have money to buy a boat, rubber or not, you should at least have one in your house.
Second, those who have cars, next time try to tie your car so you will find them in no time. For them to not floating somewhere that will cause delay on the rescuer.
Third, stay home than go to work. So you will not be stucked somewhere else.
Fourth, buy a lot of food and drink so you will have some when storm came, you still have something to chew.

I will be thinking a lot of things to remember during such storm.

Friday, September 25, 2009

SURROGATES..now showing

Now Showing


Well, I have watched this movie 4 hours ago. Want to blog it already to give a synopsis plus a grade..hehehehe.

I was looking for a great synopsis of this movie in the web but to my dismay all i found was lame synopsis. So im giving my own again do bare with me.

The movie started with how the Surrogates where founded 20 years ago with the used of a monkey. Then history goes, other people like them others don't. They say surrogates can be a great help in human kind specially in military operations. There are part of the country where surrogates was not allowed, these part was led by the prophet.
Then the next scene, a college student with a GRO surrogates killed in a bar, operators of the surrogates was also killed. Tom Greer who is played by Bruce Willis and Peters played by Radha Mitchell was both FBI agents who responded on this crime.
All surrogates have microchips where identifications are installed.
JJ Brown who was the GRO was a operated by big man can i say he was a gay while college boy was the son of Lionel Canter who is the inventor of the Surrogates.
Lionel Canter got a lot of surrogates.
VSI or Virtual Self Inc. is the company who is producing surrogates, this is also the company where Lionel work and was terminated due to some legal reasons.
As the movie goes on. Tom discovered that the killer was Stricland who had a billion dollar gun which was created by VSI for the military, he also experience this gun by himself in searching for Strictland on the prophet's place, his surrogates was killed there.
Maggie, was Tom's wife. She never talk to him personally due to the lost of their son.
Tom's part of the country where run by surrogates all people are surrogates except him who had lost his surrogate.
Tom have to go to the phophets place in search for Stricland who was already killed by the people of the phophet. Phophet was also a Canter surrogates. Canter also killed Peters to be able to get the gun, to go around the FBI facilities and to Bud's hide out. Upon these he learned that the government and VSI got something to do with his son's death so he revised a plan to eliminate all surrogates plus the operators. Because Lionel thinks that surrogates kills human beings.
Bud who is the only human in the FBI who had all controls of the surrogates.
The act where Peters was already in Bud's office and ready to eliminate all surrogates. While this scene is taking place, Tom goes to Canter to confront him. Canter killed himself during this confrontation so Tom have to take over Peters surrogates to be able to help the man kind during this time. He asked Bud what to do to be able to save the operators. A yes or no decision came to Tom, this is where he had to saved the surrogates destruction but he decided to go on with it. Imagine billions of surrogates were destroyed. Operators were coming out in their house because of this phenomenom. Since the inventor was already death there is no way the surrogates can be fix.
The ending Tom got in their house and find her wife in their child's room and hug each other.

I can say that story was not that deep enough to woo clients to their seats. As a viewer i can say that this is just another futuristic story which can or cannot be watch. I was hoping more visualizations. But infairness, imagine you having that slender, sexy and perfect body and face, who wouldn't want a surrogates herself. hehehe. Guess, perfection was the main reason why such movie came out.

When will we have a surrogates? Maybe in the near future. It is more likely be funny to have one.

This is a tough story to give a synopsis which is identifying a third persona. Hope i was able to give a good one.
 
Custom Search