I am making my own script for partitioning disks and I am unable to mount the partitions which were just created using parted CLI tool.
I am doing this on a virtual machine with virtual disks, but this should not matter as far as I know.
I execute:
parted -s ${device} mklabel gpt
parted -s ${device} mkpart primary ${fileSystem} ${start} ${end}
Variables in my testing scenario were
device=/dev/sdb
fileSystem=ext4
start=1
end=5000
Virtual disk is 10gb in size, so my scenario should create a 5gb partition, and it does if I use fdisk -l
to list disks, but when I try to mount the newly created partition I get this:
wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error
Edit: I was not using mkfs the right way, I got it working now.