Something strange happened when I was performing an rsync backup of my Plex Media Server Library. After a few minutes into the backup, terminal crashed and so did Ubuntu desktop (24.04.1).
I had to perform a hard reset, but during bootup I got a Busybox Initramfs Error. I followed this link to repair the issue…
https://ostechnix.com/how-to-fix-busybox-initramfs-error-on-ubuntu/
The error was code 4 with a path like “/dev/mapper/ubuntu–vg-root”
fsck seemed to fix most of the errors but I think there were some errors it could not fix.
The root drive is a Samsung EVO SSD (1TB) and only a few years old so I would be suprised if the drive is failing.
I don’t know whether it was just a coincidence that it happened when running rsycn, or whether it was my script.
Ubuntu now boots up, but I am trying to find out whether it was my script that caused it before I try running it again.
Is there anything in this script that could have caused it ?
NOTE: I commented out the first rsync command (to backup the media) as I just wanted to test the second rsycn command (to backup the library using sudo). I have just realised that I mistakingly commented out the stop and start plex media server command, could this have caused the error ?
#!/bin/bash
# ~/.BackupScripts/./backup-plex1.sh
# backup selection
if [ -z $1 ] ; then
echo "Parameter missing: define -onsite or -offsite"
exit
elif [ "-onsite" = $1 ] ; then
# check external USB HDD is connected
if ! mount | grep -q /media/backPlex1ON; then
echo "Onsite HDD not mounted"
exit
else
echo "+++++++++++++++++++++ Performing onsite backup +++++++++++++++++++++"
fi
elif [ "-offsite" = $1 ] ; then
# check external USB HDD is connected
if ! mount | grep -q /media/backPlex1OFF; then
echo "Offsite HDD not mounted locally"
exit
else
echo "+++++++++++++++++++++ Performing offsite backup +++++++++++++++++++++"
fi
else
echo "$1 invalid: define -onsite or -offsite"
exit
fi
# rsync command excludes
rsync_excludes="--exclude '*.ini' \
--exclude '*.DS_Store' \
--exclude '**/\$RECYCLE.BIN' \
--exclude '**/\lost+found' \
--exclude '*.AppleDouble' \
--exclude '*.localized'"
# rsync command configuration
if [ "-onsite" = $1 ] ; then
cmd_rsync="/usr/local/bin/rsync"
rsync_options="-a --progress -l --delete $rsync_excludes"
elif [ "-offsite" = $1 ] ; then
cmd_rsync="/usr/local/bin/rsync"
rsync_options="-a --progress -l --delete $rsync_excludes"
fi
echo "********************* Performing rsync backup of Plex 1 *********************"
if [ "-onsite" = $1 ] ; then
src_rsync=/media/plex1/ # end with trailing slash
dest_path=/media/backPlex1ON # do not end with trailing slash
mkdir -p /media/backPlex1ON # do not end with trailing slash
elif [ "-offsite" = $1 ] ; then
src_rsync=/media/plex1/ # end with trailing slash
dest_path=/media/backPlex1OFF # do not end with trailing slash
mkdir -p /media/backPlex1OFF # do not end with trailing slash
fi
# eval $cmd_rsync $rsync_options --dry-run $src_rsync $dest_path
# rsync -a -b --progress -l --delete --exclude-from ~/.BackupScripts/exclude_plex.txt /media/plex1 /media/freeflyer/BackupPlex1
echo "********************* Performing rsync backup of Plex 1 Library *********************"
if [ "-onsite" = $1 ] ; then
src_rsync="/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/" # end with trailing slash
dest_path="/media/backPlex1ON/Plex\ Media\ Server" # do not end with trailing slash
echo $arx_rsync
mkdir -p "/media/backPlex1ON/Plex Media Server" # do not end with trailing slash
elif [ "-offsite" = $1 ] ; then
src_rsync="/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/" # end with trailing slash
dest_path="/media/backPlex1OFF/Plex Media Server" # do not end with trailing slash
mkdir -p "/media/backPlex1OFF/Plex Media Server" # do not end with trailing slash
fi
# sudo service plexmediaserver stop
eval $cmd_rsync $rsync_options $src_rsync $dest_path
# sudo service plexmediaserver start
# To wrap comments...
#:<<COMMENT
#COMMENT
Also, I use webmin which says there are 19 package updates. But when I try to updare it fails with the following error…
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
linux-headers-generic : Depends: linux-headers-6.8.0-50-generic but it is not installable
linux-image-generic : Depends: linux-image-6.8.0-50-generic but it is not going to be installed
Depends: linux-modules-extra-6.8.0-50-generic but it is not installable
E: Unable to correct problems, you have held broken packages.