[Ubuntu PA] Disk Imaging Solutions

Brian Stempin brian.stempin at gmail.com
Thu Jan 24 01:48:51 GMT 2008


>
>    5) run script that creates/formats partitions
>    6) power cycle the drive (pull USB plug or toggle on/off switch)
>    7) check if partition table gets read correctly


Is (6) needed?  I recall trying to create an "install USB hd" (think the
Ubuntu install CD...except the media is a USB hd), which required me to
partition and re-partition my USB hd.  I don't recall having to unplug and
replug my drive.

Does anybody know this off of the top of their head, or should I go ahead
and invest the time in testing it?

There's no real need to create an "image".  I thought it would
> be nice to use some existing tools.  I've decided to keep it simple and
> go with a "deep" copy of all the files and create two archives for hda2
> and hda3.  This is the general idea:

*snip*

I was just thinking to myself....wouldn't it be easier to to the following:

1.  Write a bash script to do the partitioning.  You can pass the device
(/dev/hdc, etc) as a parameter, and the bash script will call parted to do
the partitioning.
2.  Mount the DSL ISO
3.  Using the previous bash script (and it's argument), have the script
automate the running dsl-hdinstall.

This has several advantages:
1.  Other than writing the script, no manual labor has to be done (ie,
creating the "deep copy")
2.  Older and new versions of DSL can be used, simply by downloading the ISO
and calling it's "dsl-hdinstall" script.  You could write the script to
either look to a certain mount location (/media/dsl), ask for the location
of the mounted DSL ISO, or ask for the ISO image location so that it could
mount it for the user.
3.  Once the script finishes executing, we could have it call other
sub-scripts to do different types of special configs.  Ie, this batch of HDs
needs a few non-default apps, so InstallDSL.sh will then call Installxx.sh,
passing it all of the needed arguments, thus preventing any further user
interaction and saving time.

Thoughts?

On Jan 23, 2008 2:13 PM, Kevin Valentine <kevin.valentine at gmail.com> wrote:

> OK, cloning the drives via a script is slowly coming together.  Now I'm
> looking for support.  I have some Python skills but I'm sure there are
> some/many/all on this list that surpass me.
>
> Here's the coding challenge: make a script that creates/formats three
> partitions on any selected hard drive.  For our DSL installations, this
> is what we are looking for in a partition table:
> /dev/hda1 = 64MB               linux-swap
> /dev/hda2 = 60MB               ext2                    (DSL image)
> /dev/hda3 = Rest of drive   ext2                    (user space)
> NOTE: hda2 needs its boot flag enabled
>
> To get a better idea of why this is needed, here's the physical process
> for using the script(s) with the hard drives:
>    1) pull a hard drive from the pile
>    2) connect it to an USB-IDE adapter
>    3) plug in USB and power up adapter
>    4) wait for OS to detect partitions on drive
>    5) run script that creates/formats partitions
>    6) power cycle the drive (pull USB plug or toggle on/off switch)
>    7) check if partition table gets read correctly
>    8) run script that copies files to each partition
>    9) run script that writes grub boot loader to MBR
>    10) plug into any laptop and power it up!
>
> The part that I need help with is line items 5 - 7.  For me, the ideal
> solution is to do this with python so I can integrate it easily into
> what I'm building.  But if you think you can do it with some other
> scripting language (ruby, perl, tcl, etc), feel free to do it.  From my
> searching around, I've found that using 'parted' is the most likely
> solution.  After digging deeper I found that others have been in this
> situation before.  There's a python module for parted called
> python-parted.  What's strange is that there are two versions of it:
> http://packages.ubuntu.com/edgy/python/python-parted
>
> http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_10.2/repodata/repoview/python-parted-0-1.7.3-4.1.html
>
> The first one seems like the best candidate.  I've installed it and
> found it has a broken python dependency (had to force it).  Took a look
> at the main python code, parted.py, and I don't know where to begin.
> Any takers?
>
> -kevin
>
> --
> Ubuntu-us-pa mailing list
> Ubuntu-us-pa at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-us-pa
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-us-pa/attachments/20080123/d95b2559/attachment.htm 


More information about the Ubuntu-us-pa mailing list