teejee2008 / timeshift

System restore tool for Linux. Creates filesystem snapshots using rsync+hardlinks, or BTRFS snapshots. Supports scheduled snapshots, multiple backup levels, and exclude filters. Snapshots can be restored while system is running or from Live CD/USB.
GNU Lesser General Public License v3.0
4.7k stars 282 forks source link

Failure to create timeshot every time Unknown reason #834

Open PeterKW opened 3 years ago

PeterKW commented 3 years ago

I can't quite figure out how to get this to work? It was working perfectly until a couple of days ago when it stopped completing any automatic or manual snapshots. Anything I can try to debug this further?

sudo timeshift --create                                                                                                 ✔  4s  
Using system disk as snapshot device for creating snapshots in BTRFS mode

/dev/nvme0n1p2 is mounted at: /run/timeshift/backup, options: rw,relatime,ssd,space_cache,subvolid=5,subvol=/

Creating new backup...(BTRFS)
Saving to device: /dev/nvme0n1p2, mounted at path: /run/timeshift/backup
Created directory: /run/timeshift/backup/timeshift-btrfs/snapshots/2021-11-14_02-33-54
E: ERROR: cannot snapshot '/run/timeshift/backup/@': Text file busy

E: btrfs returned an error: 256
E: Failed to create subvolume snapshot: @
Failed to create snapshot
------------------------------------------------------------------------------
Removing snapshots (un-tagged):
------------------------------------------------------------------------------
Removing snapshot: 2021-11-05_01-00-01
Deleting subvolume: @ (Id:439)
E: ERROR: Not a Btrfs subvolume: Invalid argument

E: Failed to delete snapshot nested subvolume: '/run/timeshift/backup/timeshift-btrfs/snapshots/2021-11-05_01-00-01/@'
E: Failed to remove snapshot: 2021-11-05_01-00-01
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Removing snapshot: 2021-11-05_01-01-59
Deleting subvolume: @ (Id:441)
E: ERROR: Not a Btrfs subvolume: Invalid argument

E: Failed to delete snapshot nested subvolume: '/run/timeshift/backup/timeshift-btrfs/snapshots/2021-11-05_01-01-59/@'
E: Failed to remove snapshot: 2021-11-05_01-01-59
------------------------------------------------------------------------------
Removing snapshots (incomplete):
------------------------------------------------------------------------------
Removing snapshot: 2021-11-14_02-33-54
Deleted directory: /run/timeshift/backup/timeshift-btrfs/snapshots/2021-11-14_02-33-54
Removed snapshot: 2021-11-14_02-33-54
------------------------------------------------------------------------------
sudo timeshift --list-devices                                                                                               

/dev/nvme0n1p2 is mounted at: /run/timeshift/backup, options: rw,relatime,ssd,space_cache,subvolid=5,subvol=/

Devices with Linux file systems:

Num     Device              Size   Type  Label        
------------------------------------------------------------------------------
0    >  /dev/nvme1n1p1  256.1 GB  btrfs  238GB        
1    >  /dev/nvme2n1p2  355.4 GB  btrfs  FilesSlower  
2    >  /dev/nvme0n1p2    2.0 TB  btrfs  Manjaro     

image

image

SugarBooty commented 2 years ago

I am having the same issue

tuh8888 commented 2 years ago

Also having this issue.

Seems to be related to this line in the README

Text file busy / btrfs returned an error: 256 / Failed to create snapshot can occur if you have a Linux swapfile mounted within the @ or @home subvolumes which prevents snapshot from succeeding. Relocate the swapfile out of @ or *@home, for example into it's own subvolume like @swap.

For me, I had Swapspace running. Running swapspace -e before creating a snapshot fixed the issue.