LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-31-2008, 06:11 AM   #1
hendrixx
Member
 
Registered: Aug 2003
Location: Netherlands
Distribution: SuSE 10 Pro
Posts: 43

Rep: Reputation: 15
Probem copy whole backup including hardlinks to another system


Hi,

I have a problem with copying a whole backup history from one server to another and preserve all hardlinks. First let me explain the situation.

I have a backup server with 4.5TB of backup data history all done with a script wich uses a combination of rsync and hardlinks to backup serveral servers in our network. It's a rotating backup script wich has been written by our previous systemadmin.
The structure is something like this :

/backup/backup.0/server1
/backup/backup.0/server2
/backup/backup.0/server3
/backup/backup.1/server1
/backup/backup.1/server2
/backup/backup.1/server3
/backup/backup.2/server1
/backup/backup.2/server2
/backup/backup.2/server3
etc.

A Cronjob runs every night wich rsync's all servers data with a rotation schema.
(it would be to much now to explain how the rotation works detail here)

I have setup a brand new backup server with 13TB of free space for backups. However i had to use a different filesystem for this to work.
I have used XFS as filesystem for this new server. The old one uses ext3.

Here comes my problem, i now want to copy all the (4.5TB) backupdata from the old server to the new server and preserve all hardlinks.
I have tried this with rsync with the options -avH (-H = preserve hardlinks) but that didn't work, rsync failed with an error (i forgot to write the error down :-(
I think because it is simply to much data to handle at once.
So i tried to use the rsync per directory.
I started with all data in the /backup/backup.0/ and rsync started without a problem and after almost 24 hours finished.
It transfered 2.5TB of data, however i could not see my hardlinks back when i checked with "ls -li " or with "find /backup/backup.0/ -type f -links +1" for example.
The hardlinks are made over the different /backup/backup.0, /backup/backup.1, etc
So i copied the /backup/backup.1/ also but all hardlinks are gone.

Anyone any idea what else i can do ?
I am at a loss here ... :-(

Thanks.
 
Old 07-31-2008, 08:10 AM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Perhaps you know the trick to transfer files preserving everything using tar, without actually creating the tar file. Basically it goes like this:
Code:
tar -c / | tar -x
It seems that tar is not handling hard links correctly. There is a more extended tar available, S tar, which has a lot more options for dealing with hard links.
http://linux.softpedia.com/get/Syste...tar-1058.shtml
I have been using this program for years for making tape back-ups and it seems to be the least well known backup program. I don't have experience with the programs ability to handle hard links, but it might be worth looking at it. And 4.5 TB is a lot of data.

jlinkels
 
Old 08-01-2008, 02:33 AM   #3
hendrixx
Member
 
Registered: Aug 2003
Location: Netherlands
Distribution: SuSE 10 Pro
Posts: 43

Original Poster
Rep: Reputation: 15
Thx jlinkels, i didn't know this tar trick.
I will install S-tar and give it try. Hopefully it will work.
Fingers crossed ...
 
Old 08-05-2008, 07:26 AM   #4
hendrixx
Member
 
Registered: Aug 2003
Location: Netherlands
Distribution: SuSE 10 Pro
Posts: 43

Original Poster
Rep: Reputation: 15
Hi,

I have tried with S-tar but somehow it doesn't work as expected.
I created a simple testbackup directory with 1 dir inside and 1 file: (/testbackup/tdir.1/testfile)
then i used the command :
Code:
cp -al /testbackup/tdir.1 /testbackup/tdir.0
to make a hardlink copy.

Then i used the following s-tar command from the new server to copy the files from the old server to the new one:
Code:
ssh root@172.16.1.2 star -c -artype=xustar -p -acl /backup/testbackup/tdir.* | star -x -acl -p
This seemed to work just fine on the new backup server.
I checked with "ls -li /backup/testbackup/tdir.0/testfile" and same file in tdir.1 and the inode number (or whatever its called) is the same so linked files are copied fine.

However when i try the exact same command on my whole 4.5TB data spread accross different directories (backup.0, backup.1, backup.2, etc) it doesn't see the hardlinks. I checked during the process and i can not see hardlinks.

This is driving me nuts!
Any other suggestions anyone?
Thx

Last edited by hendrixx; 08-05-2008 at 07:28 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
including more file system ramesh_manu Red Hat 1 02-06-2007 11:46 AM
softlinks vs hardlinks irfanhab Linux - Newbie 4 02-06-2007 02:05 AM
How do I copy my system backup from hda3 to DVD? Balarabay1 Linux - Software 1 11-17-2006 10:24 AM
How to make a image file for my disk( Including win2000&Redhat Linux system)? teradyne Linux - Software 3 06-02-2004 04:25 AM
boot error after using Copy Commander to copy debian system onto larger new drive Interceptor Linux - Hardware 7 05-04-2003 12:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration