I am trying to partition my disk into two equal partitions. So far I was doing everything manually using fdisk command and then modifying fstab file with UUID for both the partitions and I have around 70 machines to do this. Is there any automated way I can do this using shell script? I don't want to do everything manually on each of these boxes.
Filesystem Size Used Avail Use% Mounted on
/dev/vda 30G 1.4G 27G 5% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 60G 12K 60G 1% /dev
tmpfs 12G 384K 12G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 60G 0 60G 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/vdb 2.4T 72M 2.2T 1% /mnt
I want to partition /dev/vdb
into two equal partitions /data01 and /data02. What is the best way to do this using everything in one shell script? I have a root access to all these machines and I have Ubuntu 14.04 box.