From unknown Wed Jun 18 23:13:48 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#36169 <36169@debbugs.gnu.org> To: bug#36169 <36169@debbugs.gnu.org> Subject: Status: Why does parted change ownerships of devices? Reply-To: bug#36169 <36169@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:13:48 +0000 retitle 36169 Why does parted change ownerships of devices? reassign 36169 parted submitter 36169 Guillaume Abrioux severity 36169 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 11 10:13:43 2019 Received: (at submit) by debbugs.gnu.org; 11 Jun 2019 14:13:43 +0000 Received: from localhost ([127.0.0.1]:59887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hahWw-0003nd-O4 for submit@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 ) id 1had0e-0002Tw-Ov for submit@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 ) id 1had0d-0002BK-IH for bug-parted@gnu.org; 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 ) id 1had0b-0007MG-Gx for bug-parted@gnu.org; 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 ) id 1had0b-0007Jd-7r for bug-parted@gnu.org; Tue, 11 Jun 2019 05:24:01 -0400 Received: by mail-lf1-f42.google.com with SMTP id 136so8733726lfa.8 for ; 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 Date: Tue, 11 Jun 2019 11:23:47 +0200 Message-ID: Subject: Why does parted change ownerships of devices? To: bug-parted@gnu.org 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 , Sebastien Han X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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
Hello,

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.

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

Before running parted on /dev/s= dc:
[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/sdc1brw-rw----. 1 ceph ceph 8, 34 Jun 11 08:53 /dev/sdc2

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

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
=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
=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

We can see ownerships have ch= anged from ceph:ceph to root:disk:
[root@osd0 ~]# ls -l /dev/sdc* =C2=A0= =C2=A0 =C2=A0 =C2=A0
brw-rw----. 1 root disk 8, 32 Jun 11 08:57 /dev/s= dc
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 ~]#=C2=A0

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


Thanks!


[2] https://github.com/ansible/ansible/b= lob/devel/lib/ansible/modules/system/parted.py#L418

Guillaume A= brioux
Senior Software E= ngineer
= --0000000000004590de058b08db1f-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 12 14:32:45 2019 Received: (at 36169) by debbugs.gnu.org; 12 Jun 2019 18:32:46 +0000 Received: from localhost ([127.0.0.1]:34059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hb83B-0003be-Ki for submit@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 ) id 1hb838-0003bO-PX for 36169@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@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@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" To: 36169@debbugs.gnu.org Subject: Re: bug#36169: Why does parted change ownerships of devices? Message-ID: <20190612182746.GB25631@lister.brianlane.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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