Operating System - HP-UX
1848540 Members
10343 Online
104033 Solutions
New Discussion

After re-creating lvol, bdf shows old size

 
SOLVED
Go to solution
Brad Marks
Super Advisor

After re-creating lvol, bdf shows old size

Per your advice, I backed-up, removed, and re-defined a lvol that I wanted to reduce in size.
Problem is: bdf reports the old value of the lvol's size. I trimmed it WAY down from 1gb. to 100mb.
Is there a file that has the old value(s) and needs to be tweaked?

Thanks!
Brad
It's not impossible -- it'll just cost more...
24 REPLIES 24
Patrick Wallek
Honored Contributor

Re: After re-creating lvol, bdf shows old size

What steps did you take?

Did you remove the LV (lvremove) and then recreate it (lvcreate)? Or did you do an lvreduce?

Did you use newfs or fsadm on the new LV? Is it hfs or vxfs?

A little more information would be helpful.

Can you show the output of bdf for the LV?
Sridhar Bhaskarla
Honored Contributor

Re: After re-creating lvol, bdf shows old size

Brad,

I assume you following the following steps after taking the backup of /usr1.

1. lvremove /dev/vg0x/lvolx
2. lvcreate -n lvolx -L 100 /dev/vg0x/lvolx
3. newfs -F vxfs /dev/vg0x/rvolx
4. Copy the data back

If you followed the above process, you should be seeing only 100MB. I see two possibilities with your problem

1. Either you mistakenly mentioned 1000 instead of 100 during the lvcreate OR
2. You didn't use the above procedure but lvreduced the same lvol without unmounting the
file system. If so, try to unmount and mount the file system again. If this doesn't fix the problem, following the above procedure.

-Sri

You may be disappointed if you fail, but you are doomed if you don't try
A. Clay Stephenson
Acclaimed Contributor

Re: After re-creating lvol, bdf shows old size

Taking what you say at face value, it appears that you did an online resizing of the lvol but did not resize the filesystem. Probably your safest bet is to do a newfs on this lvol and restore from backup. You could try resizing the filesystem via fsadm -F vxfs but I would feel safer using newfs now if and only if you have a known good backup. The other possibility is that you built a brand new lvol and are loking at the old.
If it ain't broke, I can fix that.
Sridhar Bhaskarla
Honored Contributor

Re: After re-creating lvol, bdf shows old size

Small correction in my above message..

2. lvcreate -n lvolx -L 100 /dev/vg0x

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

Re: After re-creating lvol, bdf shows old size

Hi,

Did you create a new file system with 'newfs' command ? Does the 'lvdisplay -v' shows the correct size ? Can you do an 'fsck'on the LV to correct the problem ?

These are the normal steps:

1)backup file system
2)Remove LV (lvremove)
3)Create new LV (lvcreate -L new_size)
4)Create file system (newfs)
5)Restore backup

HTH,
Shiju
Life is a promise, fulfill it!
Sanjay_6
Honored Contributor

Re: After re-creating lvol, bdf shows old size

Hi Brad,

Did you remove the lv completely and then recreated it ?. It should not take anything from the old lv. There are two file in /dev/vg_name called lv_name and rlv_name. Here vg_name is the name of the VG to which this lv belongs and lv_name is the name of the lv. the rlv_name is the name of the raw file for the lv.

When you remove the lv, it removed both the files and that removes all the lv info. Then you create a new lv and it recreates the file and recreated the lv on the disk as per size specified. Then you do a "newfs" on this lv to create a new filesystem and then add this lv info in /etc/fstab to mount the lv automatically during system boot.

Hope this helps.

Regds
Brad Marks
Super Advisor

Re: After re-creating lvol, bdf shows old size

Sorry about the lack of info...

Here's the bdf output:
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol9 1024000 1363 958728 0% /usr2

I used SAM to remove the lvol and also to create the new lvol. The lvol type is vxfs. Since no one suggested that I use SAM, was SAM a mistake?
Per Sri's suggestion I unmounted and remounted the lvol, but to no avail.

Since I've not restored data, I can re-recreate it if need be.

Thanks for the helpful and speedy responses!

Brad
It's not impossible -- it'll just cost more...
Helen French
Honored Contributor

Re: After re-creating lvol, bdf shows old size

Hi,

Using SAM is good for these tasks. Did you create a file system after creating the lvol ?

Can u do an lvdisplay -v /dev/vgxx/lvolx

Shiju
Life is a promise, fulfill it!
Sanjay_6
Honored Contributor

Re: After re-creating lvol, bdf shows old size

Hi Brad,

If it is a simple lv creation with no strings then it is okay to do the removal and recreation through SAM. Give it one more try. I still don't understand why it didn't work in the first place. Hope there was no error during the lv removal and recreation phase.

Hope this helps.

Regds
Uday_S_Ankolekar
Honored Contributor

Re: After re-creating lvol, bdf shows old size

Hi,
No problem doing this with SAM. Try doing this time with command line one more time since you havn't restored data. This would give you chance if there are any errors during each command.

What does lvdisplay -v /dev/vgnn/lvnn shows..??

Reduce the logical volume to the needed size:


# lvreduce -L [lv_size_MB] /dev/vgnn/lvolnn

-Goodluck
-USA..
Good Luck..
Brad Marks
Super Advisor

Re: After re-creating lvol, bdf shows old size

Shiju,
Yes I can do a lvdisplay; the results are attached.

I guess I'm going to do a lvremove
lvcreate
newfs

We'll see what happens...
It's not impossible -- it'll just cost more...
Helen French
Honored Contributor

Re: After re-creating lvol, bdf shows old size

Hi Brad,

The lvdisplay shows the correct size of the file system. Try this:

# newfs -F fs_type /dev/vg00/rlvol9
# mount /dev/vg00/lvol9 /mount_dir
# bdf

Also do an fsck on the lvol for any errors.

# fsck /dev/vg00/rlvol9

HTH,
Shiju
Life is a promise, fulfill it!
Brad Marks
Super Advisor

Re: After re-creating lvol, bdf shows old size

I was successful with the lvremove, but the lvcreate had this to say:
"# lvcreate -n lvol9 -L 100 /dev/vg00/lvolx

lvcreate: Volume group "/dev/vg00/lvolx" does not exist in the "/etc/lvmtab" fil
e."

I've attached /etc/lvmtab for your viewing pleasure.

What should I do now?

BAM
It's not impossible -- it'll just cost more...
Brad Marks
Super Advisor

Re: After re-creating lvol, bdf shows old size

...and, by the way, I DIDN'T use "lvolx" I DID use "lvol9" with the same exact result.
It's not impossible -- it'll just cost more...
Sanjay_6
Honored Contributor

Re: After re-creating lvol, bdf shows old size

Hi Brad,

you lvdisplay output shows the size of the lv as 100MB.

Hope this helps.

Regds
Uday_S_Ankolekar
Honored Contributor

Re: After re-creating lvol, bdf shows old size

Hi,

lvdisplay looks good what about bdf..??

Try recreating lvmtab by vgscan. First have a copy of lvmtab then run vgscan

-USA..
Good Luck..
Sridhar Bhaskarla
Honored Contributor

Re: After re-creating lvol, bdf shows old size

Brad,

Check my correction. Your commmadn should be

lvcreate -n lvol9 -L 100 /dev/vg00

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

Re: After re-creating lvol, bdf shows old size

Hi Brad,

The last lvcreate error you report is because the last argument should be the VG name, not an LV name:
lvcreate -n lvol9 -L 100 /dev/vg00

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Brad Marks
Super Advisor

Re: After re-creating lvol, bdf shows old size

Okay, I got lvcreate to work. lvdisplay looks good (in that the size is 100). But.... bdf still says 1gb.!
Any other suggestions?
It's not impossible -- it'll just cost more...
Brad Marks
Super Advisor

Re: After re-creating lvol, bdf shows old size

By Jove, I've got it!
I forgot to do the newfs command.

THANKS! for all the help everybody.

Until my next quandry,
Brad
It's not impossible -- it'll just cost more...
Sanjay_6
Honored Contributor
Solution

Re: After re-creating lvol, bdf shows old size

Hi Brad,

do a vgsync /dev/vg00 and then unmount all the filesystems and then mount them all,

# vgsync /dev/vg00
# umountall
# mount -a
Then check the bdf output.

Hope this helps.

Regds
Sanjay_6
Honored Contributor

Re: After re-creating lvol, bdf shows old size

hi Brad,

you can also do a "vgdisplay -v /dev/vg00" to see what is the vgdisplay info. Can you post a "lvlnboot -v" output. if the problem is not solved by unmounting and remounting the filesystems.

thanks
Darrell Allen
Honored Contributor

Re: After re-creating lvol, bdf shows old size

Hi again Brad,

I know you've got your answer but things just seem a little odd. So, I ran thru the procedure of removing and recreating a filesystem and logical volume and have attached the output for you. Perhaps you can compare it to what you did to see if and where your procedure differed.

I just don't see how bdf kept showing the wrong info IF you did umount, lvremove, lvcreate, newfs, and mount in the correct order without errors.

Best of luck,
Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
James R. Ferguson
Acclaimed Contributor

Re: After re-creating lvol, bdf shows old size

Hi Brad:

Forgot the 'newfs' command...see my postscript in your original post! ;-)

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x6a2bcb60e503d6118ff40090279cd0f9,00.html

Regards!

...JRF...