Bug 1414510

Summary: guestfs_list_filesystems does not recognize ddf partitions
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: ptoscano, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-19 12:11:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1414505    

Description Richard W.M. Jones 2017-01-18 17:12:06 UTC
Description of problem:



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


How reproducible:


Steps to Reproduce:

1. Create two empty disks and run virt-rescue on them:
truncate -s 10G repro-disk1 repro-disk2
virt-rescue -a repro-disk1 -a repro-disk2

2. Using mdadm, create a ddf container and mirror device:
><rescue> mdadm -C /dev/md/ddf --raid-devices=2 /dev/sda /dev/sdb -e ddfmdadm: container /dev/md/ddf prepared.
><rescue> mdadm -C /dev/md0 /dev/md/ddf --level=mirror --raid-devices=2
mdadm: array /dev/md0 started.

3. Using fdisk, create some partitions:
><rescue> fdisk /dev/md0 
n
p
1
2048
+1024M
n
p
2
2099200
+1024M
n
p
3
4196352
20905983
t
2
82
w

The final partition layout will be:

Device     Boot   Start      End  Sectors Size Id Type
/dev/md0p1         2048  2099199  2097152   1G 83 Linux
/dev/md0p2      2099200  4196351  2097152   1G 82 Linux swap / Solaris
/dev/md0p3      4196352 20905983 16709632   8G 83 Linux

4. Exit from virt-rescue.

5. Run virt-filesystems:

$ virt-filesystems -a repro-disk1 -a repro-disk2 --all --long -h
Name        Type        VFS      Label  MBR  Size  Parent
/dev/sda1   filesystem  unknown  -      -    1.0G  -
/dev/sda2   filesystem  unknown  -      -    1.0G  -
/dev/sda3   filesystem  unknown  -      -    8.0G  -
/dev/sdb1   filesystem  unknown  -      -    1.0G  -
/dev/sdb2   filesystem  unknown  -      -    1.0G  -
/dev/sdb3   filesystem  unknown  -      -    8.0G  -
/dev/sd0    filesystem  unknown  -      -    10G   /dev/sda,/dev/sdb
/dev/sd127  filesystem  unknown  -      -    0     /dev/sda,/dev/sdb
/dev/sda1   partition   -        -      83   1.0G  /dev/sda
/dev/sda2   partition   -        -      82   1.0G  /dev/sda
/dev/sda3   partition   -        -      83   8.0G  /dev/sda
/dev/sdb1   partition   -        -      83   1.0G  /dev/sdb
/dev/sdb2   partition   -        -      82   1.0G  /dev/sdb
/dev/sdb3   partition   -        -      83   8.0G  /dev/sdb
/dev/sda    device      -        -      -    10G   -
/dev/sdb    device      -        -      -    10G   -


Actual results:

There are quite a few problems in the output:

* The /dev/md0p[1-3] partitions are not seen at all.
* The /dev/sda[123] and /dev/sdb[123] partitions are not real (the kernel actual gets this confused too, so maybe it's not really a libguestfs problem).
* /dev/sd127 shouldn't be shown (again this is a kernel problem).