INSTALLING LATEST BTRFS-TOOLS WITH TROUBLESHOOTING TOOLS:

I got these instructions from: http://www.funtoo.org/BTRFS_Fun

INSTALL NORMAL TOOLS

Note might need these dependencies:

# apt-get install uuid-dev libattr1-dev zlib1g-dev libacl1-dev e2fslibs-dev libblkid-dev liblzo2-dev

To install regular tools (none experimental):

# mkdir ~/src
# git clone git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git
# cd btrfs-progs
# make
# make install

INSTALL BONUS TOOLS

To get bonus tools (note im putting the source code of each set in different directories “src”,”src0″ and “src1” directories so files dont interfere with each other – it might not be necessary to do but im still doing it):

# mkdir ~/src0
# cd ~/src0
# git clone git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git 
# cd btrfs-progs
# make 
# make btrfs-select-super 
# make btrfs-zero-log
# mkdir ~/src1
# cd ~/src1
# git clone git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git
# cd btrfs-progs
# git checkout dangerdonteveruse
# make

The bottom tools are experimental, but come with some useful tools. Im sure once btrfs becomes more common these will evolve to more everyday troubleshooting tools

Get The Latest BTRFSCK Repair Tool

First install the normal version (see above)

Now do this:

# mkdir ~/src2
# cd ~/src2
# git clone git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git
# git checkout repair
# git branch
-- OUTPUT SHOULD BE: repair - REFERING TO repair BRANCH
# make

NOTE: make install for me didnt seem to install(copy the file to its sbin directory) the file as it should of – SIDENOTE: in linux an “install” refers to moving the compiled programs from their source directories to their final directories (into one of the environements PATH directories) so that commands can be used without using relative path or absolute path.

NEXT STEP IS OPTIONAL AND EXPERIMENTAL INSTALLATION BY ME (I just tell it to move 1 file, but it might need more to work properly thouroughly, for now this seemed to work and didnt cause errors/segfaults for me – so your okay to do this… i think… if this causes errors you always have a backup of the old btrfsck sitting in sbin called btrfsck-old, so you could delete /sbin/btrfsck and move /sbin/btrfsck-old back into its old name of /sbin/btrfsck – this will revert the “installation” all the way. Then if you still want to use the new btrfsck, instead of the old one, just go to the compilation directory cd ~/src2/btrfs-progs  and use the program with a relative path like this ./btrfsck  or simply use it from any directory with absolute path ~/src2/btrfs-progs/btrfsck )

# mv /sbin/btrfsck /sbin/btrfsck-old
# install btrfsck /sbin/
or
# mv btrfsck /sbin/btrfsck

NOTE: install just moves the file to the folder and sets attributes. “man install” for more info. Basically it can be used to copy files (usually compiled programs or man page documents), into their final PATH so that user can use them without relative or absolute path. Install can also be used to make all of the directories needed for final resting place of programs. If a directory is missing, install can be used to make it and set its appropriate attributes as well.

To see current branch:

# git branch

By default its master

See all branches (projects, subprojects, etc):

# git branch -a

Or go here (for more information presented via cgit web gui):

https://git.kernel.org/cgit/linux/kernel/git/mason/btrfs-progs.git

NOTE: cgit is just a web browser program for git that shows the git project in a nice fashion. in this case the btrfs git project is shown in this cgit web site.

Leave a Reply

Your email address will not be published. Required fields are marked *