The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Operating Systems
> UNIX Help
|
Xfsdump to a file
Discuss Xfsdump to a file in the UNIX Help forum on Dev Shed. Xfsdump to a file UNIX Help forum discussing the Unix Operating System and all variants including Irix, Solarix, and AIX. Unix was designed as a true multi-user operating system.
|
|
 |
|
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

December 5th, 2012, 01:19 PM
|
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 407
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.
|

December 6th, 2012, 10:39 AM
|
 |
Contributing User
|
|
|
|
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.

__________________
|

December 6th, 2012, 10:40 AM
|
|
|
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
|

December 6th, 2012, 11:47 AM
|
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 407
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.
|

December 6th, 2012, 05:58 PM
|
|
|
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.
|

December 6th, 2012, 06:08 PM
|
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 407
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.
|

December 7th, 2012, 08:21 AM
|
|
|
|
Best of luck!
|

December 13th, 2012, 11:04 AM
|
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 407
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.
|

December 14th, 2012, 05:42 AM
|
|
|
|
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
|

December 14th, 2012, 07:53 AM
|
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 407
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 
|

December 14th, 2012, 09:10 AM
|
|
|
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
|

December 14th, 2012, 09:27 AM
|
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 407
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
?
|

December 15th, 2012, 05:03 AM
|
|
|
Yep! 
|

December 15th, 2012, 09:29 AM
|
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 407
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
|

December 15th, 2012, 06:32 PM
|
|
|
|
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?
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|