Moving hardlinks

Tobias Speckbacher tobias at quova.com
Fri Apr 30 22:55:12 UTC 2004


I just thought of one way that might actually work to accomplish what
you are trying to do.

Say you have:

sdb  - old backup drive
sdc  - new backup drive

use dd to move the entire drive to sdc (assuming that sdb is one large
filesystem only used for backups.  Unmount partitions on sdb and sdc
before you do this.  Should you have anything on sdc already this will
nuke it.

dd if=/dev/sdb of=/dev/sdc

this should copy the entire drive sdb to sdc.

Now your partition on sdc will be the same size as on sdb.

You now can use resize2fs or parted to resize the partition to what you
want it to be.

I don't have anything to try this with here, but in theory it could work
:)

-Tobias

-----Original Message-----
From: redhat-list-bounces at redhat.com
[mailto:redhat-list-bounces at redhat.com] On Behalf Of Tobias Speckbacher
Sent: Friday, April 30, 2004 2:35 PM
To: General Red Hat Linux discussion list
Subject: RE: Moving hardlinks

Err change that tar to

(cd /path/to/files, tar cfp - .)|(cd /path/to/where/you/want/files; tar
xvfp
-)
-----Original Message-----
From: redhat-list-bounces at redhat.com
[mailto:redhat-list-bounces at redhat.com] On Behalf Of Tobias Speckbacher
Sent: Friday, April 30, 2004 2:34 PM
To: General Red Hat Linux discussion list
Subject: RE: Moving hardlinks

Without having tested this, a good guestimate.

The hard links should be copied as the entire file, since a hard link is
just a pointer to the inode of the original file.

Since it is a pointer to an inode hard links are filesystem structure
dependent.  The inode dependence is also the reason you can not hard
link across filsystems.

Hope this answers that question.

To copy all the data I would do something like:

tar cfp - /path/to/files | (cd /path/to/where/you/want/files; tar xvfp
-)

-T

-----Original Message-----
From: redhat-list-bounces at redhat.com
[mailto:redhat-list-bounces at redhat.com] On Behalf Of Ashley M. Kirchner
Sent: Friday, April 30, 2004 2:06 PM
To: General Red Hat Linux discussion list
Subject: Moving hardlinks


    I have a backup drive that I'm trying to replace with a larger one 
and I need to transfer what's on it now to the new drive.  The data was 
backed up using RSYNC, and some of the data's hardlinked (through cp 
-al) and I'd like to preserve all of that.  Do I simply run 'cp -aR 
<source> <dest>' and hope for the best?  I mean, will the hardlinks 
transfer over, and will the timestamps will be the same?

    The current structure is:

    daily.05
    daily.04
    daily.03
    daily.02  <-- this is a 'cp -al' version of daily.01
    daily.01  <-- data gets RSYNCed in here

    And every night that structure gets pushed up (.05 deleted, .02 to 
.04 shifted up, .02 gets created by cp -al .01, and then rsync runs on
.01)

    I need this structure, and the linking, to stay as is when I 
transfer the data from one drive to the other.

-- 
W | I haven't lost my mind; it's backed up on tape somewhere.
  +--------------------------------------------------------------------
  Ashley M. Kirchner <mailto:ashley at pcraft.com>   .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith             .     800.441.3873 x130
  Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave. #6
  http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.




-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list





More information about the redhat-list mailing list