GNU bug report logs - #36169
Why does parted change ownerships of devices?

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: parted; Reported by: Guillaume Abrioux <gabrioux@HIDDEN>; dated Tue, 11 Jun 2019 14:14:01 UTC; Maintainer for parted is bug-parted@HIDDEN.

Message received at 36169 <at> debbugs.gnu.org:


Received: (at 36169) by debbugs.gnu.org; 12 Jun 2019 18:32:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 12 14:32:45 2019
Received: from localhost ([127.0.0.1]:34059 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hb83B-0003be-Ki
	for submit <at> debbugs.gnu.org; Wed, 12 Jun 2019 14:32:45 -0400
Received: from mx1.redhat.com ([209.132.183.28]:55466)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bcl@HIDDEN>) id 1hb838-0003bO-PX
 for 36169 <at> debbugs.gnu.org; Wed, 12 Jun 2019 14:32:43 -0400
Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com
 [10.5.11.23])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.redhat.com (Postfix) with ESMTPS id 825073084249
 for <36169 <at> debbugs.gnu.org>; Wed, 12 Jun 2019 18:32:36 +0000 (UTC)
Received: from lister.brianlane.com (ovpn-112-31.phx2.redhat.com [10.3.112.31])
 by smtp.corp.redhat.com (Postfix) with ESMTPS id 1661629342
 for <36169 <at> debbugs.gnu.org>; Wed, 12 Jun 2019 18:32:33 +0000 (UTC)
Date: Wed, 12 Jun 2019 11:32:31 -0700
From: "Brian C. Lane" <bcl@HIDDEN>
To: 36169 <at> debbugs.gnu.org
Subject: Re: bug#36169: Why does parted change ownerships of devices?
Message-ID: <20190612182746.GB25631@HIDDEN>
References: <CANqTTH7Tijt1SiWx7qXOQtWv848nLtdUBrDZvcVtL13cizKECw@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CANqTTH7Tijt1SiWx7qXOQtWv848nLtdUBrDZvcVtL13cizKECw@HIDDEN>
User-Agent: Mutt/1.12.0 (2019-05-25)
X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
 (mx1.redhat.com [10.5.110.40]); Wed, 12 Jun 2019 18:32:36 +0000 (UTC)
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 36169
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

On Tue, Jun 11, 2019 at 11:23:47AM +0200, Guillaume Abrioux wrote:
> Hello,
> 
> We use parted in ceph-ansible playbook [1] to retrieve some devices
> information, the parted ansible module runs a parted/print command [2], but
> we are facing an issue where ownerships get modified after that.
> 
> Doing the test manually without ansible context shows it's parted itself
> which apply this change:
> 
> Before running parted on /dev/sdc:
> [root@osd0 ~]# ls -l /dev/sdc*
> brw-rw----. 1 root disk 8, 32 Jun 11 08:53 /dev/sdc
> brw-rw----. 1 ceph ceph 8, 33 Jun 11 08:53 /dev/sdc1
> brw-rw----. 1 ceph ceph 8, 34 Jun 11 08:53 /dev/sdc2
> 
> Running a basic parted/print:
> [root@osd0 ~]# parted -s /dev/sdc print
> Model: ATA QEMU HARDDISK (scsi)
> Disk /dev/sdc: 53.7GB
> Sector size (logical/physical): 512B/512B
> Partition Table: gpt
> Disk Flags:
> 
> Number  Start   End     Size    File system  Name           Flags
>  1      1049kB  1075MB  1074MB               ceph block.db
>  2      1075MB  2149MB  1074MB               ceph block.db
> 
> We can see ownerships have changed from ceph:ceph to root:disk:
> [root@osd0 ~]# ls -l /dev/sdc*
> brw-rw----. 1 root disk 8, 32 Jun 11 08:57 /dev/sdc
> brw-rw----. 1 root disk 8, 33 Jun 11 08:57 /dev/sdc1
> brw-rw----. 1 root disk 8, 34 Jun 11 08:57 /dev/sdc2
> [root@osd0 ~]#
> 
> I'm wondering whether there's a good reason for this or should it be
> considered as a bug?

How did you set the ownership of the partition devices in the first place?
You can't just manually set the ownership and permissions of device
nodes, you need to use udev (which is responsible for creating them) to
do that.

parted tells the kernel to rescan the partitions, so the device entries
are probably being recreated by udev, changing their ownership back to
whatever udev thinks they should be.

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted




Information forwarded to bug-parted@HIDDEN:
bug#36169; Package parted. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Jun 2019 14:13:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 11 10:13:43 2019
Received: from localhost ([127.0.0.1]:59887 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hahWw-0003nd-O4
	for submit <at> debbugs.gnu.org; Tue, 11 Jun 2019 10:13:43 -0400
Received: from lists.gnu.org ([209.51.188.17]:52546)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gabrioux@HIDDEN>) id 1had0e-0002Tw-Ov
 for submit <at> debbugs.gnu.org; Tue, 11 Jun 2019 05:24:05 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:39758)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <gabrioux@HIDDEN>) id 1had0d-0002BK-IH
 for bug-parted@HIDDEN; Tue, 11 Jun 2019 05:24:04 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,HTML_MESSAGE,
 RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <gabrioux@HIDDEN>) id 1had0b-0007MG-Gx
 for bug-parted@HIDDEN; Tue, 11 Jun 2019 05:24:03 -0400
Received: from mail-lf1-f42.google.com ([209.85.167.42]:41605)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <gabrioux@HIDDEN>) id 1had0b-0007Jd-7r
 for bug-parted@HIDDEN; Tue, 11 Jun 2019 05:24:01 -0400
Received: by mail-lf1-f42.google.com with SMTP id 136so8733726lfa.8
 for <bug-parted@HIDDEN>; Tue, 11 Jun 2019 02:24:00 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc;
 bh=S/uLQgrT//VAL5Dp5zXENhGEmaeSWCinDOk/dN5IV+g=;
 b=sZUUfKwg7ufTQYDgAorWJ/vIgdrCPnzWM0N58Fw4f7dVBY9vYVHEM3gNcdTvmbFT4/
 V74mToysGxeJqD93B8GQ5d3BnSzVVT77eQvqjSwi42eCKfImqf4wOmE0mbx2hdOi2cjB
 n6KF5SCIlliikTdVL8BVeAFsdTund/NSjxvg/IoSWBxu+wNxXgnGTENcgt1DXLojZRs5
 8GgWGlwjEcmWdN8jOK8d49ZxkE2tDQLf13OTnadJhaRTaSSAmIdSVLcu92vRSKBdTQG5
 /jFjCnz3Fho4CoDn1CPv49wWnND6P2Civ+73LFO8YcxL70wvBwgsLfoj57iAQbVUm4Eo
 npeQ==
X-Gm-Message-State: APjAAAX4ta+ZPItrRQJ1hkjF71IZ86PhnDTn5L73LH/vVohNxBO/3idc
 D8Q69nh4DDW+0bWg3OHBfyWuLwnsKW+i9Hw17eEJgtB9
X-Google-Smtp-Source: APXvYqxEjK7IioenWTAjiD4BPsRCIkO5kEJqt4+4tIZxEjirc75yXyzETnBUxTegtZPrDDB44vXUh/F3E+kT9tvB8HA=
X-Received: by 2002:ac2:5205:: with SMTP id a5mr1379732lfl.143.1560245038309; 
 Tue, 11 Jun 2019 02:23:58 -0700 (PDT)
MIME-Version: 1.0
From: Guillaume Abrioux <gabrioux@HIDDEN>
Date: Tue, 11 Jun 2019 11:23:47 +0200
Message-ID: <CANqTTH7Tijt1SiWx7qXOQtWv848nLtdUBrDZvcVtL13cizKECw@HIDDEN>
Subject: Why does parted change ownerships of devices?
To: bug-parted@HIDDEN
Content-Type: multipart/alternative; boundary="0000000000004590de058b08db1f"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-Received-From: 209.85.167.42
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 11 Jun 2019 10:13:41 -0400
Cc: Dimitri Savineau <dsavinea@HIDDEN>, Sebastien Han <shan@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--0000000000004590de058b08db1f
Content-Type: text/plain; charset="UTF-8"

Hello,

We use parted in ceph-ansible playbook [1] to retrieve some devices
information, the parted ansible module runs a parted/print command [2], but
we are facing an issue where ownerships get modified after that.

Doing the test manually without ansible context shows it's parted itself
which apply this change:

Before running parted on /dev/sdc:
[root@osd0 ~]# ls -l /dev/sdc*
brw-rw----. 1 root disk 8, 32 Jun 11 08:53 /dev/sdc
brw-rw----. 1 ceph ceph 8, 33 Jun 11 08:53 /dev/sdc1
brw-rw----. 1 ceph ceph 8, 34 Jun 11 08:53 /dev/sdc2

Running a basic parted/print:
[root@osd0 ~]# parted -s /dev/sdc print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sdc: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name           Flags
 1      1049kB  1075MB  1074MB               ceph block.db
 2      1075MB  2149MB  1074MB               ceph block.db

We can see ownerships have changed from ceph:ceph to root:disk:
[root@osd0 ~]# ls -l /dev/sdc*
brw-rw----. 1 root disk 8, 32 Jun 11 08:57 /dev/sdc
brw-rw----. 1 root disk 8, 33 Jun 11 08:57 /dev/sdc1
brw-rw----. 1 root disk 8, 34 Jun 11 08:57 /dev/sdc2
[root@osd0 ~]#

I'm wondering whether there's a good reason for this or should it be
considered as a bug?


Thanks!


[1]
https://github.com/ceph/ceph-ansible/blob/master/roles/ceph-osd/tasks/main.yml#L39-L44
[2]
https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/system/parted.py#L418


*Guillaume Abrioux*Senior Software Engineer

--0000000000004590de058b08db1f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div style=3D"font-family:tahoma,sans-serif" class=3D"gmai=
l_default">Hello,</div><div style=3D"font-family:tahoma,sans-serif" class=
=3D"gmail_default"><br></div><div style=3D"font-family:tahoma,sans-serif" c=
lass=3D"gmail_default">We use parted in ceph-ansible playbook [1] to retrie=
ve some devices information, the parted ansible module runs a parted/print =
command [2], but we are facing an issue where ownerships get modified after=
 that.</div><div style=3D"font-family:tahoma,sans-serif" class=3D"gmail_def=
ault"><br></div><div style=3D"font-family:tahoma,sans-serif" class=3D"gmail=
_default">Doing the test manually without ansible context shows it&#39;s pa=
rted itself which apply this change:<br></div><div style=3D"font-family:tah=
oma,sans-serif" class=3D"gmail_default"><br></div><div style=3D"font-family=
:tahoma,sans-serif" class=3D"gmail_default">Before running parted on /dev/s=
dc:<br></div><div style=3D"font-family:tahoma,sans-serif" class=3D"gmail_de=
fault">[root@osd0 ~]# ls -l /dev/sdc*<br>brw-rw----. 1 root disk 8, 32 Jun =
11 08:53 /dev/sdc<br>brw-rw----. 1 ceph ceph 8, 33 Jun 11 08:53 /dev/sdc1<b=
r>brw-rw----. 1 ceph ceph 8, 34 Jun 11 08:53 /dev/sdc2</div><div style=3D"f=
ont-family:tahoma,sans-serif" class=3D"gmail_default"><br></div><div style=
=3D"font-family:tahoma,sans-serif" class=3D"gmail_default">Running a basic =
parted/print:<br></div><div style=3D"font-family:tahoma,sans-serif" class=
=3D"gmail_default">[root@osd0 ~]# parted -s /dev/sdc print =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 <br>Model: ATA QEMU HARDDISK (scsi)<br>Disk /de=
v/sdc: 53.7GB<br>Sector size (logical/physical): 512B/512B<br>Partition Tab=
le: gpt<br>Disk Flags: <br><br>Number =C2=A0Start =C2=A0 End =C2=A0 =C2=A0 =
Size =C2=A0 =C2=A0File system =C2=A0Name =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 Flags<br>=C2=A01 =C2=A0 =C2=A0 =C2=A01049kB =C2=A01075MB =C2=A01074MB =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ceph block.db<br>=C2=A02 =C2=
=A0 =C2=A0 =C2=A01075MB =C2=A02149MB =C2=A01074MB =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 ceph block.db<br><br></div><div style=3D"font-fami=
ly:tahoma,sans-serif" class=3D"gmail_default">We can see ownerships have ch=
anged from ceph:ceph to root:disk:<br></div><div style=3D"font-family:tahom=
a,sans-serif" class=3D"gmail_default">[root@osd0 ~]# ls -l /dev/sdc* =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 <br>brw-rw----. 1 root disk 8, 32 Jun 11 08:57 /dev/s=
dc<br>brw-rw----. 1 root disk 8, 33 Jun 11 08:57 /dev/sdc1<br>brw-rw----. 1=
 root disk 8, 34 Jun 11 08:57 /dev/sdc2<br>[root@osd0 ~]#=C2=A0</div><div s=
tyle=3D"font-family:tahoma,sans-serif" class=3D"gmail_default"><br></div><d=
iv style=3D"font-family:tahoma,sans-serif" class=3D"gmail_default">I&#39;m =
wondering whether there&#39;s a good reason for this or should it be consid=
ered as a bug?</div><div><br></div><div><br></div><div><div style=3D"font-f=
amily:tahoma,sans-serif" class=3D"gmail_default">Thanks!</div><br></div><di=
v><br></div><div class=3D"gmail_default" style=3D"font-family:tahoma,sans-s=
erif">[1] <a href=3D"https://github.com/ceph/ceph-ansible/blob/master/roles=
/ceph-osd/tasks/main.yml#L39-L44" target=3D"_blank">https://github.com/ceph=
/ceph-ansible/blob/master/roles/ceph-osd/tasks/main.yml#L39-L44</a></div><d=
iv class=3D"gmail_default" style=3D"font-family:tahoma,sans-serif">[2] <a h=
ref=3D"https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/sy=
stem/parted.py#L418" target=3D"_blank">https://github.com/ansible/ansible/b=
lob/devel/lib/ansible/modules/system/parted.py#L418</a></div><div><div dir=
=3D"ltr" class=3D"m_-3668428300458439501gmail_signature" data-smartmail=3D"=
gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"lt=
r"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div=
 dir=3D"ltr"><div style=3D"background-color:rgb(253,253,253)"><span style=
=3D"color:rgb(102,102,102)"><span style=3D"font-size:x-large"><span style=
=3D"font-size:11pt"><b><br></b></span></span></span></div><div style=3D"bac=
kground-color:rgb(253,253,253)"><span style=3D"color:rgb(102,102,102)"><spa=
n style=3D"font-size:x-large"><span style=3D"font-size:11pt"><b>Guillaume A=
brioux<br></b></span></span><span style=3D"font-size:8pt">Senior Software E=
ngineer<br></span></span></div><span style=3D"color:rgb(102,102,102)"><span=
 style=3D"font-size:8pt"><span><span><span></span></span></span></span></sp=
an></div></div></div></div></div></div></div></div></div></div></div></div>=
</div>

--0000000000004590de058b08db1f--




Acknowledgement sent to Guillaume Abrioux <gabrioux@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-parted@HIDDEN. Full text available.
Report forwarded to bug-parted@HIDDEN:
bug#36169; Package parted. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.