Files
backup_to_external_m.2/access_tools.sh
root 0367c3f7e6 Initial commit: Complete backup system with portable tools
- GUI and CLI backup/restore functionality
- Auto-detection of internal system drive
- Smart drive classification (internal vs external)
- Reboot integration for clean backups/restores
- Portable tools that survive cloning operations
- Tool preservation system for external M.2 SSD
- Complete disaster recovery workflow
- Safety features and multiple confirmations
- Desktop integration and launcher scripts
- Comprehensive documentation
2025-09-13 22:14:36 +02:00

114 lines
3.2 KiB
Bash
Executable File

#!/bin/bash
# Mount backup tools partition and provide easy access
# Use this when booted from the external M.2 SSD
set -e
# Colors
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
NC='\033[0m'
print_info() {
echo -e "${BLUE}[INFO]${NC} $1"
}
print_success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
echo ""
echo "=========================================="
echo " Backup Tools Access Helper"
echo "=========================================="
echo ""
# Try to find backup tools partition
TOOLS_PARTITION=$(blkid -L "BACKUP_TOOLS" 2>/dev/null || echo "")
if [[ -z "$TOOLS_PARTITION" ]]; then
print_warning "Backup tools partition not found by label."
print_info "Searching for tools partition..."
# Look for small partitions that might be our tools partition
while IFS= read -r line; do
partition=$(echo "$line" | awk '{print $1}')
size=$(echo "$line" | awk '{print $4}')
# Check if it's a small partition (likely tools)
if [[ "$size" == *M ]] && [[ ${size%M} -le 1024 ]]; then
print_info "Found potential tools partition: $partition ($size)"
TOOLS_PARTITION="/dev/$partition"
break
fi
done < <(lsblk -n -o NAME,SIZE | grep -E "sd|nvme.*p")
fi
if [[ -z "$TOOLS_PARTITION" ]]; then
echo "❌ Could not find backup tools partition"
echo ""
echo "Available partitions:"
lsblk
echo ""
echo "To manually mount tools:"
echo "1. Identify the tools partition from the list above"
echo "2. sudo mkdir -p /mnt/backup_tools"
echo "3. sudo mount /dev/[partition] /mnt/backup_tools"
echo "4. cd /mnt/backup_tools/backup_system"
echo "5. ./launch_backup_tools.sh"
exit 1
fi
# Create mount point
MOUNT_POINT="/mnt/backup_tools"
print_info "Creating mount point: $MOUNT_POINT"
sudo mkdir -p "$MOUNT_POINT"
# Mount tools partition
print_info "Mounting tools partition: $TOOLS_PARTITION"
if sudo mount "$TOOLS_PARTITION" "$MOUNT_POINT"; then
print_success "Tools partition mounted successfully"
else
echo "❌ Failed to mount tools partition"
exit 1
fi
# Check if backup system exists
if [[ -d "$MOUNT_POINT/backup_system" ]]; then
print_success "Backup tools found!"
cd "$MOUNT_POINT/backup_system"
echo ""
echo "📁 Backup tools are now available at:"
echo " $MOUNT_POINT/backup_system"
echo ""
echo "🚀 Available commands:"
echo " ./launch_backup_tools.sh - Interactive menu"
echo " ./backup_script.sh --help - Command line help"
echo " python3 backup_manager.py - GUI (if available)"
echo " ./create_desktop_entry.sh - Create desktop shortcut"
echo ""
# Ask what to do
read -p "Launch backup tools now? (y/n): " launch
if [[ "$launch" =~ ^[Yy] ]]; then
./launch_backup_tools.sh
else
echo ""
echo "Tools are ready to use. Change to the tools directory:"
echo "cd $MOUNT_POINT/backup_system"
fi
else
print_warning "Backup system not found in tools partition"
echo ""
echo "Contents of tools partition:"
ls -la "$MOUNT_POINT"
fi