Files
nas-tools/fix_photo_volume.sh
T

69 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
# Fix Photo Volume Taking 175GB
# This is likely a mounted volume or disk image
set -e
echo "=== Fix Photo Volume (175GB) ==="
echo ""
echo "Found: /System/Volumes/Data/Volumes/photo is 175GB!"
echo "This is likely what's consuming your space."
echo ""
# Check what it is
echo "🔍 Checking what 'photo' is:"
if [ -d "/System/Volumes/Data/Volumes/photo" ]; then
echo " It's a directory"
SIZE=$(sudo du -sh /System/Volumes/Data/Volumes/photo 2>/dev/null | awk '{print $1}')
echo " Size: $SIZE"
# Check if it's mounted
MOUNTED=$(mount | grep photo || echo "NOT_MOUNTED")
if [ "$MOUNTED" != "NOT_MOUNTED" ]; then
echo " ⚠️ It's a MOUNTED volume:"
echo "$MOUNTED" | sed 's/^/ /'
echo ""
echo " This is likely a disk image or network mount."
echo " You can unmount it to free the space."
else
echo " It's a regular directory (not mounted)"
echo " Contents:"
ls -lah /System/Volumes/Data/Volumes/photo 2>/dev/null | head -10 | sed 's/^/ /'
fi
else
echo " Not found or not accessible"
fi
echo ""
# Check if it's safe to remove
echo "❓ Questions:"
echo " 1. Do you have a 'photo' volume mounted?"
echo " 2. Is this from an external drive or disk image?"
echo " 3. Do you need this data?"
echo ""
echo "🔧 Solutions:"
echo ""
echo "If it's a mounted volume you don't need:"
echo " sudo umount /System/Volumes/Data/Volumes/photo"
echo ""
echo "If it's a directory with files you don't need:"
echo " sudo rm -rf /System/Volumes/Data/Volumes/photo/*"
echo ""
echo "⚠️ WARNING: Make sure you don't need this data before deleting!"
echo ""
read -p "Do you want to see what's inside? (y/n) " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo ""
echo "📁 Contents of /System/Volumes/Data/Volumes/photo:"
sudo ls -lah /System/Volumes/Data/Volumes/photo 2>/dev/null | head -20 | sed 's/^/ /'
echo ""
echo "📊 Top subdirectories:"
sudo du -h -d 1 /System/Volumes/Data/Volumes/photo 2>/dev/null | sort -hr | head -10 | awk '{printf " %8s %s\n", $1, $2}'
fi
echo ""