Operating System - HP-UX
1753767 Members
5563 Online
108799 Solutions
New Discussion юеВ

seeking help for mirror disk

 
SOLVED
Go to solution
Vincent Lam_1
Occasional Contributor

seeking help for mirror disk

I'm a newbie to HP-UX and has come across a very devastating situation...

My r5470 has two disc. They're setup for mirroring by the former system admin (now left). Now, I'm given a task to enlarge the /tmp.

From sam, I learnt that there're no space left at vg00 (all the logical volume are on vg00). So, I decided to shrink the logical volume hosting /u01. What I did is:
1. backup /u01
2. destroy /u01
3. re-create /u01 with lesser space
4. restore /u01
They're all done in sam.

Then I tried to increase /tmp. In sam, it did give me the option to increase the size of /tmp now. But when I tried to confirm the change and execute it, it complaint something like "physical extent not available". Being no other choice, I destroy /tmp and create it again in sam. Everything seems fine so far.

Then i realize that both /tmp and /u01 are not mirrored volume!!! Before I did the change, both of them are mirrored volumne!! what should I do now to make them mirrored volume? (I have two 73GB disc in the system)
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: seeking help for mirror disk

Simply, to have a volume be mirrored is one command. This assumes you have a license for mirror/ux. I assume this is true, because mirroring seems to be happening.

lvextend -m 1 /dev/vg01/lvolname /dev/dsk/c1t1d0

This is not an exact command. The name of the volume group vg01 needs to change. The name of the disk needs to change.

You need to get to know this system and its probably time to stop using sam.

SAM will get you through a crisis. SAM will make stupid mistakes because software just can't be made so smart.

I recommend the following:

You may want to post the output and then I can write you exact commands.

vgdisplay /dev/vg00

vgdisplay -v /dev/vg00

This will get you a picture of how much space vg00 has. It will let you know what disks its sitting on.

bdf

the left column includes your logical volume names.

lvdisplay /dev/vg00/lvol3

You need to gather this information.

From the vgdisplay command you'll get your disk names.

pvdisplay /dev/dsk/c1t1d0

Again not a real disk name, but this will at least let you know where the free space is.

If /tmp is on one disk and you mirror it without specifying another disk then the mirror will happily happen and be useless because the mirror copy will be on the same disk as the original.

In summary, get to know your system, gather some data and some intelligent help can be offered.

I now use SAM for two purposes only:
1) Gather information to plan command line work.
2) Learn command line for sysadmin functions I either don't know or have forgotten. There are a few of those.

I won't quote Bill Hassell today because you've got enough stress. Do try and use this opportunity to do some command line lvm work.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vincent Lam_1
Occasional Contributor

Re: seeking help for mirror disk

Thanks for your explanation. I don't have access to the machine at the moment. But here is the output before I adjusted the partition (lvol9 is the /u01 I've mentioned while lvol4 is /tmp):

vgdisplay -v
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 9
Open LV 9
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4350
VGDA 4
PE Size (Mbytes) 8
Total PE 8680
Alloc PE 8680
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg00/lvol1
LV Status available/syncd
LV Size (Mbytes) 304
Current LE 38
Allocated PE 76
Used PV 2

LV Name /dev/vg00/lvol2
LV Status available/syncd
LV Size (Mbytes) 4096
Current LE 512
Allocated PE 1024
Used PV 2

LV Name /dev/vg00/lvol3
LV Status available/syncd
LV Size (Mbytes) 200
Current LE 25
Allocated PE 50
Used PV 2

LV Name /dev/vg00/lvol4
LV Status available/syncd
LV Size (Mbytes) 200
Current LE 25
Allocated PE 50
Used PV 2

LV Name /dev/vg00/lvol5
LV Status available/syncd
LV Size (Mbytes) 24
Current LE 3
Allocated PE 6
Used PV 2

LV Name /dev/vg00/lvol6
LV Status available/syncd
LV Size (Mbytes) 1840
Current LE 230
Allocated PE 460
Used PV 2

LV Name /dev/vg00/lvol7
LV Status available/syncd
LV Size (Mbytes) 1880
Current LE 235
Allocated PE 470
Used PV 2

LV Name /dev/vg00/lvol8
LV Status available/syncd
LV Size (Mbytes) 4600
Current LE 575
Allocated PE 1150
Used PV 2

LV Name /dev/vg00/lvol9
LV Status available/syncd
LV Size (Mbytes) 43152
Current LE 5394
Allocated PE 5394
Used PV 2


--- Physical volumes ---
PV Name /dev/dsk/c1t2d0
PV Status available
Total PE 4340
Free PE 0
Autoswitch On

PV Name /dev/dsk/c2t2d0
PV Status available
Total PE 4340
Free PE 0
Autoswitch On
Ralph Grothe
Honored Contributor

Re: seeking help for mirror disk

Hi Vincent,

though SEP has already outlined what you need to do,
you could wrap the steps in a little script
(albeit, I doubt that the little task justifies the effort)

e.g.

rootdisks=$(vgdisplay -v vg00|awk '/PV Name/{print$NF}')
for lv in $(bdf /tmp /u01|awk 'NR>1{print$1}');do
pv_used=$lvdisplay -v $lv|awk 'NF==3&&$1~/^\/dev\/dsk/{print$1}'
lvextend -m 1 $lv $(echo $rootdisks|tr \\040 \\012|grep -v $pv_used)
done

However, I'd suggest to prepend an echo command to the last line in the for loop,
just to make sure that the correct LVs and PV was parsed.
Madness, thy name is system administration
Vincent Lam_1
Occasional Contributor

Re: seeking help for mirror disk

would the process affect the data that's already in the logical volume?
Pedro Cosmen
Valued Contributor
Solution

Re: seeking help for mirror disk

Hello Vincent, as i can see in you vgdisplay -v the lvol9 (/u01) was not mirrored:
Current LE=Allocated PE 5394 (43152 Mb).

If you want to make bigger your /tmp, remove your lvol9, and add more space to your /tmp

# lvextend -L (size in MB) lvol4 /dev/dsk/cxtxd0.

If it was not mirrored mirror it:

# lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/cxtxd0

You can control wath is happenig with your sapce with vgdisplay -v. Once you have your /tmp with the space you need then add your lvol9 to the system. But as I said before, it was not mirrored. If you want to create with mirror the best way is to create it with no space, then add space to one device and finally add the mirror into the other disk:

# lvcreate -n lvol9 vg00
#lvextend -L XX(size) /dev/vg00/lvol9 /dev/dsk/c1t2d0
#lvextend -m 1 /dev/vg00/lvol9 /dev/dsk/c2t2d0

You have to keep in mind all the time the space you have free in your disks (vgdisplay -v)

Regards
Ralph Grothe
Honored Contributor

Re: seeking help for mirror disk

No, an lvextend will do no harm to your data.
It only initiates the building up of a mirror copy to the disk passed as last argument
Madness, thy name is system administration