Re: rollback of a snapshot is just read-only

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 24, 2015 at 04:08:24PM +0200, Lentes, Bernd wrote:
> Hi,
> 
> it should be just a small problem, but it is one. How can I rollback to a snapshot of my root filesystem ?
> Googeling, I found a lot of solutions, each different.
> I finally choosed this one: https://btrfs.wiki.kernel.org/index.php/UseCases#I_want_to_be_able_to_do_rollbacks_with_Btrfs
> 
> I made the snapshot, changed some configuration, and afterwards I'd like to rollback to the snapshot:
> 
> - btrfs subvolume snapshot -r  /  /.snapshots/vor_nvidia

   You made a read-only snapshot.

> - change some configuration
> 
> - btrfs subvolume set-default 625 (id of the snapshot)
> 
> - reboot

   ... so it's going to be read-only when you try using it as your
root FS. :)

> My /-folder is again the old one, that's ok. The change of the configuration has disappeared. But it is just read-only:
> pc63422:~ # touch /test
> touch: cannot touch '/test': Read-only file system
> 
> mount says:
> 
> ...
> /dev/sda1 on /  type btrfs (rw,ssd,space_cache)
> ...
> 
> It seems to be rw !?

   There's a bit of an awkward distinction here: subvolumes (and hence
snapshots) have a read-only property which is entirely independent of
the mount flags. So you've got a read-write mount (i.e. the VFS will
allow a write attempt, and pass it down to the FS), but that part of
the FS is itself read-only (so the FS will complain).

   What you should probably be considering is not using set-default,
but instead using mount options (subvol=/path) to select the subvolume
you want to mount. If you want to make a read-only snapshot into a
read-write one, you can simply snapshot it again without the -r
option.

   Hugo.

-- 
Hugo Mills             | Reading Mein Kampf won't make you a Nazi. Reading
hugo@... carfax.org.uk | Das Kapital won't make you a communist. But most
http://carfax.org.uk/  | trolls started out with a copy of Lord of the Rings.
PGP: E2AB1DE4          |

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux