UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 5th, 2012, 01:19 PM
groundlevel groundlevel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 407 groundlevel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 18 h 48 m 38 sec
Reputation Power: 10
Xfsdump to a file

I'm a complete unix n00b, and I'm trying to use xfsdump to write to a file. I've tried going over the man page, and can't make heads or tails out of it to write to a file. I know I also need to use the -t and -v options, as well as -f to write to the file, but beyond that, I'm stumped. Can someone give me an example of how to use this?

Thanks.

Best,
J.

Reply With Quote
  #2  
Old December 6th, 2012, 10:39 AM
LKBrwn_DBA's Avatar
LKBrwn_DBA LKBrwn_DBA is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Sep 2006
Posts: 752 LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 3 h 5 m 12 sec
Reputation Power: 348
Cool

Quote:
Originally Posted by groundlevel
I'm a complete unix n00b, ...Etc..., I'm stumped. Can someone give me an example of how to use this?

If you have no idea how to use it, why do you think you need it?
What are your requirements? Perhaps there are other solutions.
__________________

Reply With Quote
  #3  
Old December 6th, 2012, 10:40 AM
SimonJM SimonJM is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2006
Posts: 2,108 SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 4 h 48 m 25 sec
Reputation Power: 1485
A quick scan of the man page suggests that you'd want something like:
Code:
xfsdump -t /path/to/datetime.file -v 1 -f /path/to/dump.file /path/to/filesystem_to_dump
__________________
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc

Reply With Quote
  #4  
Old December 6th, 2012, 11:47 AM
groundlevel groundlevel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 407 groundlevel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 18 h 48 m 38 sec
Reputation Power: 10
Quote:
Originally Posted by SimonJM
A quick scan of the man page suggests that you'd want something like:
Code:
xfsdump -t /path/to/datetime.file -v 1 -f /path/to/dump.file /path/to/filesystem_to_dump


Ok, I'm still confused, sorry. And apparently posted bad information. I was supposed to use xfsdump to create the dumpfile:

xfsdump -J -f /somefilepath/xfsdump_file /dev/sda6

and then use xfsrestore for the -t and -v options:

xfsrestore -t -v /xfsdump_file

In these commands, I don't understand what /dev/sda6 refers to. This is the xfs volume in this case, correct? And as for the xfsrestore, the version I just posted doesn't seem like a complete command, when compared to yours.

I'm sending in a report where xfsprogs isn't functioning under Ubuntu 12.1 as expected, and their forum has asked for this information. I've been trying to get the correct commands to send to them to complete the report.

Reply With Quote
  #5  
Old December 6th, 2012, 05:58 PM
SimonJM SimonJM is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2006
Posts: 2,108 SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 4 h 48 m 25 sec
Reputation Power: 1485
In the xfsdump, the /dev/sda6 is the 'raw device' that contains the xfs file system you want to back up. The man pages suggest that just a file system name (not the underlying devece is valid so you may need to change that). Do a df -h or mount command and you should see it listed.

The -J on the xfsdump is theer to prevent any update to the dump inventory and is specified here as, in effect, this dump is going to be discarded.

With the xfsrestore command, the -t is a test operand, which means that the dump will be read and contents listed, but not applied back to the system. The man page suggests using -v silent as a parameter (presumably to cutdown on the output which will already be a list of files and directories).

Your restore command does not seem to be trying to read the same dump file as created by the dump - creatiing /somefilepath/xfsdump_file but reading from /xfsdump_file.

My suggestion would be:

Code:
xfsdump -J -f /somefilepath/xfsdump_file /dev/sda6

Code:
xfsrestore -t -v silent -f /somefilepath/xfsdump_file /dev/sda6


As mentioned, you may need to change the /dev/sda6 parts to the actual mounted file system name.

Reply With Quote
  #6  
Old December 6th, 2012, 06:08 PM
groundlevel groundlevel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 407 groundlevel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 18 h 48 m 38 sec
Reputation Power: 10
Thanks so much, Simon

I'll definitely give it a go.

Best,
J.

Reply With Quote
  #7  
Old December 7th, 2012, 08:21 AM
SimonJM SimonJM is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2006
Posts: 2,108 SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 4 h 48 m 25 sec
Reputation Power: 1485
Best of luck!

Reply With Quote
  #8  
Old December 13th, 2012, 11:04 AM
groundlevel groundlevel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 407 groundlevel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 18 h 48 m 38 sec
Reputation Power: 10
I'm sorry, I'm still having a bit of a problem. Here are my commands for the mountpoints:

mkdir /mnt/fp
mkdir /mnt/hr20
mount -t xfs -o rtdev=/dev/sda3 /dev/sda2 /mnt/fp
mount -t xfs -o rtdev=/dev/sdb3 /dev/sdb2 /mnt/hr20

With this as the starting point, which do I plug in here:

xfsdump -J -f /somefilepath/xfsdump_file /dev/sda6
xfsrestore -t -v silent -f /somefilepath/xfsdump_file /dev/sda6

?

Thanks again
J.

Last edited by groundlevel : December 13th, 2012 at 11:08 AM.

Reply With Quote
  #9  
Old December 14th, 2012, 05:42 AM
SimonJM SimonJM is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2006
Posts: 2,108 SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 4 h 48 m 25 sec
Reputation Power: 1485
xfsdump will only dump a single file system at a time, so if you wish to dump both you'll need two commands.

Replace the /dev/sda6 in the commands with either /mnt/fp or /mnt/hr20

Reply With Quote
  #10  
Old December 14th, 2012, 07:53 AM
groundlevel groundlevel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 407 groundlevel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 18 h 48 m 38 sec
Reputation Power: 10
Quote:
Originally Posted by SimonJM
xfsdump will only dump a single file system at a time, so if you wish to dump both you'll need two commands.

Replace the /dev/sda6 in the commands with either /mnt/fp or /mnt/hr20


Ah, ok. Thanks again, Simon

Reply With Quote
  #11  
Old December 14th, 2012, 09:10 AM
SimonJM SimonJM is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2006
Posts: 2,108 SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 4 h 48 m 25 sec
Reputation Power: 1485
And don't forget to chnage the name of the file to which you are dumping them, otherwise you will overwrite the first dump taken! I'd suggest a name that referenced the source filesystem

Code:
xfsdump -J -f /somefilepath/xfsdump_fp /mnt/fp
xfsdump -J -f /somefilepath/xfsdump_hr20 /mnt/hr20

Reply With Quote
  #12  
Old December 14th, 2012, 09:27 AM
groundlevel groundlevel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 407 groundlevel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 18 h 48 m 38 sec
Reputation Power: 10
Quote:
Originally Posted by SimonJM
And don't forget to chnage the name of the file to which you are dumping them, otherwise you will overwrite the first dump taken! I'd suggest a name that referenced the source filesystem

Code:
xfsdump -J -f /somefilepath/xfsdump_fp /mnt/fp
xfsdump -J -f /somefilepath/xfsdump_hr20 /mnt/hr20


And the xfsrestore's would be like:

xfsrestore -t -v silent -f /Desktop/xfsdump_fp /mnt/fp
xfsrestore -t -v silent -f /Desktop/xfsdump_hr20 /mnt/hr20

?

Reply With Quote
  #13  
Old December 15th, 2012, 05:03 AM
SimonJM SimonJM is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2006
Posts: 2,108 SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 4 h 48 m 25 sec
Reputation Power: 1485
Yep!

Reply With Quote
  #14  
Old December 15th, 2012, 09:29 AM
groundlevel groundlevel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 407 groundlevel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 18 h 48 m 38 sec
Reputation Power: 10
I'm sorry to keep bugging you, Simon

So now the group wants me to restore from the file to the volume. Would this be the command?

xfsrestore -J -f /Desktop/xfsrestore_hr20 /mnt/fp

?

When I try this, I get all kinds of errors.

These are the original commands:

mount -t xfs -o rtdev=/dev/sda3 /dev/sda2 /mnt/fp
mount -t xfs -o rtdev=/dev/sdb3 /dev/sdb2 /mnt/hr20
xfsdump -J - /mnt/hr20 | xfsrestore -J - /mnt/fp

Reply With Quote
  #15  
Old December 15th, 2012, 06:32 PM
SimonJM SimonJM is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2006
Posts: 2,108 SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 4 h 48 m 25 sec
Reputation Power: 1485
That looks like you are attempting to dump one file system (/tmp/hr20) and then recover it to another file system (/mnt/fp) is that the intent?
What error messages are you getting?

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Xfsdump to a file

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap