Skip to content
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

Patched btrfsck to allow rebuilding a superblock from an old tree / generation. #11

Open
wants to merge 40 commits into
base: master
Choose a base branch
from

Commits on Nov 1, 2011

  1. Btrfs-progs: add an option for specifying the root to restore

    If the normal fs tree is hosed and the user has multiple subvolumes it's handy
    to be able to specify just one of the subvolumes to restore.  It's also handy if
    a user only wants to restore say /home instead of his entire disk.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Nov 1, 2011
    Configuration menu
    Copy the full SHA
    0e6aead View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2011

  1. Btrfs-progs: try other mirrors if decomression fails

    This will make the restore program fall back on other mirrors if it fails to
    decompress an extent for whatever reason.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Nov 4, 2011
    Configuration menu
    Copy the full SHA
    9dee07a View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2011

  1. Btrfs-progs: try other mirrors on read failure

    If we hit a bad disk and the read doesn't work, try other mirrors in case we
    have other disks with good copies.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Nov 7, 2011
    Configuration menu
    Copy the full SHA
    ff0e1b1 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2011

  1. Configuration menu
    Copy the full SHA
    1607360 View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2011

  1. Merge pull request #3 from djmarcin/master

    Fixes for my Raid10 restore issues.
    josefbacik committed Nov 10, 2011
    Configuration menu
    Copy the full SHA
    baf3909 View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2011

  1. btrfs-progs: Check metadata mirrors in find-root.

    Signed-off-by: David Marcin <djmarcin@google.com>
    djmarcin committed Nov 16, 2011
    Configuration menu
    Copy the full SHA
    a1ebf7b View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2011

  1. Merge pull request #4 from djmarcin/for-josef

    btrfs-progs: Check metadata mirrors in find-root.
    josefbacik committed Nov 28, 2011
    Configuration menu
    Copy the full SHA
    741a5ca View commit details
    Browse the repository at this point in the history
  2. restore: Split output directory and btrfs-local path search_dir() par…

    …ameters
    
    search_dir() recurses down the btrfs tree, and used to take the output
    path for every item (i.e. in the running system, output root directory
    concatenated with btrfs-local pathname) passed as the only path
    parameter. Moving the output root directory to a separate parameter
    and passing the btrfs-local pathname for each file and directory
    separately allows easy filtering based on the btrfs-local pathname.
    
    Signed-off-by: Peter Stuge <peter@stuge.se>
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Peter Stuge authored and Josef Bacik committed Nov 28, 2011
    Configuration menu
    Copy the full SHA
    266f413 View commit details
    Browse the repository at this point in the history
  3. restore: Add regex matching of paths and files to be restored

    The option -m is used to specify the regex string. -c is used to
    specify case insensitive matching. -i was already taken.
    
    In order to restore only a single folder somewhere in the btrfs
    tree, it is unfortunately neccessary to construct a slightly
    nontrivial regex, e.g.:
    
    restore -m '^/(|home(|/username(|/Desktop(|/.*))))$' /dev/sdb2 /output
    
    This is needed in order to match each directory along the way to the
    Desktop directory, as well as all contents below the Desktop directory.
    
    Signed-off-by: Peter Stuge <peter@stuge.se>
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Peter Stuge authored and Josef Bacik committed Nov 28, 2011
    Configuration menu
    Copy the full SHA
    2f0c2a2 View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2011

  1. btrfs-progs: In find-root, dump bytenr for every slot.

    Signed-off-by: David Marcin <djmarcin@google.com>
    djmarcin committed Nov 29, 2011
    Configuration menu
    Copy the full SHA
    e8919ef View commit details
    Browse the repository at this point in the history
  2. btrfs-progs: Add utility to dump all superblocks found on a device.

    Signed-off-by: David Marcin <djmarcin@google.com>
    djmarcin committed Nov 29, 2011
    Configuration menu
    Copy the full SHA
    db874f1 View commit details
    Browse the repository at this point in the history
  3. btrfs-progs: Add the ability to use the earliest super found when ope…

    …ning the ctree.
    
    Signed-off-by: David Marcin <djmarcin@google.com>
    djmarcin committed Nov 29, 2011
    Configuration menu
    Copy the full SHA
    6330d8d View commit details
    Browse the repository at this point in the history
  4. btrfs-progs: Use oldest super for btrfs-select-super. Add required co…

    …nfirmation to btrfs-select-super.
    
    Signed-off-by: David Marcin <djmarcin@google.com>
    djmarcin committed Nov 29, 2011
    Configuration menu
    Copy the full SHA
    a780325 View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2011

  1. Merge pull request #5 from djmarcin/for-josef

    btrfs-progs: In find-root, dump bytenr for every slot.
    josefbacik committed Nov 30, 2011
    Configuration menu
    Copy the full SHA
    a08aa94 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #6 from djmarcin/rollback-super

    btrfs-progs: Utilities for dumping and rolling back to oldest super on filesystem
    josefbacik committed Nov 30, 2011
    Configuration menu
    Copy the full SHA
    09564cd View commit details
    Browse the repository at this point in the history

Commits on Dec 2, 2011

  1. btrfs-progs: add lzo compression support to restore

    This patch simply adds support to decompress lzo compressed extents in restore.
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Dec 2, 2011
    Configuration menu
    Copy the full SHA
    2fe4611 View commit details
    Browse the repository at this point in the history
  2. btrfs-progs: fix regexec to only work if we actually have a regexec

    We were unconditionally executing our regular expression, even though we may not
    have one, so check to make sure mreg is not null before calling regexec.
    Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Dec 2, 2011
    Configuration menu
    Copy the full SHA
    1b8b3c3 View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2011

  1. btrfs-progs: Fix compilation errors with btrfs-select-super.c introdu…

    …ced by refactoring.
    
    Signed-off-by: David Marcin <djmarcin@google.com>
    djmarcin committed Dec 6, 2011
    Configuration menu
    Copy the full SHA
    3ceceda View commit details
    Browse the repository at this point in the history
  2. Merge pull request #7 from djmarcin/for-josef

    btrfs-progs: Fix compilation errors with btrfs-select-super.c introduced...
    josefbacik committed Dec 6, 2011
    Configuration menu
    Copy the full SHA
    6d616e5 View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2011

  1. Btrfs-progs: fix restore to fall back to the broken open_ctree

    We don't need most of the roots when doing restore, like the extent tree.  So if
    the recovery open_ctree fails because it's trying to open one of these useless
    roots just fall back to open_ctree_broken.  This will just open the chunk root
    which is the bare minimum of what we need to operate.  Then from there we can
    setup the tree_root and the fs_root, and if either of those are gone we can't
    restore anyway.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Dec 7, 2011
    Configuration menu
    Copy the full SHA
    fb0cfed View commit details
    Browse the repository at this point in the history
  2. Btrfs-progs: don't bug out if we can't find the last root

    Return an error instead of BUG()'ing out.
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Dec 7, 2011
    Configuration menu
    Copy the full SHA
    412d4f1 View commit details
    Browse the repository at this point in the history
  3. Btrfs-progs: make find_and_setup_root return an error

    Don't BUG(), return an error so the recovery program can work its mojo.
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Dec 7, 2011
    Configuration menu
    Copy the full SHA
    df8b44a View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2011

  1. Btrfs-progs: check return value properly

    We were checking for a null root coming back from btrfs_read_fs_root but thats
    not right since it returns a ERR_PTR.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Dec 8, 2011
    1 Configuration menu
    Copy the full SHA
    4686f96 View commit details
    Browse the repository at this point in the history

Commits on Dec 9, 2011

  1. Btrfs-progs: give restore a list roots option

    Since restore has the ability to open really really screwed up file systems, add
    a list roots option to it so we can still get the contents of the tree root on a
    horribly broken fs.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Dec 9, 2011
    Configuration menu
    Copy the full SHA
    9bb7aa7 View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2012

  1. Btrfs-progs: fix typo

    Hermann Gausterer committed Jan 4, 2012
    Configuration menu
    Copy the full SHA
    767972e View commit details
    Browse the repository at this point in the history
  2. Btrfs-progs: make find root spit out the size of the disk

    In order to figure out what exactly is broken on a fs we need to spit out the
    current offset we are on and the size of the fs to know if the super is wrong
    and we just need to ignore it, or if the offset we got is bad and we should just
    keep searching.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Jan 4, 2012
    Configuration menu
    Copy the full SHA
    b36b23b View commit details
    Browse the repository at this point in the history
  3. Btrfs-progs: add some verbose output to find-root

    Trying to track down why we can't find roots, add some verbose output so we know
    what chunks we're scanning and when we move to new chunks.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Jan 4, 2012
    Configuration menu
    Copy the full SHA
    d4d88fe View commit details
    Browse the repository at this point in the history
  4. Btrfs-progs: fix restore to actually use the root location if specified

    We were using the wrong variable for the root location if we specified -f when
    doing restore.  Fix this.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Jan 4, 2012
    Configuration menu
    Copy the full SHA
    f034665 View commit details
    Browse the repository at this point in the history
  5. Btrfs-progs: remove the physical disk size check from find-root

    Our logical offsets may be beyond what we think the size of the disk is, so our
    check is bogus, remove it.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Jan 4, 2012
    Configuration menu
    Copy the full SHA
    a3958e5 View commit details
    Browse the repository at this point in the history
  6. Btrfs-progs: fix error output and dont read from cache

    If we have to build our fs_info by hand don't read from the cache when looking
    for the fs_root just in case we set something up last time.  Also actually print
    the right error, not the root which is ok.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Jan 4, 2012
    Configuration menu
    Copy the full SHA
    5ec6eea View commit details
    Browse the repository at this point in the history
  7. Btrfs-progs: print the objectid of the root we find when doing find-root

    We need to know if we find a valid fs tree when doing find root, so print the
    objectid of the roots we find when we find a tree root.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Jan 4, 2012
    Configuration menu
    Copy the full SHA
    a657103 View commit details
    Browse the repository at this point in the history
  8. Btrfs-progs: make specifying root objectid work if the fs is broken

    We need to be able to handle the case where we want to restore from a specific
    root if the fs is really really really toast, this patch does that.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Jan 4, 2012
    Configuration menu
    Copy the full SHA
    87edb6f View commit details
    Browse the repository at this point in the history
  9. Btrfs-progs: don't free the existing node

    It may be used elsewhere and in the case of a broken fs it won't be there at all
    and it makes an assertion trip.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
    Josef Bacik committed Jan 4, 2012
    Configuration menu
    Copy the full SHA
    77ac611 View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2012

  1. Configuration menu
    Copy the full SHA
    2d18933 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0cd8e40 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2012

  1. Merge pull request #10 from ivant/master

    Small fixes to compilation/linking
    josefbacik committed May 22, 2012
    Configuration menu
    Copy the full SHA
    b2f74cb View commit details
    Browse the repository at this point in the history
  2. Merge pull request #9 from mrq1/master

    fix for a simple typo
    josefbacik committed May 22, 2012
    Configuration menu
    Copy the full SHA
    a2ee68a View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2012

  1. Configuration menu
    Copy the full SHA
    2a43e2b View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2012

  1. Configuration menu
    Copy the full SHA
    1605ee0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    eba137a View commit details
    Browse the repository at this point in the history