bug-parted
[Top][All Lists]
Advanced

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

Re: parted complain with negative number as argument for mkpart sub-comm


From: Brian C. Lane
Subject: Re: parted complain with negative number as argument for mkpart sub-command
Date: Mon, 11 Jul 2011 08:58:11 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Jul 10, 2011 at 03:31:13PM +0800, Chunyang Liu wrote:
> hi guys,
> 
> i want to create a partition on my disk using parted. the new
> partition will fill all remain space on the disk. as man page said,
> i can use negative number as argument to count from end of the disk.
> 
> but i found parted doesn't work. following is the command i tried:
> 
> # parted -s /dev/sdb mkpart extended 2048M '-1s'
> parted: invalid option -- 1
> 
> # parted -s /dev/sdb mkpart extended 2048M '\-1s'
> Error: "  1s" has invalid syntax for locations.
> 
> if in interactive mode, the above command works. but i need to
> script it. so is it a bug or it's work-aroundable?

Pass -- after you are done with command line arguments so that it will
ignore anything else that looks like a - or -- arg. Like this:

parted -s -- /dev/sdb mkpart extended 2048M -1s

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)

Attachment: pgp0X6XWCoEYj.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]