1834264 Members
76570 Online
110066 Solutions
New Discussion

Re: New disk problem

 
SOLVED
Go to solution
Damien Brown
Occasional Advisor

New disk problem

I had faulty disk and i have replaced it with a new one but it is not exactley the same disk so when i booted the machine up there is no logical volume. so i need to create a new vg but when i go to do it in sam i get an error message because it says in the lvmtab there is alreadyan entry so the vgc name that i want o create for this new one.

Please help
17 REPLIES 17
Robert-Jan Goossens
Honored Contributor

Re: New disk problem

Hi damien,

Could you give us a bit more details ?

How different is this disk ?

Are there more disks inside volume group you have lost ?

could you post

# vgdisplay -v vgname

Robert-Jan
A. Clay Stephenson
Acclaimed Contributor

Re: New disk problem

A vgexport /dev/vgxx will remove the old VG entries but you should be able to do a vgcfgrestore to install the old LVM data structures on the new disk. You then do a vgchange -a y /dev/vgxx to activate the disk. Your lvols should be back and you can then make the filesystems and restore from backup. You can also use the vgreduce command to remove the old entries; it will display an error but the /etc/lvmtab entries should be gone for the disk.

Man vgcfgrestore, vgexport, vgreduce for details.

You really should be mirroring so that losing a disk is a complete non-event; if your disks are hot-plug you wouldn't even have to shut down. I haven't shut down to replace a failed disk in years although in that time I replaced many, many disks.

If it ain't broke, I can fix that.
Hoang Chi Cong_1
Honored Contributor

Re: New disk problem

First, you need copy this file: /etc/lvmtab as an copy.
Then using vgscan -a to scan all of physical volumes for LVM volume groups and create the new lvmtab file.
Create again. I think it works!
Best and regard,

Jimkery
Looking for a special chance.......
Damien Brown
Occasional Advisor

Re: New disk problem

I am using LVM in sam to create the new VG and i have attached a screen shot of the error i am getting. Please specify exactley what to do as i am a new user to unix.

Many Thanks
Sridhar Bhaskarla
Honored Contributor
Solution

Re: New disk problem

Hi Damien,

You should not be creating a new VG because this device file is already recorded in another VG. The correct procedure is to use 'vgcfgrestore'. Do not run 'vgscan'. If you did already, put your old /etc/lvmtab back. Here is the procedure. Since this disk is not part of a mirror, you have lost the data. What you can do is create LVM structures and get the logical volumes back but not the data. Find out the VG that this disk is part of 'strings /etc/lvmtab |more' will give you that information. Confirm the VG before you do the below say it is vg01.

#vgcfgrestore -n vg01 /dev/rdsk/c1t1d0
#vgchange -a y vg01

Now do a pvdisplay on this disk and find out all the logical volumes this disk has

#pvdisplay -v vg01 |more

For each logical volume, create a new filesystem.

#newfs -F vxfs /dev/vg01/rlvol1

Once all the LVs are done, mount them.

#mount -a

Now restore the data because these filesystems would be empty.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: New disk problem

Fat finger... I messed up the pvdisplay command in the above..

Instead of 'pvdisplay -v /dev/vg01' read it as 'pvdisplay -v /dev/dsk/c1t1d0'.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Leif Halvarsson_2
Honored Contributor

Re: New disk problem

Hi,

Was the volumegroup wgere the disk failed only containing one disk ? And you want to recreate the volumegroup with the same name ?

Then, first export the old volumegroup

vgexport vgXX

now it soould be possible to use SAM for recreating vgXX or:

pvcreate -f /dev/rdsk/
vgcreate vgXX /dev/dsk/block_disk_devicefile
vgchange -a y vgXX
Damien Brown
Occasional Advisor

Re: New disk problem

I tried what you said at this is the reply i get from the system on the vgcfgrestore.

check out the screen shot
Sridhar Bhaskarla
Honored Contributor

Re: New disk problem

Hi Damien,

Did you export the VG rtvg01 already?. If so, then you may have to import it back. However, as said before if you have only one disk in that VG, then it's better to recreate the VG.

Post the outputs of the folloowing.

strings /etc/lvmtab
strings /etc/lvmtab.
vgdisplay -v
ll /dev/*/group

We should be able to determine what's happening with the above.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Damien Brown
Occasional Advisor

Re: New disk problem

I did all those command and i have copied and pasted them into a word document

thanks
Sridhar Bhaskarla
Honored Contributor

Re: New disk problem

Hi Damien,

Yep. I don't see rtvg01 in /dev directory. Since this is only the PV in that VG, you can safely export it. Do

#vgexport rtvg01

Then use SAM to recreate the VG, filesystems and restore the data.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Damien Brown
Occasional Advisor

Re: New disk problem

this is what i get if i do that command
Sridhar Bhaskarla
Honored Contributor

Re: New disk problem

OK. Since you have come this far run 'vgscan' and recreate the /etc/lvmtab without rtvg01.

#cp /etc/lvmtab /etc/lvmtab.good
#vgscan -a
#strings /etc/lvmtab

Make sure you get all VGs except rtvg01 in there. Once it is confirmed, you can go ahead and recreate this VG. Your vgdisplay -v etc., may complain but next reboot should take care of it.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Damien Brown
Occasional Advisor

Re: New disk problem

i did thos first three commands and i still can't do it.

here is what i go

if you could please explain how to do this all the way through including the sam part

i need to create volume group rtvg01 and the the logical volumes rtd1 and rtd1v1 and the both need to be 2040mb big.

thanks
Sridhar Bhaskarla
Honored Contributor

Re: New disk problem

I am real drowsy.. OK.. one more time..

#mv /etc/lvmtab /etc/lvmtab.junk
#vgscan -a
#strings /etc/lvmtab

That should get you rid of rtvg01.. Post the output before you proceed. Your leftvg* are giving errors. Do you have them working at this time?.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Damien Brown
Occasional Advisor

Re: New disk problem

sorry for causing so many headaches?

i did that and it's looking pretty good

here is what i got on the screen
Sridhar Bhaskarla
Honored Contributor

Re: New disk problem

Hi,

Can you verify the following now?.

1. Are you sure the VGs leftvg01, leftvg02, leftvg03 not used anymore?. Obviously vgscan couldn't find the disks corresponding to them.

2. Run 'mount -a'. You should see only errors related to rtvg01 unless you have bad entries in /etc/fstab file.

3. Run 'lvlnboot -R' and make sure your 'lvlnboot -v' displays boot,root,swap and dump(optionally) lvols.

4. Make sure everything is working fine. Your database, application etc.,.

Once the above is confirmed, proceed with creating a new VG with c1t1d0.

Since you have only one disk in the VG, you could use 'vgscan' command. However, it may not be used as a generic solution in this situation.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try