Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    407
    Rep Power
    11

    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.
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    840
    Rep Power
    387

    Cool


    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.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,437
    Rep Power
    1688
    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
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    407
    Rep Power
    11
    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.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,437
    Rep Power
    1688
    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.
    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
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    407
    Rep Power
    11
    Thanks so much, Simon

    I'll definitely give it a go.

    Best,
    J.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,437
    Rep Power
    1688
    Best of luck!
    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
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    407
    Rep Power
    11
    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.
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,437
    Rep Power
    1688
    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
    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
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    407
    Rep Power
    11
    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
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,437
    Rep Power
    1688
    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
    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
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    407
    Rep Power
    11
    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

    ?
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,437
    Rep Power
    1688
    Yep!
    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
  26. #14
  27. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    407
    Rep Power
    11
    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
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,437
    Rep Power
    1688
    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?
    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
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo