diff options
author | Bloyburt <alexpen@startmail.com> | 2024-07-09 08:09:39 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2024-07-09 20:12:39 +0700 |
commit | c927e55595837372cc412b403bb41bff426850dd (patch) | |
tree | df1646af92a005af177205920be8b57e2d0c0a55 | |
parent | ac648987e5b69d5ac4aaed80649282b5569253b2 (diff) |
system/xfs_undelete: Added (XFS Recovery Program).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | system/xfs_undelete/README | 32 | ||||
-rw-r--r-- | system/xfs_undelete/slack-desc | 19 | ||||
-rw-r--r-- | system/xfs_undelete/xfs_undelete.SlackBuild | 91 | ||||
-rw-r--r-- | system/xfs_undelete/xfs_undelete.info | 10 |
4 files changed, 152 insertions, 0 deletions
diff --git a/system/xfs_undelete/README b/system/xfs_undelete/README new file mode 100644 index 0000000000000..0207ff8f486a6 --- /dev/null +++ b/system/xfs_undelete/README @@ -0,0 +1,32 @@ +An undelete tool for the XFS filesystem. + +What does it? +xfs_undelete tries to recover all files on an XFS filesystem marked +as deleted. You may also specify a date or age since deletion, and +file types to ignore or to recover exclusively. + +xfs_undelete does some sanity checks on the files to be recovered. +This is done to avoid recovering bogus petabyte sized sparse files. +In addition, it does not recover anything unidentifiable (given you +have the file utility installed) by default. Specify -i "" on the +command line if you want to recover those unidentifiable files. + +The recovered file is stored on another filesystem in a subdirectory, +by default xfs_undeleted relative to the current directory. The +filename cannot be recovered and thus, it is put as the time of +deletion, the inode number, and a guessed file extension. You have +to check the recovered files you are interested in by hand and rename +them properly. + +How does it work? +xfs_undelete traverses the inode B+trees of each allocation group, +and checks the filesystem blocks holding inodes for the magic string +IN\0\0 that indicates a deleted inode. Then, it tries to make sense +of the extents stored in the inode (which XFS does not delete) and +collect the data blocks of the file. + +Is it safe to use? +Given it only ever reads from the filesystem it operates on, yes. +It also remounts the filesystem read-only on startup by default so +you don’t accidentally overwrite source data. However, I don’t offer +any warranty or liability. Use at your own risk. diff --git a/system/xfs_undelete/slack-desc b/system/xfs_undelete/slack-desc new file mode 100644 index 0000000000000..963bebf5e9a39 --- /dev/null +++ b/system/xfs_undelete/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +xfs_undelete: xfs_undelete (undelete tool for xfs filesystem) +xfs_undelete: +xfs_undelete: xfs_undelete tries to recover all files on an XFS filesystem marked +xfs_undelete: as deleted. You may also specify a date or age since deletion, and +xfs_undelete: file types to ignore or to recover exclusively. +xfs_undelete: +xfs_undelete: Homepage: https://github.com/ianka/xfs_undelete +xfs_undelete: +xfs_undelete: +xfs_undelete: +xfs_undelete: diff --git a/system/xfs_undelete/xfs_undelete.SlackBuild b/system/xfs_undelete/xfs_undelete.SlackBuild new file mode 100644 index 0000000000000..0e1b7b293ea0d --- /dev/null +++ b/system/xfs_undelete/xfs_undelete.SlackBuild @@ -0,0 +1,91 @@ +#!/bin/bash + +# Slackware build script for xfs_undelete + +# Copyright 2024 Bloyburt +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=xfs_undelete +VERSION=${VERSION:-14.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# Override ARCH +ARCH=noarch + +# Copy the program into the package +mkdir -p $PKG/usr/bin +cp -a $PRGNAM $PKG/usr/bin/ + +# Copy the man page into the package +mkdir -p $PKG/usr/man/man1 +cp -a $PRGNAM.man $PKG/usr/man/man1/$PRGNAM.1 + +# Compress the man page +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/xfs_undelete/xfs_undelete.info b/system/xfs_undelete/xfs_undelete.info new file mode 100644 index 0000000000000..538c28a4a5ae4 --- /dev/null +++ b/system/xfs_undelete/xfs_undelete.info @@ -0,0 +1,10 @@ +PRGNAM="xfs_undelete" +VERSION="14.0" +HOMEPAGE="https://github.com/ianka/xfs_undelete" +DOWNLOAD="https://github.com/ianka/xfs_undelete/archive/v14.0/xfs_undelete-14.0.tar.gz" +MD5SUM="f8bd28566e0747f14cba36fb6c0d5f6d" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="%README%" +MAINTAINER="Bloyburt" +EMAIL="alexpen@startmail.com" |