Hi,

I was expecting the command "parted /dev/sda print 1" to display information just on the first partition of /dev/sda. Instead it exits without printing anything.

This expected behaviour was implied (to me) by the NUMBER option in the --help message below:

# ./parted --help
...
  print [devices|free|list,all|NUMBER]     display the partition table,
available devices, free space, all found partitions, or a particular
        partition
...

This parted was built from a very recent checkout:

# ./parted --version
parted (GNU parted) 3.2.30-388b
...

Build machine is Debian 8.2 x86_64.


Note that "./parted print /dev/sda" works fine, printing all partitions.

# ./parted /dev/sda print 1
#
# ./parted /dev/sda print
Model: ATA ST320LT020-9YG14 (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system  Flags
 1      1049kB  211MB   210MB   primary   ntfs         boot
 2      211MB   86.1GB  85.9GB  primary   ntfs
 3      86.1GB  107GB   21.0GB  primary   ntfs         diag
 4      107GB   320GB   213GB   extended
 5      107GB   129GB   21.5GB  logical   ntfs
 6      129GB   129GB   537MB   logical   ext4
 7      129GB   320GB   191GB   logical                lvm


(Incidentally, my use case is that I need a simple command to test whether there are any partitions already on a device, and just return a yes or no.)


I'd be interested to know if this print problem is:
1. A bug in parted.
2. Something incorrect or unclear in the --help output.
3. My misunderstanding.

Thanks.

Yours,

Gareth

Reply via email to