On Thursday 22 November 2007, b.n. wrote:
> Mick ha scritto:
> > It's your call of course, but why don't you just boot from a LiveCD,
> > mount the lot and tar the contents of the suspect disk to the new
> > disk/partitions?  The size of the new disk and partitions can be anything
> > you like, as long as they are not smaller than the amount of data you are
> > trying to tar into them. Then you can run grub from the LiveCD to install
> > the grub boot code in the MBR of the new disk.  Other than the time it'll
> > take you to partition the new disk (and reboot), tar should run faster
> > than dd (it will not be copying over empty space) and it will be
> > essentially defraging your data onto the new partition.  You may find
> > that emerge sync runs faster than it used to.
>
> Yes, that's practically the other option I was thinking today at work
> (ehm, between data analysis sessions, of course!).
>
> Just a thing: why tar and not cp? I'm not that familiar with tar except
> than for the usual tar -xzv(j)f ... Yes, I'm not an old unix dog...

tar is the de facto archiving command, but you are right cp -a will do the 
trick too.  I am more accustomed to do such things with tar which has options 
for compressing the data (useful if you are ssh-ing it to another machine).  
Not sure which one is faster.  On the same machine there's no point in 
compressing it.  cd into the partition you want to copy and run something 
like $ tar lcpvf - . | (cd /other/area/store; tar -xpvf - )

That ought to do it.
-- 
Regards,
Mick

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to