Re: partx: deleting single partitions fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 14, 2017 at 12:43:11PM +0200, Ruediger Meier wrote:
> Looks like since commit 2d47fa39 partx does not understand
> single partition numbers anymore.

No, this syntax is

    partx <operation> <partition> <wholedisk>

where <partition> and <wholedisk> is device name, and the both paths
has to match, it means

    partx -d /dev/sda1 /dev/sdc

is mistake (sda vs sdc).

> $ partx 2 /dev/sdb
> partx: partition and disk name do not match

This syntax has not been supported before commit
c4ecaf21d59671ac7ec0bd26bd2c346c98c7771c (year 2010) where was
introduced weak code in get_partno_from_device(). This weak code cares
about last number, for example "Jun2" will be interpreted as a second
partition :-)

I don't think such syntax has been ever announced anywhere. The -n|--nr
is required to specify partition by number.

And since 2d47fa39 we care if the <partition> exists or matches with
<wholedisk>.

> $ partx -d 2 /dev/sdb
> partx: partition and disk name do not match

 partx -d --nr 2 /dev/sdb

> We are using the last syntax in test "delete-non-existent" but do not 
> check stderr.

I don't think we need to change partx.c. IMHO the broken thing is the
test and it should be fixed by "--nr" (and check stderr :-)

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux