On 2015-04-24 10:26, 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

- change some configuration

- btrfs subvolume set-default 625 (id of the snapshot)

- reboot

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 !?

OS: SLES 12 64bit
kernel: 3.12.38-44-default

pc63422:~ # rpm -qa|grep -i btrfs
btrfsprogs-3.16.2-7.1.x86_64
libbtrfs0-3.16.2-7.1.x86_64
btrfsmaintenance-0.1-7.1.noarch

pc63422:~ # btrfs --version
Btrfs v3.16.2+20150127

pc63422:~ # btrfs fi show
Label: none  uuid: 7edcb64a-4ca6-47ec-8979-54e158c96ac2
         Total devices 1 FS bytes used 145.19GiB
         devid    1 size 450.00GiB used 150.04GiB path /dev/sda1

pc63422:~ # btrfs fi df /
Data, single: total=146.01GiB, used=142.74GiB
System, single: total=32.00MiB, used=16.00KiB
Metadata, single: total=4.00GiB, used=2.44GiB
GlobalReserve, single: total=512.00MiB, used=0.00B

Thanks for any hint.


So, a snapshot being read-only is totally different from the FS being mounted read-only. There is a special property on the snapshot that determines whether it is read-only or writable, which is first set when the snapshot is created. To change that property so that the snapshot is writable, you can use the following command from the top directory of the snapshot:
    btrfs property set . ro false


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to