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)
pgpmxQ39c8ESL.pgp
Description: PGP signature
_______________________________________________ bug-parted mailing list bug-parted@gnu.org https://lists.gnu.org/mailman/listinfo/bug-parted