renaming read-only subvolumes works fine, as long as you dont move them to a new directory. create a ro snapshot, and mv it to a subdir or a parent directory. it fails with 'Read-only file system'. no nested-subvolumes involved, just the base and the single snapshot. is this a bug? is this by design? i cant find any documentation about it or any bug reports. all i see is the same advice 'just use mv to rename subvols', 'subvols are basically directories', etc.

this makes re-organizing subvolumes difficult, especially if you consider send|receive which cannot be snapshotted without breaking the parent ids. {for normal subvols, making a snapshot and deleting the old is a sufficient workaround}

root:~$ uname -r
3.18-0.towo-siduction-amd64
root:~$ mkfs.btrfs /dev/sdc1 -f
Btrfs v3.17
See http://btrfs.wiki.kernel.org for more information.

Turning ON incompat feature 'extref': increased hardlink limit per file to 65536
fs created label (null) on /dev/sdc1
    nodesize 16384 leafsize 16384 sectorsize 4096 size 15.01GiB
root:~$ mkdir test
root:~$ mount -t btrfs /dev/sdc1 test
root:~$ cd test
root:~/test$ touch content
root:~/test$
root:~/test$ btrfs subvol snapshot -r ./ ro_snap
Create a readonly snapshot of './' in './ro_snap'
root:~/test$ mv ro_snap/ ro_snap_applesauce
root:~/test$ mv ro_snap_applesauce/ ro_snap
root:~/test$
root:~/test$ mkdir snapshot_container
root:~/test$ mv ro_snap/ snapshot_container
mv: cannot move ‘ro_snap/’ to ‘snapshot_container/ro_snap’: Read-only file system
root:~/test$
root:~/test$ btrfs subvol snapshot -r ./ snapshot_container/ro_snap2
Create a readonly snapshot of './' in 'snapshot_container/ro_snap2'
root:~/test$ mv snapshot_container/ro_snap2/ snapshot_container/ro_snap2_applesauce root:~/test$ mv snapshot_container/ro_snap2_applesauce/ snapshot_container/ro_snap2
root:~/test$
root:~/test$ mv snapshot_container/ro_snap2/ .
mv: cannot move ‘snapshot_container/ro_snap2/’ to ‘./ro_snap2’: Read-only file system
root:~/test$
root:~/test$ mv snapshot_container/ snapshot_container_applesauce
root:~/test$ mv snapshot_container_applesauce/ro_snap2/ snapshot_container_applesauce/ro_snap2_applesauce root:~/test$ mv snapshot_container_applesauce/ro_snap2_applesauce/ snapshot_container_applesauce/ro_snap2
root:~/test$ mv snapshot_container_applesauce/ro_snap2/ .
mv: cannot move ‘snapshot_container_applesauce/ro_snap2/’ to ‘./ro_snap2’: Read-only file system

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to