[wplug] new HDD
Rick Smith
rick at rbsmith.com
Sat Feb 21 22:34:22 EST 2004
On Sat, Feb 21, 2004 at 09:51:19PM -0500, Jonathan S. Billings wrote:
> On Feb 21, 2004, at 9:46 PM, Brandon Kuczenski wrote:
> > I see.. thanks. I was a bit alarmed, but I looked in /var/log/messages
> > and I saw that it spotted my drive and named it /dev/hdb. So I pressed
> > onward. I then did something dumb, but have recovered: as root, I
> > entered
> > 'cp -rf /home/* /temp1' where temp1 was my temporary mount point for my
> > new drive. It copied everything, but with root as the 0wnz0r. (I also
> > stomped all the date-stamps).
> >
> > It has since been fixed. Except all my date stamps are for today,
> > about
> > 35 minutes ago. And, now I know about cp -rfp.
> >
> > Good thing I'm still the only user on this system... hehehe.
> >
> > -Brandon
>
> I probably would have done this:
>
> cd /home;
> tar cpf - . | (cd /temp1; tar xpvf -)
Careful if you have sparse files, as this will (or used to) expand them.
Tar has a -S option to handle sparse.
For doing the disk to disk on the same machine, I've had
great success with 'cp -a' for replicating sparse, pipes, sockets,
device files, symlink, hardlinks, permissions, owners, and timestamps.
Rick
More information about the wplug
mailing list