Operating System - HP-UX
1855728 Members
5257 Online
104103 Solutions
New Discussion

create new desk help, please.

 
SOLVED
Go to solution
Tom_131
Advisor

create new desk help, please.

I have a drive I need to defragment and I do not have online jsf.
I am going to stop all application activity, backup the system and remove the /tmp drive.
I have a summary of the commands I would like to use followed by the information that support the commands. I do not have a test system I can test this on, only one production system so I have to make sure this works. Thanks for any suggestions I might get.

Commands I would like to use:
umount /tmp
lvremove /dev/vg00/lvol04
lvcreate -L 1000 -n lvol04 /dev/vg00
newfs -f xvfs /dev/vg00/lvol04 /dev/dsk/c1t6d0
newfs -f xvfs /dev/vg00/lvol04 /dev/dsk/c2t6d0
mount -a
#this info is already in the fstab.

fstab info:
/dev/vg00/lvol4 /tmp vxfs delaylog 0 2

bdf info:
/dev/vg00/lvol4 1048576 364238 645386 36% /tmp

vgdisplay info:
vgdisplay -v /dev/vg00 |more.
VG Name /dev/vg00
VG Write Access read/write
VG Status available

--- Physical volumes ---
PV Name /dev/dsk/c1t6d0
PV Status available
Total PE 2169
Free PE 268
Autoswitch On

PV Name /dev/dsk/c2t6d0
PV Status available
Total PE 2169
Free PE 268
Autoswitch On



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

--- Logical volumes ---
LV Name /dev/vg01/lvol1
LV Status available/syncd
LV Size (Mbytes) 64756
Current LE 16189
Allocated PE 16189
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c3t1d0
PV Name /dev/dsk/c5t0d0 Alternate Link
PV Status available
Total PE 16191
Free PE 2
Autoswitch On
13 REPLIES 13
Ted Ellis_2
Honored Contributor

Re: create new desk help, please.

to mirror the new logical volume, you do not run the newfs command on each disk... instead:

backup data (good)
lvremove (no problem)
lvcreate -L 1024 ... good so far
newfs -F vxfs .... alright

now:

since you want to mirror this to to second disk on the root volume group, and assuming you have MirrorDisk already:

lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t6d0

note: when you run lvremove on the original logical volume you remove, it will remove the mirror with it.

You fstab entries seem fine.

Ted
Ted Ellis_2
Honored Contributor

Re: create new desk help, please.

oops... one more item.. if you want to use lvol4, then make sure that is the content of all your lvcreate, newfs and fstab entries:

in other words, do not use lvcreate with /dev/vg00/lvol04... use /dev/vg00/lvol4

Ted
Ted Ellis_2
Honored Contributor

Re: create new desk help, please.

on all of my 11.0 systems, /tmp is lvol6... just make sure your /tmp that you are removing is in fact lvol4 (or lvol04)... for me lvol4 is /home... I'll shutup now :-)

Ted
Tom_131
Advisor

Re: create new desk help, please.

Thank you very much for the help!

So the commans should look like this?(see below)
do you extend the data before or afteryou create the new file system?
Commands:
BU Data

umount /tmp
lvremove /dev/vg00/lvol04
lvcreate -L 1000 -n lvol04 /dev/vg00
lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t6d0
newfs -f xvfs /dev/vg00/lvol04 /dev/dsk/c1t6d0
newfs -f xvfs /dev/vg00/lvol04 /dev/dsk/c2t6d0
mount -a

Thanks,
Tom
Pete Randall
Outstanding Contributor

Re: create new desk help, please.

Close - just one newfs, though.

Pete

Pete
Ted Ellis_2
Honored Contributor
Solution

Re: create new desk help, please.

you can actually include the mirror command with the lvcreate.. guess I should have suggested that first:

lvcreate -L 1000 -m 1 -s y -n lvol04 /dev/vg00

the -s option indicates that mirrored physical extents will not be assigned to the same disks. This will mirror your new lvol with one step.. then run the newfs next

Ted
Eric Hess
Advisor

Re: create new desk help, please.

By defrag you mean fsck right. What are you trying to exactly do. It looks like you are lvremoving and then going right back and recreating it as a smaller lv. /tmp was 1024 and now you are creating lvol4 (/tmp) with 1000 MB 24 MB fewer than before. If all you are trying to do is get /tmpto 0% used just umount /tmp if you can and run a fsadm -F vxfs /dev/vg00/lvol4. If you can't umount it see what process is attached to /tmp run
#fuser -c /tmp
kill all processes if possible if not you will need to reboot the server and not mount /tmp on reboot.
I didn't do it. He did!
Tom_131
Advisor

Re: create new desk help, please.

Thanks,

almost missed those 0's!

Tom
S.K. Chan
Honored Contributor

Re: create new desk help, please.

The command syntax are all wrong. Why don't you do this instead. I'm guessing your vg00 is mirrored since the allocated PE for lvol4 doubles the current LE.
Since you got (268*4=1072MB) left in vg00 you can create a "new" LV for /tmp, modify /etc/fstab and after you reboot your machine you can delete the "old" LV (ie lvol4).
# lvcreate -L 1000 -n lvol5 -m 1 /dev/vg00
==> Assuming lvol5 is not used yet.
# newfs -F vxfs /dev/vg00/rlvol5
# vi /etc/fstab
==> Replace the "old" /tmp entry marked as lvol4 with lvol5.
# /etc/shutdown -r -y 0
After the system comes up you'll have the new LV (ie lvol5) mounted onto /tmp. Now remove the old LV (ie lvol4)
# lvremove /dev/vg00/lvol4
Ashwani Kashyap
Honored Contributor

Re: create new desk help, please.

Hi after lvremove , you can do this :
#lvcreate -L 1000 -n lvol04 /dev/vg00 /dev/dsk/c1t6d0 .
#lvextend -m 1 /dev/vg00/lvol04 /dev/dsk/c2t6d0
# newfs -F vxfs /dev/vg00/rlvol04

YOu cna specify other option like block size etc . with -o option wiht newfs . DO a man newfs_vxfs to get more information .

Rest of the stuff are fine .
Tom_131
Advisor

Re: create new desk help, please.

This has all been great help but one thing I have seen has confused me.

Do I have to extend the volume or leave it after I create it?

lvcreate -L 1000 -n lvol9 -m 1 /dev/vg00
newfs -F vxfs /dev/vg00/rlvol9
vi the /etc/fstab
reboot
lvremove /dev/vg00/lvol4

Thanks,
Tom
Ted Ellis_2
Honored Contributor

Re: create new desk help, please.

no reboot needed when creating logical volumes. Also, if you use the -m option to mirror with lvcreate, then make sure and use the -s option with y to make sure the mirroring is on separate physical disks. You don't want a mirror on the same disk :-)

the basic order of commands for removing and recreating:

umount
lvremove
lvcreate
newfs
update /etc/fstab
mount

the newfs command after an lvcreate will configure the file system using all space in the logical volume.. no need to extend at all. And since you have already mirrored with your lvcreate command, you have no need for the lvextend command here

Ted
Tom_131
Advisor

Re: create new desk help, please.

Thanks, Ted!