linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elliot Wolk <elliot.wolk@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: move subvolume to directory fails
Date: Sat, 17 Jan 2015 16:45:00 -0500	[thread overview]
Message-ID: <54BAD7DC.2020302@gmail.com> (raw)

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


                 reply	other threads:[~2015-01-17 21:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54BAD7DC.2020302@gmail.com \
    --to=elliot.wolk@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).