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.

AMD Ryzen 5 5500 Processor ( read Description)
$59.00
Intel Core i5-12400 Processor SRL4V
$115.00
INTEL CORE I9-10940X X-SERIES PROCESSOR | 3.30GHZ | SRGSH
$179.99
(LOT OF 20) Intel Core i5-8400 CPU 2.80GHz Desktop Processor (SR3QT)
$700.00
Intel Core i7-9700 Octa-Core 3 GHz Desktop Processor LGA 1151
$79.99
Intel Core i7-3770K 3.5 GHz Processor
$39.00
Intel Core i5-12500T SRL5W 2GHz 18MB 6 Core Socket LGA1700 Desktop CPU Processor
$114.99
Intel Core i7-9700K Octa-Core 3.6 GHz Desktop CPU
$99.99
Intel Core i7-4770 3.40GHz Quad Core SR149 LGA 1150 CPU Processor tested
$35.00
Intel Core i5-9500 3.0 GHz 8 GT/s LGA 1151 Desktop CPU Processor SRF4B
$48.99