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.

Intel Xeon E5-2680 V2 2.8GHz 10-Core 25MB 8GT/s SR1A6 LGA2011 B Grade Server CPU
$7.95
NEW HP Z4 G4 Workstation Xeon W-2123 16GB ECC 256GB NVMe NVIDIA T400 750W Win11
$450.00
Dell Precision Tower 7810 Xeon E5-2630 v3 @ 2.40GHz , 32GB Ram, NO HDD, NO OS
$239.99
Intel Xeon Phi 5110P 60-Core 1.053GHz Coprocessor
$50.00
Dell Precision T5820 Workstation 3.70GHz W-2135 No RAM/ GPU/ HDD/ OS
$179.98
Lenovo ThinkStation P520c Intel Xeon W-2133 6-Core 3.60GHz -NO RAM/ HDD/ GPU/ OS
$127.54
Intel Xeon E5-2699 V4 2.20GHz 55M 22-CORES LGA2011-3 Server Processor 145W SR2JS
$84.49
Dell Precision T7820 2x Xeon Silver 4114 2.20GHz 950W No RAM GPU HDD 4x SATA
$354.48
For Parts - Lenovo ThinkServer TS460 Part Number: 70TT-0020UX
$149.99
Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram 2x 550W PSU No HDD
$275.00