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) Vintage DEC DLV11-KB RS-232 to 20mA Current Loop Converters PDP-11 As-Is
$170.00
Vintage DEC Digital M8048 5013995C PDP-11 LSI 11 ROM (B3)
$149.99
Vintage DEC/Mostek memory systems MK 8015 AA-00 6805-08015 1100 REV C(B7)
$279.99
VINTAGE DEC/MDB Systems MLSI-TEV Circuit Board #40040340 1976 (B5)
$69.99
Vintage DEC LSI-11 PDP-11 Paper Tape Software Lot (96 Tapes) Cables Hardware
$649.00
DEC 3010A Vintage Ceramic chip - ALL LEGS INTACT (BO)
$100.00
VINTAGE DEC LA34/ LA100 SERIES KEYBOARD W/NUMERIC PAD 70-17864-01C
$140.00
Vintage Digital VR241-A color CRT monitor, powers on, DEC Rainbow or terminal
$150.00
Vintage Computer Lot Commodore IBM Gateway AT Gaming Towers DEC IBM HUGE CRT LOT
$7250.00
Vintage DEC LR150-11 Power Supply 70-0464-01 Rev S Sun Shoebox Server PSU Used
$160.00