Results 1 to 4 of 4

Thread: Scripting Dynamic Partitions?

  1. #1
    Junior Member registered user
    Join Date
    Jun 2004
    Posts
    13

    Scripting Dynamic Partitions?

    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!

  2. #2
    Junior Member registered user
    Join Date
    Jun 2004
    Posts
    13
    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



  3. #3
    Junior Member
    Join Date
    Feb 2005
    Posts
    1

    Scripts for dynamic partitioning

    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

  4. #4
    Junior Member registered user
    Join Date
    Jun 2004
    Posts
    13
    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.

Similar Threads

  1. Can't mount partitions on HD with Dynamic Drive Overlay
    By jim1944 in forum Hardware & Booting
    Replies: 1
    Last Post: 01-25-2007, 04:34 AM
  2. Dynamic Volume recovery
    By Zaid in forum Hardware & Booting
    Replies: 8
    Last Post: 03-08-2006, 12:16 PM
  3. what's the printer configuration using shell scripting?
    By triple_play45 in forum Hardware & Booting
    Replies: 0
    Last Post: 02-24-2006, 03:34 AM
  4. Persistent home isn't dynamic
    By lsr in forum Hdd Install / Debian / Apt
    Replies: 0
    Last Post: 01-21-2005, 01:04 PM
  5. can't get dynamic ip addr automatically
    By halo in forum Hdd Install / Debian / Apt
    Replies: 2
    Last Post: 07-28-2004, 03:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


NETGEAR GS308EP Essential Series 8-Port Gigabit PoE+ Unmanaged Switch picture

NETGEAR GS308EP Essential Series 8-Port Gigabit PoE+ Unmanaged Switch

$39.99



TP-Link TL-SX105 10GB 5-Port Switch - Unopened picture

TP-Link TL-SX105 10GB 5-Port Switch - Unopened

$195.00



D-Link DGS-1210-28P 28-Port PoE Gigabit Web Smart Switch With Cord picture

D-Link DGS-1210-28P 28-Port PoE Gigabit Web Smart Switch With Cord

$49.99



NETGEAR 5-Port Gigabit Ethernet Unmanaged Switch (Gs305) - Desktop Quiet Fanless picture

NETGEAR 5-Port Gigabit Ethernet Unmanaged Switch (Gs305) - Desktop Quiet Fanless

$25.99



TP-Link TL-SG105 5-Port Gigabit Ethernet Unmanaged Metal Desktop Network Switch picture

TP-Link TL-SG105 5-Port Gigabit Ethernet Unmanaged Metal Desktop Network Switch

$19.99



10-Port Gigabit PoE Network Switch with 8 PoE+ Ports with 2 Combo SFP Slots 125W picture

10-Port Gigabit PoE Network Switch with 8 PoE+ Ports with 2 Combo SFP Slots 125W

$39.99



TP-Link TL-SG105, 5 Port Gigabit Unmanaged Ethernet Switch, Network Hub, Ethern picture

TP-Link TL-SG105, 5 Port Gigabit Unmanaged Ethernet Switch, Network Hub, Ethern

$15.25



Arista DCS-7010T-48-R 48P 1GbE 4P 10GbE SFP+ RA Switch with rack mounts picture

Arista DCS-7010T-48-R 48P 1GbE 4P 10GbE SFP+ RA Switch with rack mounts

$69.00



Cisco WS-C3650-12X48UR-L 48-Port Stackable Layer 3 8x10G SFP+ Port Switch picture

Cisco WS-C3650-12X48UR-L 48-Port Stackable Layer 3 8x10G SFP+ Port Switch

$129.99



TP-Link TL-SG1048 48-Port Gigabit Rackmount Switch New Factory Sealed picture

TP-Link TL-SG1048 48-Port Gigabit Rackmount Switch New Factory Sealed

$199.99