* [linux-lvm] lvextend problem
@ 2002-03-16 17:55 Jens Berlips
2002-03-16 19:13 ` Tim
0 siblings, 1 reply; 9+ messages in thread
From: Jens Berlips @ 2002-03-16 17:55 UTC (permalink / raw)
To: linux-lvm
Hello
I have two partitions on a 80gb harddrive.
/dev/hdb1
/dev/hdb2
I have created a VG called store_vg.
$vgcreate store_vg /dev/hdb2
then
$lvcreate -lXXX -nstore_lv store_vg
creating an LV using all space left on hdb2
What I wanted to do next was adding the hdb1
without loosing the data on hdb2.
So I did.
vgextend store_vg /dev/hdb1
then
lvextend -lXXX /dev/store_vg/store_lv /dev/hdb1
But I noticed that this didnt work and when doing a
$ df. I got the same results as before. I guess this has
to do with hdb1 not being formatted (using mkfs.xfs) correctly. When
reformatting the entire LV (extended with hdb1) I got everything to work.
But all data lost.
This was more of a test, so I didn't loose any critical data. But how
should this proceedure be done correctly?
Thanks in advance
Jens Berlips
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [linux-lvm] lvextend problem
2002-03-16 17:55 [linux-lvm] lvextend problem Jens Berlips
@ 2002-03-16 19:13 ` Tim
2002-03-17 2:01 ` Friedrich Lobenstock
0 siblings, 1 reply; 9+ messages in thread
From: Tim @ 2002-03-16 19:13 UTC (permalink / raw)
To: linux-lvm
you need to
1) extend the volume group (which you did)
2) extend the logical volume (which you did), and
3) extend the filesystem
before df will show the changes. The last item is the trickiest, I know
it *should* work with ext3, but when I did my big migration I added a
new LV and built a new fs on that -- no room for error since recovering
from a failure would take too long (1/2TB of live data!). With ext2 I
would have bit the bullet and done the extend. As for other
filesystems, I have no idea. ReiserFS gave me trouble with NFS/Samba so
I dropped it, maybe XFS is better, but I use ext3 for compatibiliy.
I think Andreas Dilger on this list actually maintains the ext2resize
codebase (or helps to, or took over from Ted T'so, or something) so
he'll hopefully chime in soon. Bottom line, make your backups first!
--t
Quoth Jens Berlips:
> Hello
>
> I have two partitions on a 80gb harddrive.
>
> /dev/hdb1
> /dev/hdb2
>
> I have created a VG called store_vg.
> $vgcreate store_vg /dev/hdb2
> then
> $lvcreate -lXXX -nstore_lv store_vg
> creating an LV using all space left on hdb2
>
> What I wanted to do next was adding the hdb1
> without loosing the data on hdb2.
>
> So I did.
> vgextend store_vg /dev/hdb1
> then
> lvextend -lXXX /dev/store_vg/store_lv /dev/hdb1
>
> But I noticed that this didnt work and when doing a
> $ df. I got the same results as before. I guess this has
> to do with hdb1 not being formatted (using mkfs.xfs) correctly. When
> reformatting the entire LV (extended with hdb1) I got everything to work.
> But all data lost.
>
> This was more of a test, so I didn't loose any critical data. But how
> should this proceedure be done correctly?
>
> Thanks in advance
> Jens Berlips
>
>
>
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html
--
"Make it ten... I am only a poor corrupt official."
--Capt. Louis Renault, _Casablanca_
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [linux-lvm] lvextend problem
2002-03-16 19:13 ` Tim
@ 2002-03-17 2:01 ` Friedrich Lobenstock
2002-03-22 17:07 ` bo
0 siblings, 1 reply; 9+ messages in thread
From: Friedrich Lobenstock @ 2002-03-17 2:01 UTC (permalink / raw)
To: linux-lvm
On Sat, 16 Mar 2002 20:12, Tim wrote:
>
> you need to
>
> 1) extend the volume group (which you did)
> 2) extend the logical volume (which you did), and
> 3) extend the filesystem
If you've used a ReiserFS filesystem a
/sbin/resize_reiserfs /dev/store_vg/store_lv
would have done the trick - online!
I can only say resize_reiserfs works like a charm for me.
--
MfG / Regards
Friedrich Lobenstock
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [linux-lvm] lvextend problem
2002-03-17 2:01 ` Friedrich Lobenstock
@ 2002-03-22 17:07 ` bo
0 siblings, 0 replies; 9+ messages in thread
From: bo @ 2002-03-22 17:07 UTC (permalink / raw)
To: linux-lvm
> > 1) extend the volume group (which you did)
> > 2) extend the logical volume (which you did), and
> > 3) extend the filesystem
>
> If you've used a ReiserFS filesystem a
> /sbin/resize_reiserfs /dev/store_vg/store_lv
> would have done the trick - online!
>
> I can only say resize_reiserfs works like a charm for me.
>
From my experiences,
mkreiserfs takes more time than resize_reiserfs, and also it has a
message like "formating" but no such message on resize_reiserfs.
I thought resize_reiserfs does not format the device added but it did not
have any problem to access after resize.
My question is "Does resize_reiserfs format the device which is added and
unformatted yet?"
Bo
^ permalink raw reply [flat|nested] 9+ messages in thread
* [linux-lvm] lvextend problem
@ 2007-02-27 15:55 Guilio Iannazzo
2007-02-27 21:01 ` Luca Berra
0 siblings, 1 reply; 9+ messages in thread
From: Guilio Iannazzo @ 2007-02-27 15:55 UTC (permalink / raw)
To: linux-lvm
Hi,
about the *environment* :
[root@priscilla var]# cat /proc/version
Linux version 2.4.21-20.ELsmp (bhcompile@tweety.build.redhat.com) (gcc
version 3.2.3 20030502 (Red Hat Linux 3.2.3-42)) #1 SMP Wed Aug 18
20:46:40 EDT 2004
The *problem* :
I extended a logical volume following the procedure
umount -l /dev/Volume00/var
lvextend -L+5G /dev/Volume00/var
e2fsck -f /dev/Volume00/var
mount -l /dev/Volume00/var
The ouput of e2fsck was as following :
[root@priscilla var]# e2fsck -f /dev/Volume00/var
e2fsck 1.32 (09-Nov-2002)
Pass 1: Checking inodes, blocks, and sizes
Duplicate blocks found... invoking duplicate block passes.
Pass 1B: Rescan for duplicate/bad blocks
Duplicate/bad block(s) in inode 40962: 164114 164115 164117
Duplicate/bad block(s) in inode 122885: 491781
Pass 1C: Scan directories for inodes with dup blocks.
Pass 1D: Reconciling duplicate blocks
(There are 2 inodes containing duplicate/bad blocks.)
File /run/utmp (inode #40962, mod time Tue Feb 27 10:20:28 2007)
has 3 duplicate block(s), shared with 1 file(s):
<filesystem metadata>
Clone duplicate/bad blocks<y>? yes
File /log/audit.d/bin.1 (inode #122885, mod time Tue Feb 27 14:01:00 2007)
has 1 duplicate block(s), shared with 1 file(s):
<filesystem metadata>
Clone duplicate/bad blocks<y>? yes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/Volume00/var: ***** FILE SYSTEM WAS MODIFIED *****
/dev/Volume00/var: 553/1572864 files (14.8% non-contiguous),
706071/6291456 blocks
Now, once the filesystem mounted, I've lost all the data I had on /var
(which I didn't back up, I know I know it's extremely stupid, luckily
enough this is not a production machine).
For example
[root@priscilla var]# ll /var/
total 0
however
[root@priscilla var]# mkdir /var/log
mkdir: cannot create directory `/var/log': File exists
??
What happened ? How to get all the data back ?
Thank you
Giulio
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [linux-lvm] lvextend problem
2007-02-27 15:55 Guilio Iannazzo
@ 2007-02-27 21:01 ` Luca Berra
0 siblings, 0 replies; 9+ messages in thread
From: Luca Berra @ 2007-02-27 21:01 UTC (permalink / raw)
To: linux-lvm
On Tue, Feb 27, 2007 at 04:55:00PM +0100, Guilio Iannazzo wrote:
>Hi,
>about the *environment* :
>[root@priscilla var]# cat /proc/version
>Linux version 2.4.21-20.ELsmp (bhcompile@tweety.build.redhat.com) (gcc
>version 3.2.3 20030502 (Red Hat Linux 3.2.3-42)) #1 SMP Wed Aug 18
>20:46:40 EDT 2004
>
>The *problem* :
>I extended a logical volume following the procedure
>
>umount -l /dev/Volume00/var
from umount man page:
-l Lazy unmount. Detach the filesystem from the filesystem hierar-
chy now, and cleanup all references to the filesystem as soon as
it is not busy anymore. (Requires kernel 2.4.11 or later.)
the key phrase here is: "as soon as it is not busy anymore"
>lvextend -L+5G /dev/Volume00/var
harmless
>e2fsck -f /dev/Volume00/var
so you fscked an active filesystem, bad bad bad...
--- i think you wanted to resize2fs here ---
>mount -l /dev/Volume00/var
'mount -l' is _not_ the opposite of 'umount -l'
....
>
>Now, once the filesystem mounted, I've lost all the data I had on /var
>(which I didn't back up, I know I know it's extremely stupid, luckily
>enough this is not a production machine).
>For example
>
>[root@priscilla var]# ll /var/
>total 0
>
>however
>
>[root@priscilla var]# mkdir /var/log
>mkdir: cannot create directory `/var/log': File exists
>
>??
>What happened ? How to get all the data back ?
is the filesystem really mounted now?
- reboot the machine into single user
- fsck the filesystem again
- and try mounting it and check all data is still here.
if it is:
- backup your data
- umount the filesystem (really, not using -l)
- fsck -f
- resize2fs
- mount again
- return to multi-user
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 9+ messages in thread
* [linux-lvm] lvextend problem
@ 2007-06-14 18:08 Nikolay Yevik
2007-06-14 19:01 ` Alasdair G Kergon
0 siblings, 1 reply; 9+ messages in thread
From: Nikolay Yevik @ 2007-06-14 18:08 UTC (permalink / raw)
To: linux-lvm
[-- Attachment #1: Type: text/plain, Size: 5768 bytes --]
Greetings,
I would greatly appreciate if anyone can help me with the issue I am
having with vgextend.
I am trying to extend my LV but getting error about insufficient
extents, while there are enough free PEs in the VG.
Here is setup information:
# lvm version
LVM version: 2.02.13 (2006-10-27)
Library version: 1.02.12 (2006-10-13)
Driver version: 4.7.0
# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 system lvm2 a- 6.50G 708.00M
/dev/sda3 data lvm2 a- 1.42G 0
/dev/sdb1 data lvm2 a- 2.99G 0
/dev/sdc1 system lvm2 a- 2.99G 2.99G
# vgs
VG #PV #LV #SN Attr VSize VFree
data 2 3 0 wz--n- 4.41G 0
system 2 3 0 wz--n- 9.49G 3.68G
# lvs
LV VG Attr LSize Origin Snap% Move Log Copy%
data1 data -wi-ao 728.00M
data2 data -wi-ao 728.00M
data3 data -wi-ao 2.99G
home system -wi-ao 128.00M
root system -wi-ao 5.00G
swap system -wi-ao 700.00M
# vgdisplay
--- Volume group ---
VG Name data
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 11
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 2
Act PV 2
VG Size 4.41 GB
PE Size 4.00 MB
Total PE 1130
Alloc PE / Size 1130 / 4.41 GB
Free PE / Size 0 / 0
VG UUID 4I2UCL-raKY-a6Kt-b2SE-2vAV-vHB9-UndWx9
--- Volume group ---
VG Name system
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 13
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 2
Act PV 2
VG Size 9.49 GB
PE Size 4.00 MB
Total PE 2430
Alloc PE / Size 1487 / 5.81 GB
Free PE / Size 943 / 3.68 GB
VG UUID KQ3dPF-X92n-0HVb-sYl5-iARG-wUEX-iEGJsG
# lvscan
ACTIVE '/dev/data/data1' [728.00 MB] inherit
ACTIVE '/dev/data/data2' [728.00 MB] inherit
ACTIVE '/dev/data/data3' [2.99 GB] inherit
ACTIVE '/dev/system/home' [128.00 MB] inherit
ACTIVE '/dev/system/root' [5.00 GB] inherit
ACTIVE '/dev/system/swap' [700.00 MB] inherit
# mount
/dev/mapper/system-root on / type ext3 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sda1 on /boot type ext3 (rw,acl,user_xattr)
/dev/mapper/system-home on /home type ext3 (rw,acl,user_xattr)
/dev/mapper/data-data1 on /mnt/data1 type ext3 (rw,acl,user_xattr)
/dev/mapper/data-data2 on /mnt/data2 type ext3 (rw,acl,user_xattr)
/dev/mapper/data-data3 on /mnt/data3 type ext3 (rw,acl,user_xattr)
.host:/ on /mnt/hgfs type vmhgfs (rw,ttl=5)
securityfs on /sys/kernel/security type securityfs (rw)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
So "system" VG uses /dev/sda2 with 708M free and /dev/sdc1 with 2.99G
free.
This is confirmed by:
#pvdisplay /dev/sda2
--- Physical volume ---
PV Name /dev/sda2
VG Name system
PV Size 6.50 GB / not usable 3.76 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 1664
Free PE 177
Allocated PE 1487
PV UUID fYVfh6-wMQ2-X2Zv-AJ6R-2CgK-c97o-KfPoLz
# pvdisplay /dev/sdc1
--- Physical volume ---
PV Name /dev/sdc1
VG Name system
PV Size 3.00 GB / not usable 3.07 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 766
Free PE 766
Allocated PE 0
PV UUID XUUjaG-okI9-AQbG-JLwa-oqBO-rkse-pTyg53
So there is a total of free 943 PE (4M each) in "system" VG.
I want to extend /dev/system/root:
# lvextend -l+2 /dev/system/root /dev/sdc1
Extending logical volume root to 5.01 GB
Insufficient free space: 1282 extents needed, but only 766 available
Or
# lvextend -l+2 /dev/system/root
Extending logical volume root to 5.01 GB
Insufficient free space: 1282 extents needed, but only 943 available
Same if I specify actual size (in MB or GB) instead if number of PEs.
Looks like it tries to reallocate the whole LV to the size needed
instead of just adding the needed size from VG free space
to the already existing LV.
What I am not understanding or missing here?
Respectfully,
Nikolay V. Yevik
----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.
[-- Attachment #2: Type: text/html, Size: 31512 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [linux-lvm] lvextend problem
2007-06-14 18:08 Nikolay Yevik
@ 2007-06-14 19:01 ` Alasdair G Kergon
2007-06-14 19:50 ` Nikolay Yevik
0 siblings, 1 reply; 9+ messages in thread
From: Alasdair G Kergon @ 2007-06-14 19:01 UTC (permalink / raw)
To: LVM general discussion and development
On Thu, Jun 14, 2007 at 01:08:30PM -0500, Nikolay Yevik wrote:
> LVM version: 2.02.13 (2006-10-27)
Upgrade. There was a bug causing this (only) in 2.02.13.
Alasdair
--
agk@redhat.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [linux-lvm] lvextend problem
2007-06-14 19:01 ` Alasdair G Kergon
@ 2007-06-14 19:50 ` Nikolay Yevik
0 siblings, 0 replies; 9+ messages in thread
From: Nikolay Yevik @ 2007-06-14 19:50 UTC (permalink / raw)
To: LVM general discussion and development
Thanks,
I updated to lvm2-2.02.13-10.2 (this is on OpenSUSE 10.2) and the
problem went away.
-----Original Message-----
From: linux-lvm-bounces@redhat.com [mailto:linux-lvm-bounces@redhat.com]
On Behalf Of Alasdair G Kergon
Sent: Thursday, June 14, 2007 2:02 PM
To: LVM general discussion and development
Subject: Re: [linux-lvm] lvextend problem
On Thu, Jun 14, 2007 at 01:08:30PM -0500, Nikolay Yevik wrote:
> LVM version: 2.02.13 (2006-10-27)
Upgrade. There was a bug causing this (only) in 2.02.13.
Alasdair
--
agk@redhat.com
_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-06-14 19:51 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-16 17:55 [linux-lvm] lvextend problem Jens Berlips
2002-03-16 19:13 ` Tim
2002-03-17 2:01 ` Friedrich Lobenstock
2002-03-22 17:07 ` bo
-- strict thread matches above, loose matches on Subject: below --
2007-02-27 15:55 Guilio Iannazzo
2007-02-27 21:01 ` Luca Berra
2007-06-14 18:08 Nikolay Yevik
2007-06-14 19:01 ` Alasdair G Kergon
2007-06-14 19:50 ` Nikolay Yevik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).