auto-maximize a logical partition with ext3

auto-maximize a logical partition with ext3

Etzion Bar-Noy ezaton at tournament.org.il
Sun Apr 3 23:17:35 IDT 2011


DD is a lousy OS replication tool, and I would not have used it. Using
simple (!!!) scripting to replicate systems, with any possible combination
of sfdisk, LVM, mkfs.ext3, resize2fs would probably be better, not to
mention - faster.

Example:
Boot; create a new partition layout on your new disk using sfdisk and an
answer file (hint: read the man pages); format partitions (all full size,
yes?); mount partitions; replicate using 'tar' over network, or over NFS
share (better do it from a single tar file, or compressed tar file. It's
faster to decompress than to compress); mount/tar remaining partitions; fix
boot loader; reboot

I have done so countless times in a set of automated tools. Easiest possible
solution. DD seems faster on first look, but sets so many additional
problems (amongst is the one you have described. Others deal with different
hardware layout), and you copy lots of dead nothing.

Ez

On Sun, Apr 3, 2011 at 8:19 PM, Ira Abramov
<Lists-Linux-IL at ira.abramov.org>wrote:

> Quoting guy keren, from the post of Sun, 03 Apr:
> >
> > if it is the last partition, how about using expect (or similar) to
> > automate 'fidk' on the device (probably need to set a loop device on the
> > image file first), delete the partition and re-create it? as far as i
> > remember, when you create a partition via fdisk's interactive prompt, by
> > default it suggest to use all the available extra space.
> >
> > if it's a logical partition - you'll need to delete the underlying
> > logical part as well, i assume.
>
> that solution has come to mind, and I have seen one case where it was
> used (to create, not resize). there's no need even for expect, you can
> simply redirect the input because the interaction is well known in
> advance, but it's a very ugly solution I hope not to have to implement
> for a dozen reasons. At the moment I'm taking all the information I can
> with greps and awk, dumping with SFDISK, making the corrections and
> loading back. c'est la vie.
>
> Happily, my next task is a bit more interesting. making vmbuilder work
> with logical partitions...
>
>
> --
> Good omen
> Ira Abramov
> http://ira.abramov.org/email/
>
> _______________________________________________
> Linux-il mailing list
> Linux-il at cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20110403/b1731473/attachment.html>


More information about the Linux-il mailing list