-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add zdb -r <dataset> <object-id | file> <output> #11027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
A suggested future improvement discussed at the hangout after the dev summit: This would allow extracting the undamaged parts of a file that has some unreadable records. |
|
It seems quite keen to run all the time: Did not specify |
It seems I needed to explicitly add it to the exclude list for 'dump_all' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will definitely come in handy. Why don't we also add a simple test case to tests/zfs-tests/tests/functional/cli_root/zdb/.
|
@allanjude I've seen a couple cases now where this would be really helpful for debugging. If by chance you have some time to dust it off and tackle the remaining feedback I'd love to get it in. |
91a0915 to
4001892
Compare
|
I've applied the review feedback, and created a very simple test case (it turned out to need a zpool sync, otherwise the file was not entirely written yet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few little things then I'm good with this. Thanks for the quick refresh.
|
I think that should do it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there's one last thing, the new test case needs to be added to tests/runfiles/common.run and tests/zfs-tests/tests/functional/cli_root/zdb/Makefile.am.
zdb will copy the specified object to the output file Signed-off-by: Allan Jude <allan@klarasystems.com>
|
I also added a 2nd test that tests a file with an odd length, as there used to be a problem where it'd pad the extracted file to the record size with garbled data |
While you can use zdb -R poolname vdev:offset:[<lsize>/]<psize>[:flags] to extract individual DVAs from a vdev, it would be handy for be able copy an entire file out of the pool. Given a file or object number, add support to copy the contents to a file. Useful for debugging and recovery. Reviewed-by: Jorgen Lundman <lundman@lundman.net> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Allan Jude <allan@klarasystems.com> Closes openzfs#11027
While you can use zdb -R poolname vdev:offset:[<lsize>/]<psize>[:flags] to extract individual DVAs from a vdev, it would be handy for be able copy an entire file out of the pool. Given a file or object number, add support to copy the contents to a file. Useful for debugging and recovery. Reviewed-by: Jorgen Lundman <lundman@lundman.net> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Allan Jude <allan@klarasystems.com> Closes openzfs#11027
zdb will copy the specified object to the output file
Signed-off-by: Allan Jude allan@klarasystems.com
Motivation and Context
While you can use
zdb -R poolname vdev:offset:[<lsize>/]<psize>[:flags]to extract individual DVAs from a vdev, it would be handy for be able copy an entire fileDescription
Given a file or object number, copy the contents to a file. Useful for debugging and recovery.
How Has This Been Tested?
Demoed live at the OpenZFS Developer Summit 2020
Types of changes
Checklist:
Signed-off-by.