Unable to restore using timeshift Failed to mount device

Kernels, Network, and Services configuration
Post Reply
Message
Author
4joeyirosh1
Posts: 138
Joined: 2016-09-11 18:04
Been thanked: 2 times

Unable to restore using timeshift Failed to mount device

#1 Post by 4joeyirosh1 »

Hi!I backed up my Debian 11 64 bit Linux using timeshift.

I had an OS problem thus I needed to restore from backup.I booted the machine from Debian recovery mode ( init runlevel 1) and ran the command timeshift --restore accepting defaults.Unfortunately the restore failed with errors below.I confirmed that /run/timeshift/restore/ directory was there at the time of restore

Code: Select all

E: Failed to mount device '/dev/sda5' at mount point '/run/timeshift/restore/'
E: mount: /run/timeshift/restore: mount (2) system call failed: No such file or directory
Find attached screenshot of same error

Image

I have a dual boot Windows 10 and Debian Linux machine and my partitions and filesystems are as below from gparted screenshot.I hope any timeshift linux restore wont affect my Windows partitions.

Image

Kindly assist in effecting a restore from my timeshift backup.

User avatar
bester69
Posts: 1966
Joined: 2015-04-02 13:15
Has thanked: 13 times
Been thanked: 5 times

Re: Unable to restore using timeshift Failed to mount device

#2 Post by bester69 »

4joeyirosh1 wrote:Hi!I backed up my Debian 11 64 bit Linux using timeshift.

I had an OS problem thus I needed to restore from backup.I booted the machine from Debian recovery mode ( init runlevel 1) and ran the command timeshift --restore accepting defaults.Unfortunately the restore failed with errors below.I confirmed that /run/timeshift/restore/ directory was there at the time of restore

Code: Select all

E: Failed to mount device '/dev/sda5' at mount point '/run/timeshift/restore/'
E: mount: /run/timeshift/restore: mount (2) system call failed: No such file or directory
Find attached screenshot of same error

Image

I have a dual boot Windows 10 and Debian Linux machine and my partitions and filesystems are as below from gparted screenshot.I hope any timeshift linux restore wont affect my Windows partitions.

Image

Kindly assist in effecting a restore from my timeshift backup.
My advice for future.. use btrfs filesystem so you avoid these problems and you also rollback instantly real snapshots ..timeshift can manage btrfs as well, but I prefer to use snapper-gui for manage snapshots, see.:
btrs is very easy to use an manage, you work with subvolumes that are some kind of logical folder partition that you backup with scheduled snapshots

Image

Image

then, you can create your own framework scritps to rollback subvolume home or subvolume root easily.:


btrsys.sh
rollback system to last snapshoot, or to an ID given snapshot

Code: Select all

#!/bin/sh
#
if [ $SUDO_USER ]; then
    real_user=$SUDO_USER
else
    real_user=$USER
fi

btrsnap=$(cat /media/cache/.snasyspflag)
snapid=$1

if [ -z "$1" ]
then
if [ -z "$btrsnap" ]
then
exit
else
snapid=$(sudo btrfs subvolume list /home | grep rootsys/.snapshots/$btrsnap | awk '{ print $2 }')
fi
else
btrsnap="xxx"
fi

if [ -z "$snapid" ]
then
snapid=$(sudo btrfs subvolume list /home | grep rootsys/.snapshots/ | tail -n 1 | awk '{ print $2 }')
btrsnap="xxx"
    if [ -z "$snapid" ]
    then
    exit
    fi
fi


clear
#echo "Haciendo Id=$snapid, snapshot nº: $btrsnap"

A=0
read -p "Sysyem con Id=$snapid, snapshot nº: $btrsnap (y/n)?" choice
case "$choice" in 
  y|Y ) 
  echo "yes"
  A=1
  ;;
  n|N ) echo "no" ;;
  * ) echo "invalid";;
esac


if [ $A -eq "1" ]
then
echo "Ha dado si"
else
exit
fi

cd /home/$real_user/
rm tt
mkdir tt
sudo mount -t btrfs -o subvolid=0 /dev/sda2 /home/$real_user/tt
cd /home/$real_user/tt
sudo mkdir mnt
sudo mount -t btrfs -o subvolid=$snapid /dev/sda2 ./mnt
sudo btrfs subvolume snapshot ./mnt newrootsys
sudo umount ./mnt

sudo mv rootsys/.snapshots newrootsys/
sudo mkdir ./del
sudo mv rootsys ./del/rootsys-`date +%Y-%m-%d_%H:%M:%S`.log
sudo mv newrootsys rootsys
sudo btrfs subvolume list . | grep rootsys
cd /home/$real_user/
sudo umount /home/$real_user/tt
rm tt/.directory
rmdir  tt
btrsysupd.sh
Update system snapshot state to current point

Code: Select all

#!/bin/bash
#
if [ $SUDO_USER ]; then
    real_user=$SUDO_USER
else
    real_user=$USER
fi
#function suser { sudo -u "$alias_suser" | suser; }
suser () { sudo -u "$real_user" "$@" ; }


pathsnap=/media/cache/.snasyspflag
suser touch /media/cache/.snasyspflag

if [ -z "$1" ]
then
desc="system"
else
desc="system_$1"
fi

read -p "Actualiza sistema snapshot (y/n)?" choice
case "$choice" in 
  y|Y ) 
  echo "yes"
#snapper -c system delete  $(cat "$pathsnap")
A=$(suser snapper -c system create -p -d "$desc")
echo "System Actualiza con Numero: $A"
suser echo "$A" > "$pathsnap"
  ;;
  n|N ) echo "no";;
  * ) echo "invalid";;
esac


bester69 wrote:You wont change my mind when I know Im right, Im not an ...

Post Reply