# 1. Create a persistent directory on your Unraid flash drive for the binary
mkdir -p /boot/extra/bin
# 2. Navigate to a temporary folder
cd /tmp
# 3. Download the official static Linux 64-bit binary for Git LFS
curl -L -o git-lfs.tar.gz https://github.com
# 4. Extract the file
tar -xf git-lfs.tar.gz
# 5. Move the actual binary to your persistent flash drive path
cp git-lfs-3.5.1/git-lfs /boot/extra/bin/
# 6. Symlink it into your active live system environment
ln -sf /boot/extra/bin/git-lfs /usr/local/bin/git-lfs
# 7. Clean up the /tmp directory
rm -rf git-lfs.tar.gz git-lfs-3.5.1
Make Git LFS Survive Unraid Reboots
Because Unraid reloads Slackware from scratch on every boot, you must tell it to automatically recreate that symlink whenever the array starts.
echo "ln -sf /boot/extra/bin/git-lfs /usr/local/bin/git-lfs" >> /boot/config/go
Initialize and Push
Now that the binary is safely mounted in /usr/local/bin/, verify it works
# 1. Verify installation
git lfs version
# 2. Initialize LFS hooks for Git
git lfs install
# 3. Jump back into your repository directory
cd /mnt/user/WORK/myUNRAID/boot-rec
# 4. Clean out the corrupt loose object Git keeps throwing fit over
rm -f .git/objects/4e/14d06a859a9722bfcd51846e93df4181323c6e
# 5. Track the heavy bzfirmware files safely
git lfs track "boot/bz*"
git lfs track "boot/previous/bz*"
git add .gitattributes
git commit -m "Track bz binaries via Git LFS"
# 6. Re-index and shrink the main Git packfile
git rm --cached -r .
git add .
git commit -m "Migrate massive files out of normal git history into LFS tracking"
# 7. Fire off the push to Gitea
git push origin main
