2

I want to be able to take a snapshot and restore it in real time.

This works in Fedora and does a live "rollback" :

btrfs subvolume snapshot /home /home/snapshot
mv /home/snapshot /home

But in Ubuntu it just says that it can't move to the same place.
It will agree to move the snapshot folder elsewhere inside /home, but not to replace it.

Is there a way to get around the problem ?

7
  • I wouldn't blame Ubuntu for refusing to execute this mv command. You should maybe place the snapshot not inside the same folder that you are trying to replace.
    – harrymc
    Commented Jan 25, 2015 at 10:21
  • I know it looks strange, but it worked on fedora.
    – Dan
    Commented Jan 25, 2015 at 10:45
  • Ubuntu might be doing the mv in a more intelligent/optimized manner than Fedora.
    – harrymc
    Commented Jan 25, 2015 at 10:47
  • Please edit your question to include the output of btrfs subvolume list | grep /home, mount | grep /home, df | grep /home and uname -a, from both systems (clearly tagged so we can tell which one is which). This smells to me very much like either a kernel version (capability) difference or a file system hierarchy difference. (The btrfs command may require adjusting, but the idea is to get a list of btrfs' idea of what your /home and anything below it looks like.)
    – user
    Commented Jan 27, 2015 at 19:04
  • Why don't you divide this into 2 steps : (1) cp /home/snapshot /home, (2) rm -r -f /home/snapshot?
    – harrymc
    Commented Jan 28, 2015 at 14:54

1 Answer 1

1
+100

Evidently, Ubuntu might be doing the mv in a different manner than Fedora, which is why it is rejecting an operation that requires deleting the source of the move. This is most probably an over-strong check for correctness in the mv program, since a file-by-file move should succeed under Ubuntu as well as under Fedora.

The solution is to do the operation in two steps :

  1. Copy/resync the folder /home/snapshot to /home
  2. Remove the folder /home/snapshot (if really required).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .