[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating an extended partition for whole disk size... automaticly

From: Andrew Clausen
Subject: Re: Creating an extended partition for whole disk size... automaticly
Date: Fri, 22 Jun 2001 11:55:14 +1000
User-agent: Mutt/1.2.5i

On Thu, Jun 21, 2001 at 10:11:47AM +0200, Bas Rijniersce wrote:
> > Yeah, it would be nice to provide a nice mechanism for shell scripts.
> > I guess it's a matter of someone writing lots of ugly sed stuff...
> I'm completely unfamilair with the parted code, but it isn't possible to just 
> export some of the internal variables (like the value of the disk size shown 
> with "print") into "Macros" that can be used within a parted script.

I don't know of any reasonable way to do this.  Why not create
a library of shell routines?

> > So, I'd include useful shell routines, if you send me some...
> Sorry, what do you mean by "include useful shell routines".


# $1 is the device, $2 is the partition, $3 is the file system type
        parted --script $1 mkfs $2 $3

# example use
mkfs /dev/hda 1 fat

> > > I'll probably create a script that parses the output of parted < "echo
> > print" 
> > > or something like that. But it would be nice to do that automaticly
> > Well, doing automatically... how exactly?
> By automaticly I meant, using a macro provided by parted, like $SIZE_OF_DISK.

You could do that with sed and grep right now.  And write a nice
function to wrap it up.

BTW: $SIZE_OF_DISK is dodgey, because you don't know "of which disk"

> > I should also mention that there are python bindings available.  They
> I'm using it on the image CD. Only limited space, parted / bash fit, but a 
> python interpreter probably won't fit.

Huh?!  Last time I checked, python took less than 600Mb... :P

Do you mean "the floppy disk" part of the CD?  (that the BIOS uses,

Andrew Clausen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]