Artificial intelligent assistant

Parted partition drive with small partition at the end I would like to partition a drive from a script, so that there is a big partition filling most of the drive, then a small one at the end. So far I have come up with. parted -s -- /dev/sda mklabel msdos parted -s -a optimal -- /dev/sda mkpart primary 1MiB -10GiB parted -s -a optimal -- /dev/sda mkpart primary -10GiB -1s Unfortunately the last command doesn't work. It seems `parted` will accept a negative number for the end of a partition but not for the start. How do I get around this?

I finally figured this one out, it seems that while the documentation says that specifying the filesystem type is optional and normally it is, the parser can't handle a negative number when it's looking for a filesystem type.

If I change the script to specify filesystem types then it works.


parted -s -- /dev/sda mklabel msdos
parted -s -a optimal -- /dev/sda mkpart primary btrfs 1MiB -10GiB
parted -s -a optimal -- /dev/sda mkpart primary linux-swap -10GiB -1s

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 80526f00dc0f9401621398963fc4e363