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

Re: Partition image on the fly



On Tue, Apr 18, 2006 at 03:41:26PM +0100, George Borisov wrote:
> Ron Johnson wrote:
> > 
> > dd?  Only if the restore-partition is the *exact* same size, right?
> 
> Same, or larger. If it is larger then you resize the partition after dd
> to the actual maximum size. We do this with NTFS disk images all the
> time, I assume ext2/3 will work just as well.

What utility do you propose using to do that? The ones I know of would
still require that you dd to a partition of the exact same size, and
then resize the partition and filesystem together.

Anyway, I would say the filesystem type is the critical bit of information
that needed to have been included in the original posting. Resizing a
filesystem is not possible for all filesystem types. If the format
is open and published then it is always possible in theory, but will
depend on weather or not someone has gotten around to writing something
to do it.

In general, I would use dd the way you suggest only if I wanted an
exact copy of the original in a new partion of exactly the same size.

I usually do this when migrating to a larger hard disk, with the new
space made available as extra partitions, keeping all original partitions
the same. dd has the advantage of working for all partitions, be they
Linux, Windows, Plan9, Inferno, OS-9000 or whatever, regardless of
weather Linux knows how to mount them or not.

If, on the other hand, I want to resize a particular partition, then 
I create and mount the new partition, make the original read-only and
do a logical (file by file) copy. I have found most reliable way of doing
it tends to be dump/restore. Failing that, rsync will work if you are
very careful with the arguments. There are numerous alternatives you
could try (tar, cpio etc).

The logical copy has the advantage of defragmenting the files on older
file systems. Using 'dd' has the advantage of knowing you are getting
an exact copy. It is easy to slip up and end up duplicating files that
were originally hard links etc otherwise. Resizing an existing filesystem
relies on the author to fully understand the filesystem well enough not
to introduce any subtle flaws. I would definately run fsck after trying
it.

Regards,
DigbyT
-- 
Digby R. S. Tarvin                                          digbyt(at)digbyt.com
http://www.digbyt.com



Reply to: