Bug 679799

Summary: blkid reports partitioned disk sdc as being an LVM PV
Product: [Fedora] Fedora Reporter: Matěj Cepl <mcepl>
Component: util-linux-ngAssignee: Karel Zak <kzak>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: ajax, anaconda-maint-list, jonathan, kzak, mcepl, vanmeeuwen+fedora, xgl-maint, yaneti
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: util-linux-2.19-3.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-08 02:18:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
/rmp/anaconda.log
none
/tmp/program.log
none
/tmp/storage.log
none
output of dmesg command
none
/var/log/messages from LiveCD system from which I want to install
none
screenshot of the error message
none
fdisk -l and blkid report none

Description Matěj Cepl 2011-02-23 14:33:14 UTC
Created attachment 480468 [details]
/rmp/anaconda.log

Description of problem:
By making a mistake in my backup script I have blown away my /etc (and what's even worse my /home and /var/lib/rpm), which includes blowing away /etc/lvm.

Now, all lvm commands on command line work fine (lvs, pvs, vgs, vgscan -vvvv, etc.; mbroz from LVM team went over vgscan -vvvvv output and he didn't see anything wrong with it), but when I start liveinst to upgrad to Fedora 14, I get the attached error.

Version-Release number of selected component (if applicable):
libblkid-2.18-4.8.fc14.i686
kernel-2.6.35.6-45.fc14.i686
lvm2-2.02.73-3.fc14.i686
util-linux-ng-2.18-4.8.fc14.i686
lvm2-libs-2.02.73-3.fc14.i686
anaconda-14.22-1.fc14.i686
anaconda-yum-plugins-1.0-5.fc12.noarch

How reproducible:
100%

Steps to Reproduce:
1.see above
2.
3.
  
Actual results:
the only abvailable option is "Reinitialize volume group" (which I guess mean wipiing them out]

Expected results:
anaconda should be able to reconstruct all necessary LVM infomatino, when LVM tools can.

Additional info:
[root@localhost ~]# pvs
  PV         VG   Fmt  Attr PSize   PFree  
  /dev/sda2  vg0  lvm2 a-    74.00g      0 
  /dev/sdc1  vg0  lvm2 a-   200.00g  50.59g
  /dev/sdc2  vg0  lvm2 a-   300.00g      0 
  /dev/sdc3  vg0  lvm2 a-   300.00g      0 
  /dev/sdc4  vg0  lvm2 a-   131.47g 131.47g
[root@localhost ~]# vgs
l  VG   #PV #LV #SN Attr   VSize    VFree  
  vg0    5   5   0 wz--n- 1005.47g 182.06g
[root@localhost ~]# lvs
  LV       VG   Attr   LSize   Origin Snap%  Move Log Copy%  Convert
  lvBackup vg0  -wi--- 400.00g                                      
  lvHome   vg0  -wi--- 400.00g                                      
  lvRoot   vg0  -wi---   7.75g                                      
  lvSwap   vg0  -wi--- 800.00m                                      
  lvVar    vg0  -wi---  14.88g                                      
[root@localhost ~]#

Comment 1 Matěj Cepl 2011-02-23 14:35:13 UTC
Created attachment 480471 [details]
/tmp/program.log

Comment 2 Matěj Cepl 2011-02-23 14:35:48 UTC
Created attachment 480472 [details]
/tmp/storage.log

Comment 3 Matěj Cepl 2011-02-23 14:38:14 UTC
Created attachment 480473 [details]
output of dmesg command

Comment 4 Matěj Cepl 2011-02-23 14:40:08 UTC
Created attachment 480476 [details]
/var/log/messages from LiveCD system from which I want to install

Comment 5 Matěj Cepl 2011-02-23 14:49:13 UTC
Created attachment 480483 [details]
screenshot of the error message

Comment 6 Matěj Cepl 2011-02-23 15:15:23 UTC
Created attachment 480491 [details]
fdisk -l and blkid report

Comment 7 Matěj Cepl 2011-02-23 15:17:55 UTC
And particularly

BLKID_DEBUG=0xFFFF blkid -p -o udev /dev/sdc

gives

libblkid: debug mask set to 0xffff.
ready for low-probing, offset=0, size=1000204886016
found entire diskname for devno 0x0820 as sdc
whole-disk: YES, regfile: NO
chain safeprobe superblocks ENABLED
--> starting probing loop [SUBLKS idx=-1]
[0] linux_raid_member:
	call probefunc()
	buffer read: off=1000204795904 len=64
	buffer read: off=1000204877824 len=256
	buffer read: off=0 len=256
	buffer read: off=4096 len=256
[1] ddf_raid_member:
	call probefunc()
	buffer read: off=1000204885504 len=512
	buffer read: off=1000204754432 len=512
[2] isw_raid_member:
	call probefunc()
	buffer read: off=1000204884992 len=48
[3] lsi_mega_raid_member:
	call probefunc()
	reuse buffer: off=1000204885504 len=512
[4] via_raid_member:
	call probefunc()
	reuse buffer: off=1000204885504 len=512
[5] silicon_medley_raid_member:
	call probefunc()
	reuse buffer: off=1000204885504 len=512
[6] nvidia_raid_member:
	call probefunc()
	reuse buffer: off=1000204884992 len=48
[7] promise_fasttrack_raid_member:
	call probefunc()
	buffer read: off=1000204853760 len=24
	buffer read: off=1000204755456 len=24
	buffer read: off=1000204754944 len=24
	reuse buffer: off=1000204877824 len=256
	buffer read: off=1000204681728 len=24
[8] hpt45x_raid_member:
	call probefunc()
	buffer read: off=1000204880384 len=4
[9] hpt37x_raid_member:
	buffer read: off=4096 len=1024
	reuse buffer: off=4096 len=1024
[10] adaptec_raid_member:
	call probefunc()
	reuse buffer: off=1000204885504 len=512
[11] jmicron_raid_member:
	call probefunc()
	reuse buffer: off=1000204885504 len=512
[12] drbd:
	call probefunc()
	buffer read: off=1000204881920 len=4096
[13] LVM2_member:
	buffer read: off=0 len=1024
	magic sboff=536, kboff=0
	call probefunc()
	reuse buffer: off=0 len=1024
assigning UUID [superblocks]
assigning VERSION [superblocks]
assigning TYPE [superblocks]
assigning USAGE [superblocks]
<-- leaving probing loop (type=LVM2_member) [SUBLKS idx=13]
chain safeprobe topology DISABLED
chain safeprobe partitions ENABLED
returning UUID value
ID_FS_UUID=3zni0y-TB69-pror-QUKi-mh5T-5mIe-Z54av1
ID_FS_UUID_ENC=3zni0y-TB69-pror-QUKi-mh5T-5mIe-Z54av1
returning VERSION value
ID_FS_VERSION=LVM2\x20001
returning TYPE value
ID_FS_TYPE=LVM2_member
returning USAGE value
ID_FS_USAGE=raid
reseting probing buffers
buffers summary: 8148 bytes by 15 read() call(s)

Comment 8 Matěj Cepl 2011-02-23 15:25:57 UTC
[root@localhost ~]# pvs -o +uuid
  PV         VG   Fmt  Attr PSize   PFree   PV UUID                               
  /dev/sda2  vg0  lvm2 a-    74.00g      0  Ik1crT-x7Vb-UWTb-J93Q-aDCx-UpzE-f2CJGj
  /dev/sdc1  vg0  lvm2 a-   200.00g  50.59g pKzAj1-sT95-exY7-EVMW-zT4Z-g3gK-qXyWNU
  /dev/sdc2  vg0  lvm2 a-   300.00g      0  4i3Zu4-C1BR-gPPM-l1ye-agry-cRdM-mM8UOT
  /dev/sdc3  vg0  lvm2 a-   300.00g      0  jRpSkh-oi4l-Osmi-h81F-0qXq-kk8V-75Gj2y
  /dev/sdc4  vg0  lvm2 a-   131.47g 131.47g aFnqUF-P3S2-OZxr-ZGJw-7Qce-Scoo-EwCRf4
[root@localhost ~]#

Comment 9 Matěj Cepl 2011-02-23 15:30:41 UTC
[root@localhost ~]# wipefs /dev/sdc
wipefs: WARNING: /dev/sdc: appears to contain 'dos' partition table
offset               type
----------------------------------------------------------------
0x218                LVM2_member   [raid]
                     UUID:  3zni0y-TB69-pror-QUKi-mh5T-5mIe-Z54av1

[root@localhost ~]#

Comment 10 Matěj Cepl 2011-02-23 16:15:22 UTC
So yes,

wipefs -o 0x218 /dev/sdc

helped, so after that anaconda was able to read LVM table and continue in installation.

Thank you

Comment 11 Karel Zak 2011-02-23 16:16:54 UTC
So, the problem was old LVM superblock on /dev/sdc.

It seems that fdisk should be improved to wipe old signatures on devices. Now it allows to create MBR on device which is valid LVM member...

Comment 12 Fedora Update System 2011-02-24 13:47:00 UTC
util-linux-2.19-3.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/util-linux-2.19-3.fc15

Comment 13 Yanko Kaneti 2011-02-24 14:42:34 UTC
Let me describe a scenario to see if this change will screw it over.

- Have a vm disk of size A partiotioned with one small boot and one large lvm partition (vda1, vda2(lvm))  backed by a lv on the host.
- The goal is to increase the vm disk.
  - stop the vm
  - resize the disk lv
  - start the vm
  - within the vm use fdisk to remove then re-add the lvm partition , but with its new size due to the increased size of vda
  - pvresize to the new partition size

This used to work the last time I tried it. The change describe here sounds like  fdisk may wipe the pv info while removing then re-adding the partition. 
The whole exercise due to the stupid inability of fdisk to easy move just the end of the partition to the end of the underlying device.

Comment 14 Fedora Update System 2011-02-25 23:19:00 UTC
util-linux-2.19-3.fc15 has been pushed to the Fedora 15 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update util-linux'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/util-linux-2.19-3.fc15

Comment 15 Karel Zak 2011-02-26 13:17:27 UTC
(In reply to comment #13)
> Let me describe a scenario to see if this change will screw it over.

Note that util-linux-2.19-3.fc15 update does NOT modify fdisk. It improves libblkid ability to detect conflicts between MBR/GPT and LVM. The partition table is preferred if detected on area which was originally wiped by LVM.

> - Have a vm disk of size A partiotioned with one small boot and one large lvm
> partition (vda1, vda2(lvm))  backed by a lv on the host.
> - The goal is to increase the vm disk.
>   - stop the vm
>   - resize the disk lv
>   - start the vm
>   - within the vm use fdisk to remove then re-add the lvm partition , but with
> its new size due to the increased size of vda
>   - pvresize to the new partition size
> 
> This used to work the last time I tried it. The change describe here sounds
> like  fdisk may wipe the pv info while removing then re-adding the partition. 

 No, this all discussion is about whole-disks (e.g. sdc), not about partitions (e.g. sdc1). The fdisk modifies begin of the device where should be only partition table and boot loader. The problem is that there is sometimes also any obsolete unwanted signature (e.g. LVM).

> The whole exercise due to the stupid inability of fdisk to easy move just the
> end of the partition to the end of the underlying device.

Hmm.. probably nobody asked for this feature. Added to upstream TODO, it seems simple to implement something like this.

Comment 16 Yanko Kaneti 2011-02-26 16:12:30 UTC
Thanks for the explanation, Karel.

Comment 17 Fedora Update System 2011-03-08 02:18:38 UTC
util-linux-2.19-3.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.