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

Re: Using dd to clone smaller drive to larger drive



Brian C wrote:
Warning to archive readers. I believe a typo in one of the commands below will destroy your data. Read on...

Alvin Oga wrote:
[snip]

- 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. I interpreted it to mean type:
    tar cvfp /dev/hda3 /mnt/new-disk/var

(and so I had mounted /dev/hdb3 to /mnt/new-disk/var)

Now my original /var which was on /dev/hda3 appears to be completely gone. Since *this* was my attempt to back up this data, this is very bad. I had BIND running chrooted in /var/lib/named/etc/bind but now there don't appear to be such directories (/var is completely empty). I have THOSE files backed up, but the rest of var is probably not backed up. I'd be pleased if anyone could explain what happened. And more pleased if someone explained a way to recover. I should mention that while /var appears empty when you cd in there, df shows it 100% full. What gives? Thanks.



man tar gives an example:
tar -cvvf foo.tar foo/
    tar contents of folder foo in foo.tar

So:
tar cvfp /dev/hda3 /mnt/new-disk/var

tarred the contents of folder /mnt/new-disk/var into something in /dev/hda3.

But was there no output when you did this? It's too late now but always better to try these tricks on a partition that does not matter.

















Reply to: