kwilczynski/facter-facts

partitions.rb does not report partitions on linux raid devices

cwseys opened this issue · 8 comments

E.g. no /dev/md1 reported:

facter -p | grep partitions

partitions => {"sda1"=>{"size"=>"1951744", "label"=>"sysresccd:0", "filesystem"=>"linux_raid_member"}, "sda2"=>{"size"=>"1463193600", "label"=>"vmhost12:1", "filesystem"=>"linux_raid_member"}, "sdb1"=>{"size"=>"1951744", "label"=>"sysresccd:0", "filesystem"=>"linux_raid_member"}, "sdb2"=>{"size"=>"1463193600", "label"=>"vmhost12:1", "filesystem"=>"linux_raid_member"}, "sdc1"=>{"size"=>"1951744", "label"=>"sysresccd:0", "filesystem"=>"linux_raid_member"}, "sdc2"=>{"size"=>"1463193600", "label"=>"vmhost12:1", "filesystem"=>"linux_raid_member"}, "sdd1"=>{"size"=>"1951744", "label"=>"sysresccd:0", "filesystem"=>"linux_raid_member"}, "sdd2"=>{"size"=>"1463193600", "label"=>"vmhost12:1", "filesystem"=>"linux_raid_member"}}

But there is a /dev/md1 with partitions:

parted /dev/md1 print

Model: Linux Software RAID Array (md)
Disk /dev/md1: 2247GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1573kB 24.0GB 24.0GB primary linux-swap(v1)
2 24.0GB 54.0GB 30.0GB primary lvm
3 54.0GB 2247GB 2193GB primary lvm

@lickdragon apologies for missing out on this! For some reason I haven't got the notification :( I will look into fixing this as soon as possible.

@lickdragon this is the reason why Linux RAID is excluded: https://github.com/kwilczynski/facter-facts/blob/master/partitions.rb#L28

It should be easy to just remove md from the exclude list.

Hello,
No problem on not getting back. I had kind of forgotten.
OK, I see that md is on the exclude list and we could locally remove it.

But I wonder, why exclude anything? I guess I'd want facter to provide the
facts and then I would locally exclude or focus on the facts I want.

Thanks for your time!
Chad.

On Monday, August 31, 2015 17:43:20 Krzysztof Wilczynski wrote:

@lickdragon this is the reason why Linux RAID is excluded:
https://github.com/kwilczynski/facter-facts/blob/master/partitions.rb#L28

It should be easy to just remove md from the exclude list.


Reply to this email directly or view it on GitHub:
#5 (comment)

Hi,

Some of the things excluded there would make no sense to include, others might need handling as a special case (would be fine).

How do /dev/md1 partitions are showing up in your case? Would it be /dev/md1p1, etc?

On Tuesday, September 01, 2015 08:56:50 Krzysztof Wilczynski wrote:

Hi,

Some of the things excluded there would make no sense to include, others
might need handling as a special case (would be fine).

OK. Thanks!

How do /dev/md1 partitions are showing up in your case? Would it be
/dev/md1p1, etc?

Sorry forgot to include. Yep, that is it.

ls /dev/md* -d

/dev/md0 /dev/md1 /dev/md1p1 /dev/md1p2

Note that /dev/md0 also has a partition (apparently loop partition table
type!), but does not show up as a /dev/md0p1

parted /dev/md0 print

Model: Linux Software RAID Array (md)
Disk /dev/md0: 999MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number Start End Size File system Flags
1 0.00B 999MB 999MB ext4

And /dev/md1p1 and /dev/md1p2 are partitions on /dev/md1:

parted /dev/md1 print

Model: Linux Software RAID Array (md)
Disk /dev/md1: 5998GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1573kB 50.0GB 50.0GB primary msftdata
2 50.0GB 5998GB 5948GB primary msftdata

Thanks again!
C.

@lickdragon sorry for the delay. I had a look at this, and it turns out that this is not coming from my fact. This is coming out from the new Facter and its new facts engine.

Regardless, I have closed this in 5aa3e32, and the output would work as follows:

Given a single /dev/md0 with two backing devices and two partitions atop /dev/md0:

root@ubuntu1404:~# cat /proc/mdstat
Personalities : [raid0]
md0 : active raid0 sdc1[1] sdb1[0]
      2096640 blocks super 1.2 256k chunks

unused devices: <none>
root@ubuntu1404:~# echo p | fdisk /dev/md0

Command (m for help):
Disk /dev/md0: 2146 MB, 2146959360 bytes
2 heads, 4 sectors/track, 524160 cylinders, total 4193280 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disk identifier: 0x00000000

    Device Boot      Start         End      Blocks   Id  System
/dev/md0p1               4     1999999      999998   83  Linux
Partition 1 does not start on physical sector boundary.
/dev/md0p2         2000000     4193279     1096640   83  Linux
Partition 2 does not start on physical sector boundary.

Command (m for help):
root@ubuntu1404:~#

The output would be:

root@ubuntu1404:~# facter -p | grep partitions_
partitions_md0 => md0p1,md0p2
partitions_sda => sda1,sda2,sda5
partitions_sdb => sdb1
partitions_sdc => sdc1

Two for /dev/md0 and one for each of the /dev/sdb and /dev/sdc.

Again, sorry for the delay. I hope this fixes the problem for you with my fact. As far as the upstream is concerned, you need to open a bug against Facter with PuppetLabs.

Thanks,
The output looks good to me!

Chad.

On Sunday, June 19, 2016 21:08:31 Krzysztof Wilczynski wrote:

@lickdragon sorry for the delay. I had a look at this, and it turns out that
this is not coming from my fact. This is coming out from the new Facter and
its new facts engine.

Regardless, I have closed this in 5aa3e32, and the output would work as
follows:

Given a single /dev/md0 with two backing devices and two partitions atop
/dev/md0:

root@ubuntu1404:~# cat /proc/mdstat
Personalities : [raid0]
md0 : active raid0 sdc1[1] sdb1[0]
      2096640 blocks super 1.2 256k chunks

unused devices: <none>
root@ubuntu1404:~# echo p | fdisk /dev/md0

Command (m for help):
Disk /dev/md0: 2146 MB, 2146959360 bytes
2 heads, 4 sectors/track, 524160 cylinders, total 4193280 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disk identifier: 0x00000000

    Device Boot      Start         End      Blocks   Id  System
/dev/md0p1               4     1999999      999998   83  Linux
Partition 1 does not start on physical sector boundary.
/dev/md0p2         2000000     4193279     1096640   83  Linux
Partition 2 does not start on physical sector boundary.

Command (m for help):
root@ubuntu1404:~#

The output would be:

root@ubuntu1404:~# facter -p | grep partitions_
partitions_md0 => md0p1,md0p2
partitions_sda => sda1,sda2,sda5
partitions_sdb => sdb1
partitions_sdc => sdc1

Two for /dev/md0 and one for each of the /dev/sdb and /dev/sdc.

Again, sorry for the delay. I hope this fixes the problem for you with my
fact. As far as the upstream is concerned, you need to open a bug against
Facter with PuppetLabs.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#5 (comment)

@lickdragon my pleasure! Let me know if you need anything else, happy to help.