different dir is used for backups after docker is installed

Bug #1652975 reported by Mateusz Czapliński
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
TimeShift
Fix Released
Medium
Tony George

Bug Description

After installing docker (on Ubuntu 16.04 LTS), timeshift switches to using directory '/var/lib/docker/aufs/timeshift/' for keeping snapshots, instead of normal '/timeshift/' (and doesn't see old snapshots anymore).

Most probably, that's because docker registers a new mount point at /var/lib/docker/aufs path for the same device as / - e.g. my /proc/mounts (apparently loaded by Device.vala) has the following entries, in order as shown:

$ cat /proc/mounts | grep vg-root
/dev/mapper/ubuntu--vg-root / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
/dev/mapper/ubuntu--vg-root /var/lib/docker/aufs ext4 rw,relatime,errors=remount-ro,data=ordered 0 0

Please note I've excluded /var/lib/docker/*** in /etc/timeshift.json, otherwise this resulted in endless recursion, exhausting all available disk space on the device.

Revision history for this message
Mateusz Czapliński (akavel) wrote :

Note: see for example "Path" in the output of --list (in VirtualBox):

$ sudo timeshift --list
Device : /dev/sda1
UUID : 20ca77a0-f6a7-4f4e-be8d-5228f6be34ca
Path : /var/lib/docker/aufs
Device is OK
1 snapshots, 4.9 GB free

Num Name Tags Description
------------------------------------------------------------------------------
0 > 2016-12-28_20-21-14 O B D after mk2-docker

$ sudo ls -lFA /var/lib/docker/aufs/timeshift/snapshots
total 4
drwxr-xr-x 3 root root 4096 Dec 28 21:00 2016-12-28_20-21-14/

$ ll /timeshift/snapshots
total 24
drwxr-xr-x 6 root root 4096 Dec 28 20:15 ./
drwxr-xr-x 9 root root 4096 Dec 28 20:15 ../
drwxr-xr-x 3 root root 4096 Dec 28 20:02 2016-12-28_19-58-54/
drwxr-xr-x 3 root root 4096 Dec 28 20:11 2016-12-28_20-11-02/
drwxr-xr-x 3 root root 4096 Dec 28 20:12 2016-12-28_20-12-06/
drwxr-xr-x 3 root root 4096 Dec 28 20:15 2016-12-28_20-15-08/

Revision history for this message
Tony George (teejee2008) wrote : Re: [Bug 1652975] Re: different dir is used for backups after docker is installed

Docker is not supported. /var/lib/docker/aufs will be excluded in next
update.

On Dec 28, 2016 11:50 PM, "Mateusz Czapliński" <email address hidden>
wrote:

Note: see for example "Path" in the output of --list (in VirtualBox):

$ sudo timeshift --list
Device : /dev/sda1
UUID : 20ca77a0-f6a7-4f4e-be8d-5228f6be34ca
Path : /var/lib/docker/aufs
Device is OK
1 snapshots, 4.9 GB free

Num Name Tags Description
------------------------------------------------------------
------------------
0 > 2016-12-28_20-21-14 O B D after mk2-docker

$ sudo ls -lFA /var/lib/docker/aufs/timeshift/snapshots
total 4
drwxr-xr-x 3 root root 4096 Dec 28 21:00 2016-12-28_20-21-14/

$ ll /timeshift/snapshots
total 24
drwxr-xr-x 6 root root 4096 Dec 28 20:15 ./
drwxr-xr-x 9 root root 4096 Dec 28 20:15 ../
drwxr-xr-x 3 root root 4096 Dec 28 20:02 2016-12-28_19-58-54/
drwxr-xr-x 3 root root 4096 Dec 28 20:11 2016-12-28_20-11-02/
drwxr-xr-x 3 root root 4096 Dec 28 20:12 2016-12-28_20-12-06/
drwxr-xr-x 3 root root 4096 Dec 28 20:15 2016-12-28_20-15-08/

--
You received this bug notification because you are subscribed to
TimeShift.
Matching subscriptions: timeshift-bugs
https://bugs.launchpad.net/bugs/1652975

Title:
  different dir is used for backups after docker is installed

Status in TimeShift:
  New

Bug description:
  After installing docker (on Ubuntu 16.04 LTS), timeshift switches to
  using directory '/var/lib/docker/aufs/timeshift/' for keeping
  snapshots, instead of normal '/timeshift/' (and doesn't see old
  snapshots anymore).

  Most probably, that's because docker registers a new mount point at
  /var/lib/docker/aufs path for the same device as / - e.g. my
  /proc/mounts (apparently loaded by Device.vala) has the following
  entries, in order as shown:

  $ cat /proc/mounts | grep vg-root
  /dev/mapper/ubuntu--vg-root / ext4 rw,relatime,errors=remount-ro,data=ordered
0 0
  /dev/mapper/ubuntu--vg-root /var/lib/docker/aufs ext4
rw,relatime,errors=remount-ro,data=ordered 0 0

  Please note I've excluded /var/lib/docker/*** in /etc/timeshift.json,
  otherwise this resulted in endless recursion, exhausting all available
  disk space on the device.

To manage notifications about this bug go to:
https://bugs.launchpad.net/timeshift/+bug/1652975/+subscriptions

Revision history for this message
Mateusz Czapliński (akavel) wrote :

For the time being, I seem to have found a workaround: immediately after installing Docker, I issue the following command:

$ sudo ln -s /timeshift /var/lib/docker/aufs/timeshift

and TimeShift seems to correctly detect the old snapshots then. (Note: For the record, I still keep /var/log/docker/*** in excludes in /etc/timeshift.json, as I don't want Docker images in snapshots.)

Regarding your note: do you expect to trickle the aufs exclusion into timeshift's ppa soon-ish, or rather as a part of some larger update at some further point? Not pressing for me now that I found a workarkound, but still curious, if it's ok for me to ask. Thanks!

Revision history for this message
Tony George (teejee2008) wrote :

I'm merging the features of Timeshift BTRFS into Timeshift so that users
can select between Rsync and BTRFS snapshots. It will take few weeks to
finish and test the changes.

BTRFS snapshots will be the better option for docker as it does not
duplicate files and creates a perfect copy of the file system.

Thanks,
Tony

On Dec 29, 2016 6:35 PM, "Mateusz Czapliński" <email address hidden>
wrote:

> For the time being, I seem to have found a workaround: immediately after
> installing Docker, I issue the following command:
>
> $ sudo ln -s /timeshift /var/lib/docker/aufs/timeshift
>
> and TimeShift seems to correctly detect the old snapshots then. (Note:
> For the record, I still keep /var/log/docker/*** in excludes in
> /etc/timeshift.json, as I don't want Docker images in snapshots.)
>
> Regarding your note: do you expect to trickle the aufs exclusion into
> timeshift's ppa soon-ish, or rather as a part of some larger update at
> some further point? Not pressing for me now that I found a workarkound,
> but still curious, if it's ok for me to ask. Thanks!
>
> --
> You received this bug notification because you are subscribed to
> TimeShift.
> Matching subscriptions: timeshift-bugs
> https://bugs.launchpad.net/bugs/1652975
>
> Title:
> different dir is used for backups after docker is installed
>
> Status in TimeShift:
> New
>
> Bug description:
> After installing docker (on Ubuntu 16.04 LTS), timeshift switches to
> using directory '/var/lib/docker/aufs/timeshift/' for keeping
> snapshots, instead of normal '/timeshift/' (and doesn't see old
> snapshots anymore).
>
> Most probably, that's because docker registers a new mount point at
> /var/lib/docker/aufs path for the same device as / - e.g. my
> /proc/mounts (apparently loaded by Device.vala) has the following
> entries, in order as shown:
>
> $ cat /proc/mounts | grep vg-root
> /dev/mapper/ubuntu--vg-root / ext4 rw,relatime,errors=remount-ro,data=ordered
> 0 0
> /dev/mapper/ubuntu--vg-root /var/lib/docker/aufs ext4
> rw,relatime,errors=remount-ro,data=ordered 0 0
>
> Please note I've excluded /var/lib/docker/*** in /etc/timeshift.json,
> otherwise this resulted in endless recursion, exhausting all available
> disk space on the device.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/timeshift/+bug/1652975/+subscriptions
>

Revision history for this message
Tony George (teejee2008) wrote :

/var/lib/docker is excluded in Timeshift v17.1

Changed in timeshift:
status: New → Fix Released
importance: Undecided → Medium
assignee: nobody → Tony George (teejee2008)
Revision history for this message
Jonathan K Thompson (mathfish) wrote :

I am experiencing the same problem with TimeShift v17.2 on Linux Mint 18.

I installed Docker and experienced some issues later that needed me to rollback to a restore point with Timeshift but noticed my snapshots were also in /var/lib/docker/aufs. I was able to do what the OP wrote by making a symbolic link to /timeshift to get access to my old snapshots to roll back to before I installed Docker.

But I do need to use Docker.

Am I to do something particular to apply your fix mentioned on 2017-01-21?

I have been using Rsync snapshots but you alluded to BTFRS being better for docker. Does that mean I need to switch over to BTFRS snapshots once installing docker?( I am new Linux user so I am really not too sure the difference between the two)

Thanks,
Jonathan

Revision history for this message
Tony George (teejee2008) wrote :

If your system partition is formatted as BTRFS you can use the BTRFS
snapshots. BTRFS snapshots will not cause any problems with docker.

If you want to continue using RSYNC snapshots, then add an exclude entry
for /var/lib/docker from the Settings window.

On Mar 26, 2017 9:15 PM, "Jonathan K Thompson" <email address hidden>
wrote:

I am experiencing the same problem with TimeShift v17.2 on Linux Mint
18.

I installed Docker and experienced some issues later that needed me to
rollback to a restore point with Timeshift but noticed my snapshots were
also in /var/lib/docker/aufs. I was able to do what the OP wrote by
making a symbolic link to /timeshift to get access to my old snapshots
to roll back to before I installed Docker.

But I do need to use Docker.

Am I to do something particular to apply your fix mentioned on
2017-01-21?

I have been using Rsync snapshots but you alluded to BTFRS being better
for docker. Does that mean I need to switch over to BTFRS snapshots once
installing docker?( I am new Linux user so I am really not too sure the
difference between the two)

Thanks,
Jonathan

--
You received this bug notification because you are a bug assignee.
Matching subscriptions: timeshift-bugs
https://bugs.launchpad.net/bugs/1652975

Title:
  different dir is used for backups after docker is installed

Status in TimeShift:
  Fix Released

Bug description:
  After installing docker (on Ubuntu 16.04 LTS), timeshift switches to
  using directory '/var/lib/docker/aufs/timeshift/' for keeping
  snapshots, instead of normal '/timeshift/' (and doesn't see old
  snapshots anymore).

  Most probably, that's because docker registers a new mount point at
  /var/lib/docker/aufs path for the same device as / - e.g. my
  /proc/mounts (apparently loaded by Device.vala) has the following
  entries, in order as shown:

  $ cat /proc/mounts | grep vg-root
  /dev/mapper/ubuntu--vg-root / ext4 rw,relatime,errors=remount-ro,data=ordered
0 0
  /dev/mapper/ubuntu--vg-root /var/lib/docker/aufs ext4
rw,relatime,errors=remount-ro,data=ordered 0 0

  Please note I've excluded /var/lib/docker/*** in /etc/timeshift.json,
  otherwise this resulted in endless recursion, exhausting all available
  disk space on the device.

To manage notifications about this bug go to:
https://bugs.launchpad.net/timeshift/+bug/1652975/+subscriptions

Revision history for this message
Jonathan K Thompson (mathfish) wrote :

Thanks for the response Tony.

So I went to Settings > Filters > Add Folders > And selected /var/lib/docker
In the Include/Exclude Patterns window I have /var/lib/docker/*** with a red x next to it and the minus button highlighted.

But still no snapshots are showing and when I click Browse it takes me to /var/lib/docker/aufs.
I originally had a timeshift in there from when it was putting snapshots in this directory but I deleted made a symbolic link pointing to my /timeshift directory. So now no snapshots are showing.

Is this expected? And if not what should I be expecting to happen when I add /var/lib/docker to exclude?

Thanks again

Revision history for this message
Jonathan K Thompson (mathfish) wrote :

edit - sorry typing too fast. Just to be clear:

In my /var/lib/docker directory there is no timeshift directory and no symbolic link to /timeshift anymore. I deleted both and then applied did the exclude steps I listed. But now there are no snapshots showing and Browse still takes me to /var/lib/docker/aufs directory.

I am not sure if this is expected and if not what to do.

Thank you and sorry for the back and forth
Jonathan

Revision history for this message
Tony George (teejee2008) wrote :

I have no idea what's going on with Docker. Timeshift should not be used
along with it. You may get it to work but you may end up breaking your
system when you do a restore.

Please avoid using Timeshift on your system. You will run into many issues.

On Mar 27, 2017 2:45 AM, "Jonathan K Thompson" <email address hidden>
wrote:

edit - sorry typing too fast. Just to be clear:

In my /var/lib/docker directory there is no timeshift directory and no
symbolic link to /timeshift anymore. I deleted both and then applied did
the exclude steps I listed. But now there are no snapshots showing and
Browse still takes me to /var/lib/docker/aufs directory.

I am not sure if this is expected and if not what to do.

Thank you and sorry for the back and forth
Jonathan

--
You received this bug notification because you are a bug assignee.
Matching subscriptions: timeshift-bugs
https://bugs.launchpad.net/bugs/1652975

Title:
  different dir is used for backups after docker is installed

Status in TimeShift:
  Fix Released

Bug description:
  After installing docker (on Ubuntu 16.04 LTS), timeshift switches to
  using directory '/var/lib/docker/aufs/timeshift/' for keeping
  snapshots, instead of normal '/timeshift/' (and doesn't see old
  snapshots anymore).

  Most probably, that's because docker registers a new mount point at
  /var/lib/docker/aufs path for the same device as / - e.g. my
  /proc/mounts (apparently loaded by Device.vala) has the following
  entries, in order as shown:

  $ cat /proc/mounts | grep vg-root
  /dev/mapper/ubuntu--vg-root / ext4 rw,relatime,errors=remount-ro,data=ordered
0 0
  /dev/mapper/ubuntu--vg-root /var/lib/docker/aufs ext4
rw,relatime,errors=remount-ro,data=ordered 0 0

  Please note I've excluded /var/lib/docker/*** in /etc/timeshift.json,
  otherwise this resulted in endless recursion, exhausting all available
  disk space on the device.

To manage notifications about this bug go to:
https://bugs.launchpad.net/timeshift/+bug/1652975/+subscriptions

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.