partprobe returns with error if no disk label is present

Bug #1312277 reported by Matthew Eaton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
parted (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Running partprobe on a disk with no disk label returns with an error in Trusty. This is not the case in Precise or Saucy, nor is it the case with parted 3.1 compiled from source. In my opinion, even if there is no disk label or partition table present, partprobe has done its job and should exit 0.

On a side note, this functionality breaks a script that I wrote, since it will fail on any error, and I would prefer to keep it that way.

Precise:
==========
matt@matt-snia:~$ lsb_release -rd
Description: Ubuntu 12.04.4 LTS
Release: 12.04

matt@matt-snia:~$ apt-cache policy parted
parted:
  Installed: 2.3-8ubuntu5.1

matt@matt-snia:~$ sudo parted /dev/sdf print
Error: /dev/sdf: unrecognised disk label

matt@matt-snia:~$ sudo partprobe /dev/sdf
matt@matt-snia:~$ echo $?
0
==========

Trusty:
==========
matt@matt-test:~$ lsb_release -rd
Description: Ubuntu 14.04 LTS
Release: 14.04

matt@matt-test:~$ apt-cache policy parted
parted:
  Installed: 2.3-19ubuntu1

matt@matt-test:~$ sudo parted /dev/sdb print
Error: /dev/sdb: unrecognised disk label

matt@matt-test:~$ sudo partprobe /dev/sdb
Error: /dev/sdb: unrecognised disk label
matt@matt-test:~$ echo $?
1
==========

Parted 3.1:
==========
matt@matt-test:~/parted-3.1/partprobe$ ./partprobe -v
partprobe (GNU parted) 3.1

matt@matt-test:~/parted-3.1/partprobe$ sudo ./partprobe /dev/sdb
matt@matt-test:~/parted-3.1/partprobe$ echo $?
0
==========

Revision history for this message
Matthew Eaton (meaton) wrote :

I found this bug report that is contradictory to mine:

https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1104797

Is this the expected behavior then? But if so, should Ubuntu be deviating from upstream behavior like this?

Revision history for this message
Phillip Susi (psusi) wrote :

It seems that I inadvertently fixed the other bug while fixing loop labels. If partprobe refuses to act, it should not return success. Upstream has changed the behaviour so that it actually *does* remove any existing partitions and then return success, so when 3.2 is released and makes its way to ubuntu, I suppose that will resolve this.

Revision history for this message
Matthew Eaton (meaton) wrote :

Thanks a lot for confirming this is the correct behavior. I guess I was assuming partprobe was actually doing *something* behind the scenes since it was returning 0. I'm marking this as invalid.

Changed in parted (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.