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.

Samsung DVI to DVI Cable 6 ft Digital Video Interface Audio Video NEW
$30.89
Samsung Galaxy Tab S10 Lite 10.9" 128GB Silver Wi-Fi SM-X400NZSAXAR
$206.00
Samsung Galaxy View Tablet 18.4 SM-T670/677A Digitizer 100% Original Oem
$152.99
Samsung 24" S3 Essential IPS 100Hz Monitor | Sealed | Fast shipping
$55.00
Kids Case for Samsung Galaxy Tab A9+/A9 plus 11 Inch 2023 Case, with Strap, Shoc
$27.99
2TB Samsung 990 PRO NVMe SSD PCIe Gen 4 M.2 2280 - NEW - SHIPS TODAY
$329.95
Samsung SCXSTP000, SCX-STP000 (Swingline Staple Cartridge - 3 Refills)
$57.99
Samsung PC4-2666V 16GB 2Rx8 RAM DDR4 2666MHz M471A2K43CB1-CTD
$59.99
Samsung Chomrebook XE350XBA-K02US LCD Screen FHD Display 15.6" XE350XBA-K03US
$51.77
Samsung Galaxy Tab Active 3/ 64 gig/WIFI
$85.00