This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 216444 - resize lvm - bad: cant resize
resize lvm - bad: cant resize
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: lvm2 (Show other bugs)
6
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Milan Broz
Corey Marthaler
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-20 10:06 EST by Need Real Name
Modified: 2013-02-28 23:04 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-11-24 05:34:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
1st: raid before, 2nd & 3rd are after change HDDs in Raid (54.35 KB, image/jpeg)
2006-11-20 10:09 EST, Need Real Name
no flags Details

  None (edit)
Description Need Real Name 2006-11-20 10:06:55 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/20061011 Fedora/1.5.0.7-7.fc6 Firefox/1.5.0.7

Description of problem:

a server with scsi raid (300 GB)

all harddisks in the raid-system chaned to bigger, the raid size is now 600 GB

i cant resize the lvm partiton to extend the filesystems in the LVM

LVM is on /dev/sda3

Version-Release number of selected component (if applicable):
lvm2

How reproducible:
Always


Steps to Reproduce:
1.install on raidsystem
2.change all harddisks in the raid top bigger harddisks
3.resize the LVM on sda3

Actual Results:


Expected Results:


Additional info:
Comment 1 Need Real Name 2006-11-20 10:09:13 EST
Created attachment 141655 [details]
1st: raid before, 2nd & 3rd are after change HDDs in Raid
Comment 2 Milan Broz 2006-11-20 10:42:24 EST
Please can you specify command which failed, exact version of lvm and exact
decription of your lvm configuration ?
(i.e. output of: lvm version, pvs, lvs, dmsetup info -c)

If you are trying resize the LVM on partition sda3 you must resize this partition
first (with fdisk or similar tool) - and then call appropriate lvm commands (see
man pvresize) and then resize filesystem on top of lvm volume (e.g. resize2fs).
Comment 3 Need Real Name 2006-11-23 10:30:34 EST


Sorry i only have a VMWare Testsystem with Fedora Core 5, but the same Problem
with Fedora Core 6
and it is /dev/sda1 not /dev/sda3






lvm> version
  LVM version:     2.02.01 (2005-11-23)
  Library version: 1.02.02 (2005-12-02)
  Driver version:  4.7.0


Linux otrs 2.6.18-1.2200.fc5 #1 Sat Oct 14 16:59:26 EDT 2006 i686 i686 i386
GNU/Linux





[root@localhost ~]# fdisk -l /dev/sda

Disk /dev/sda: 6442 MB, 6442450944 bytes
16 heads, 63 sectors/track, 12483 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        3001     1512472+  8e  Linux LVM
[root@localhost ~]# parted /dev/sda
GNU Parted 1.7.1
Using /dev/hdd
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p

Disk /dev/sda: 6442MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  1549MB  1549MB  primary               lvm

(parted) resize 1 1 1008
Error: Could not detect file system.



[root@otrs /]# dmsetup info -c
Name             Maj Min Stat Open Targ Event  UUID
vgdata-data1     253   6 L--w    1    1      0
LVM-HacjUFJdRQuaaJx6P51N2Jgu8T7r4H7nwnHnZTsAe7ow0K4adiFdXnTQKEZX2IPD



[root@otrs /]# mount
/dev/mapper/vgdata-data1 on /data type ext3 (rw)



[root@localhost /]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda1
  VG Name               vgdata
  PV Size               1.44 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              369
  Free PE               344
  Allocated PE          25
  PV UUID               1UkEJw-vqDw-e0sE-uErF-MeE8-LbEF-NR7OMH




[root@localhost ~]# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "vgdata" using metadata type lvm2

[root@localhost ~]# vgs
  VG     #PV #LV #SN Attr   VSize VFree
  vgdata   1   1   0 wz--n- 1.44G   1.34G




[root@localhost ~]# vgdisplay vgdata
  --- Volume group ---
  VG Name               vgdata
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1.44 GB
  PE Size               4.00 MB
  Total PE              369
  Alloc PE / Size       0 / 0
  Free  PE / Size       369 / 1.44 GB
  VG UUID               HacjUF-JdRQ-uaaJ-x6P5-1N2J-gu8T-7r4H7n



[root@otrs ~]# lvmdiskscan
  /dev/sda1    [        1.44 GB] LVM physical volume




[root@localhost ~]# lvscan
  ACTIVE            '/dev/vgdata/data1' [100.00 MB] inherit


[root@localhost ~]# lvdisplay
  --- Logical volume ---
  LV Name                /dev/vgdata/data1
  VG Name                vgdata
  LV UUID                wnHnZT-sAe7-ow0K-4adi-FdXn-TQKE-ZX2IPD
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                100.00 MB
  Current LE             25
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:6




---------


[root@localhost ~]# pvresize --setphysicalvolumesize 5000M /dev/hdd1
WARNING: /dev/sda1: Overriding real size. You could lose data.
Physical volume "/dev/hdd1" changed
1 physical volume(s) resized / 0 physical volume(s) not resized


[root@otrs /]# fdisk -l /dev/hdd1

Disk /dev/hdd1: 1548 MB, 1548771840 bytes
16 heads, 63 sectors/track, 3000 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Disk /dev/hdd1 doesn't contain a valid partition table
[root@otrs /]# fdisk -l /dev/hdd

Disk /dev/hdd: 6442 MB, 6442450944 bytes
16 heads, 63 sectors/track, 12483 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        3001     1512472+  8e  Linux LVM




[root@localhost /]# pvs
  PV         VG     Fmt  Attr PSize PFree
  /dev/sda1  vgdata lvm2 a-   4.88G   4.78G


[root@localhost /]#  lvs
  LV     VG     Attr   LSize   Origin Snap%  Move Log Copy%
  data1  vgdata -wi-ao 100.00M




[root@localhost /]# lvresize -L +4000M /dev/vgdata/data1
  /dev/cdrom: open failed: Read-only file system
  Extending logical volume data1 to 4.00 GB
  device-mapper: reload ioctl failed: Invalid argument
  Failed to suspend data1


[root@localhost /]# lvresize -L +40M /dev/vgdata/data1
  /dev/cdrom: open failed: Read-only file system
  Extending logical volume data1 to 140.00 MB
  Logical volume data1 successfully resized


Comment 4 Need Real Name 2006-11-23 10:35:41 EST
sorry i forgot:

after the pvresize:

[root@localhost /]# vgdisplay
  --- Volume group ---
  VG Name               vgdata
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               4.88 GB
  PE Size               4.00 MB
  Total PE              1249
  Alloc PE / Size       35 / 140.00 MB
  Free  PE / Size       1214 / 4.74 GB
  VG UUID               HacjUF-JdRQ-uaaJ-x6P5-1N2J-gu8T-7r4H7n


But it dont works, how to resize without lost data ???

Comment 5 Milan Broz 2006-11-24 05:34:36 EST
If I undestard it clearly you are trying move data from old disk to new bigger,
right ?

So you need to add physical volume /dev/hdd1 to you existing volume group (see
man pvcreate, vgextend).
Now you can resize logical volume by lvresize or
move data from old physical volume /dev/sda1 to /dev/hdd1 (see man pvmove). 

(or you can remove unused /dev/sda1 by vgreduce from volume group after pvmove.) 

If you have correctly prepared lvm partition with fdisk do not use pvresize !
Comment 6 Need Real Name 2006-11-27 04:15:42 EST
>If I undestard it clearly you are trying move data from old disk to new bigger,
>right ?

No, i have a RAID5, this is as /dev/sda aval.
the the disk is going full, and i change the Harddisks in the RAID5-System
from for example 100 to 200 GB per Disk.

Now i have the more Space on /dev/sda, but i is not useable.
i dont wann make a new partiton an add it to the LVM
i wann expand the LVM Partiton so that i can expand the LV in the LVM

so that i can do this changing to bigger Harddisks in the RAID can
do more than once !

i hope you can understand my poor english.

Comment 7 Need Real Name 2006-11-27 04:17:54 EST
>If I undestard it clearly you are trying move data from old disk to new bigger,
>right ?

No, i have a RAID5, this is as /dev/sda aval.
the the disk is going full, and i change the Harddisks in the RAID5-System
from for example 100 to 200 GB per Disk.

Now i have the more Space (for example now 600GB, befor 300 GB) on /dev/sda, but
i is not useable. (but there are 300 GB unused space)
i dont wann make a new partiton an add it to the LVM
i wann expand the LVM Partiton so that i can expand the LV in the LVM

so that i can do this changing to bigger Harddisks in the RAID can
do more than once !

i hope you can understand my poor english.

Note You need to log in before you can comment on or make changes to this bug.