1

I really like timeshift for backup and restore because it's simple, works well, and I can store the backup locally. I have not been able to get it to work on a pi though. When installed from apt this I get this error when I try to make a backup:

sudo timeshift  --create --comments "init" --debug
D: Main()
D:
D: Running Timeshift v19.01
D:
D: Session log file: /var/log/timeshift/2021-10-25_06-03-26_ondemand.log
D: Distribution: raspbian "10"
D: DIST_ID: raspbian
D: Main: check_dependencies()
D: Main: add_default_exclude_entries()
D: Main: add_default_exclude_entries(): exit
D: update_partitions()
D: df -T -B1
D: Device: get_disk_space_using_df(): 1
D: Device: get_mounted_filesystems_using_mtab(): 1
D: Device: get_filesystems(): 5
D: partition list updated
D: detect_system_devices()
D: /boot is mapped to device: /dev/mmcblk0p1, UUID=5DE4-665C
D: / is mapped to device: /dev/mmcblk0p2, UUID=7295bbc3-bbc2-4267-9fa0-099e10ef5bf0
D: Searching subvolume for system at path: /
D: Users: root pi
D: Encrypted home users:
D: Encrypted home dirs:

D: Encrypted private dirs:

D: Main: load_app_config()
App config loaded: /etc/timeshift.json
D: IconManager: init()
D: bin_path: /usr/bin/timeshift
D: found images directory: /usr/share/timeshift/images
D: Main(): ok
D: AppConsole: parse_arguments()
D: Main: initialize_repo()
D: backup_uuid=
D: backup_parent_uuid=
D: Setting snapshot device from config file
D: Main: initialize_repo(): exit
D: AppConsole: start_application()

Select backup device:

Num     Device             Size  Type  Label
------------------------------------------------------------------------------
0    >  /dev/mmcblk0p2  31.7 GB  ext4  rootfs

Enter device name or number (a=Abort): ^[[A
E: Invalid input
Enter device name or number (a=Abort): 0

D: SnapshotRepo: from_device(): RSYNC
D: SnapshotRepo: init_from_device()
D:
D: SnapshotRepo: unlock_and_mount_devices()
D: device=/dev/mmcblk0p2
D: SnapshotRepo: unlock_and_mount_device()
D: device=/dev/mmcblk0p2
D: Device: get_mounted_filesystems_using_mtab(): 1
D: udisksctl mount -b '/dev/mmcblk0p2'
Error mounting /dev/mmcblk0p2: GDBus.Error:org.freedesktop.UDisks2.Error.AlreadyMounted: Device /dev/mmcblk0p2 is already mounted at `/'.

D: Device: get_mounted_filesystems_using_mtab(): 1
D: Selected snapshot device: /dev/mmcblk0p2
D: Free space: 0 B
D: SnapshotRepo: check_status()
D: SnapshotRepo: available()
D: is_available: ok
D: SnapshotRepo: has_snapshots()
D: SnapshotRepo: has_space()
D: df -T -B1 '/dev/mmcblk0p2'
D: Device: get_disk_space_using_df(): 0
D: no snapshots
D: SnapshotRepo: check_status(): exit
D: SnapshotRepo: init_from_device(): exit
D: SnapshotRepo: available()
D: is_available: ok
D: Main: create_snapshot()
D: SnapshotRepo: has_space()
D: df -T -B1 '/dev/mmcblk0p2'
D: Device: get_disk_space_using_df(): 0
D: no snapshots
E: Not enough disk space (< 1.4 GB)
E: Select another device or free up some space

D: SnapshotRepo: auto_remove()
D: SnapshotRepo: remove_untagged()
D: SnapshotRepo: load_snapshots()
D: loading snapshots from 'timeshift/snapshots': 0 found
D: SnapshotRepo: load_snapshots()
D: loading snapshots from 'timeshift/snapshots': 0 found
D: SnapshotRepo: load_snapshots()
D: loading snapshots from 'timeshift/snapshots': 0 found
D: SnapshotRepo: has_space()
D: df -T -B1 '/dev/mmcblk0p2'
D: Device: get_disk_space_using_df(): 0
D: no snapshots
E: Not enough disk space (< 1.4 GB)
E: Select another device or free up some space

D: exit_app()
D: crontab -l
D: Failed to read cron tab
D: crontab -l
D: Failed to read cron tab
D: unmount_target_device()
D: clean_logs()
D: rm -rf '/tmp/2ol7sJPh'

if it helps, the output of df -T -B1 '/dev/mmcblk0p2' is

Filesystem     Type     1B-blocks  Used Available Use% Mounted on
devtmpfs       devtmpfs 450473984     0 450473984   0% /dev

I'd like to figure out how to get timeshift to work, but suggestions for a similar alternative are also welcome.

2
  • Try df -T -B1 /. Checking free space on /dev is not helfpul, it's not a real filesystem anyway. Oct 25, 2021 at 13:43
  • @Dmitry Grigoryev here is df -T -B1 / but I'm showing df -T -B1 '/dev/mmcblk0p2' because it looks like that is what timeshift is using according to the debug output. Filesystem Type 1B-blocks Used Available Use% Mounted on /dev/root ext4 31150960640 1344983040 28506279936 5% / Oct 26, 2021 at 4:03

4 Answers 4

1

You're not the first one to report issues with timeshift on RPi. I don't use it, so I can't help you troubleshoot. However, since you indicated you might be open to another solution, I'll recommend image-backup. See this answer for more information.

3
  • Unfortunately it looks like image-backup does not have a way to restore without just burning a new card. Most of my pies are remote. Thanks though. It does look like it is better than what I'm currently doing. Oct 25, 2021 at 9:39
  • @bobmcgrath: It would have been best if you had mentioned this issue/requirement specifically in your question. However, there are several ways to do this. I'd recommend that you submit this as a new question, but before you do that, please read this answer to determine if it solves your problem. If that answer doesn't resolve your issue, you should explain why it doesn't in your new question. No need to be verbose on this rationale - just enough so the readers will know you've "done your homework".
    – Seamus
    Oct 27, 2021 at 23:16
  • @bobmcgrath: You might also take a look at this answer - there's nothing in your question that suggests it won't work, but there may be more to this than what we can see in your question. Otherwise, you may find some useful ideas here
    – Seamus
    Oct 28, 2021 at 5:30
1

Your immediate problem seems to be that you don't have udisksctl properly installed, which is quite surprising. Try running it from the command line and if it won't run, (re)install the udisks2 package.

If you made wild experiments on your system (renaming key system directories like /usr/bin, removing random files from such places, changing $PATH, /etc/ld.so.conf and the like) I suggest you reinstall your system.

Also note that timeshift doesn't make proper backups by default, it creates snapshots of your system which you can restore to roll back unwanted changes. This will help if your system stops working properly after an upgrade. However, if your SD card fails, the snapshots will be gone as well.

4
  • This is a fresh install. Now I have a different error. pi@ngek:~ $ sudo timeshift --create --comments "init" Error mounting /dev/mmcblk0p2: GDBus.Error:org.freedesktop.UDisks2.Error.AlreadyMounted: Device /dev/mmcblk0p2 is already mounted at `/'. E: Not enough disk space (< 1.4 GB) E: Select another device or free up some space E: Not enough disk space (< 1.4 GB) E: Select another device or free up some space Oct 25, 2021 at 9:32
  • @bobmcgrath Do you have > 1.4 GB of free space, or is the error message correct? In which case, do as advised: "Select another device or free up some space". Oct 25, 2021 at 9:48
  • /dev/mmcblk0p2 has plenty of space. My guess is it is trying to use the boot partition. Any idea how to specify which partition to use? Oct 25, 2021 at 10:29
  • I updated the output with --debug Oct 25, 2021 at 11:11
0

I use timeshift on my Linux PCs and it works great, but I use a simpler (IMHO) system backup solution on my Pies: rpi-clone run daily from crontab to maintain a uSD card image on a USB stick.

Restore the USB stick with a simple dd copy of the USB stick directly to the uSD card (or a new one, if the original uSD card failed) and a reboot.

Obtain rpi-clone via git:

    $ git clone https://github.com/billw2/rpi-clone.git
    $ cd rpi-clone
    $ sudo cp rpi-clone rpi-clone-setup /usr/local/sbin

Just my $0.02...

1
  • This answer, as well as the other one covers backup, but not restore aside from burning a new sd card which is no good for me and my remote pies. Burning SD cards is also just clunky in general. Apr 16, 2022 at 9:20
0

The solution I have settled on is using a proper embedded linux distro like yocto or buildroot along with an ota update system like swupdate, mender, or rauc. This is arguably quite a lot more robust than timesync because it can revert itself if an update fails.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.