Re: Using dd to clone smaller drive to larger drive
hi ya brian
On Tue, 6 Dec 2005, Brian C wrote:
> Warning to archive readers. I believe a typo in one of the commands
> below will destroy your data. Read on...
more serious than typo .. :-)
> Alvin Oga wrote:
> > - if you want to leave bad data behind
> > mount /dev/hdb1 /mnt/new-disk
> HERE IT COMES
> > tar cvfp old-disk-paritions /mnt/new-disk
> DON'T TYPE THE ABOVE.
definitely .. don't type the above "psuedo cmd"
all that will happen, if typed as is, is a big ole error
message and nothing harmful if that above was typed
but it was a typo as you pointed out .. thanx
- typo is missing "|" and corresponding extracting tar
it was meant as:
tar cfp - old-disk-partitions | ( cd /mnt/new-disk ; tar xvfp - )
- i mixed syntax for my tarcp alias in the prev 1st posted cmd
called "tarcp" ( shorthand is good for some things )
"old-disk-partitions" is things like /bin /var /usr /opt
/mnt/new-disk is exactly that, a newly formated and mounted disk
> I interpreted it to mean type:
> tar cvfp /dev/hda3 /mnt/new-disk/var
that can be one interpretation ... BUT, that is what was previously posted
you CANNOT use "tar" to copy a whole "partition" ( /dev/hda3 )
tar should have been bitching at you ????
and at a minimum, your tar cmd will copy "whatever is
the list of files" ( /mnt/new-disk/var ) into your device /dev/hda3
per your tar command
/dev/hda3 might go blank or tar might bitch about no data
to copy or that it's a "cowardly command" ( no data to write )