I tried to use parted for scripted partitionning like so :
parted -a optimal /dev/sda mklabel gpt mkpart primary ext4 1 -1
But it complains about -1 not being a recognized option. Still the same sub-command works in the parted prompt. So my question is how to use the same options in a script ?
In the right-click menu of the Ubuntu partition, select the Resize/Move option. In the window that pops up, drag the partition shown at the top of that little window as far left as it can go. Now, drag the right of the partition as far right as it can go, filling up all the space in that little diagram.
mkfs utility is used to create filesystem (ext2, ext3, ext4, etc) on your Linux system. You should specify the device name to mkfs on which the filesystem to be created. WARNING: Executing these commands will destroy all the data on your filesystem.
Ext4 is the most common Linux file system and is not supported on Windows by default. However, using a third-party solution, you can read and access Ext4 on Windows 10, 8, or even 7.
Finally found a solution :
parted -s -a optimal /dev/sda mklabel gpt -- mkpart primary ext4 1 -1s
--
is very important for it to work here.
Note the use of ‘--’, to prevent the following ‘-1s’ last-sector indicator from being interpreted as an invalid command-line option.
You can also use --script option. In this case you should put your script part in single quotes.
Example:
parted --script /dev/sda 'mkpart primary ext4 1 -1'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With