answered my own question...using parted for those curious
then did some bash scripting like
size=`parted --script $partition print |grep megabytes |cut -d'-' -f 2|cut -d' ' -f 1|cut -d'.' -f 1
echo $((size/0.10)) #to echo 10% of file size
![]()
Is there anyway to dynamically fdisk a harddrive based on percentage?
example:
1% for /boot
10% for /
80% for /usr
9% for /var
i'm pretty decent at scripting and i got the scsi or ide part working and i know you can use fdisk to assign the number of blocks, but is there a way to see what the total blocks are? Or is there a easier program i can use?
Thanks in advance!
answered my own question...using parted for those curious
then did some bash scripting like
size=`parted --script $partition print |grep megabytes |cut -d'-' -f 2|cut -d' ' -f 1|cut -d'.' -f 1
echo $((size/0.10)) #to echo 10% of file size
![]()
Hi lorddecker,
I know that you posted this some time ago, but Iīm searching for this same solution. Iīve seen that youīve accomplished this, and Iīm wondering you you could post your complete scripts you are using... It would save me some time, and hpefully some otherīs too...
Thatīs it!
Thanks a lot,
Mark
i used parted first, but it super buggy. Like you can go "fill of the drive in" you have to pick points. So what i did is used a expect script.
You can do it manually, or just do it automatically with autoexpect.
Figure out what size partitions you need, then generate a expect script that runs against fdisk.

2-Bay/4-Bay Hard Drive Enclosure for 3.5"/2.5'' SATA HDD/SSD 10Gbps USB-C 3.2
$75.99
Glyph StudioRAID 28TB External RAID Hard Drive Thunderbolt 2 USB 3.0 7200RPM
$300.00
Broadcom 9600-24i Tri-Mode RAID Controller 4.0 NVMe SAS SATA NEW 05-50111-01003
$639.69
Intel VROC Premium RAID Controller Card PCIe Add-On Module VROCPREMMOD
$265.00
OWC Mercury Elite Pro 2 Bay RAID Enclosure with USB 3.2 for Dual 3.5 inch HDDs
$87.99
WAVLINK RAID 2 Bay Hard Drive Docking Station SATA 2.5/3.5'' SSD HDD Enclosure
$119.99
Dell PowerEdge HBA330 LP PCI-E 12GBs RAID SAS Controller Adapter J7TNV
$18.95
Acasis USB 3.2 2 Bay HDD RAID Enclosure for 2.5/3.5" SATA Drives External Array
$55.00
Adaptec ASR-71605 16-Port 1Gbps PCIe RAID Card High Profile
$18.49
CalDigit VR minin 2 Portable Raid Storage On The Go
$75.00