All of lore.kernel.org
 help / color / mirror / Atom feed
* Fwd: Deleting a Subvol from a Cancelled Btrfs-Send
       [not found] <CAKZK7uzNJWSQAmaem4eZj-dcSJOvmT=-Mn53rjCbb=fNY9zEhw@mail.gmail.com>
@ 2014-10-02  5:05 ` Justin Brown
  2014-10-02  6:53   ` Hugo Mills
  0 siblings, 1 reply; 3+ messages in thread
From: Justin Brown @ 2014-10-02  5:05 UTC (permalink / raw)
  To: linux-btrfs

I'm experimenting with btrfs-send. Previously (2014-09-26), I did my
first btrfs-send on a subvol, and that worked fine. Today, I tried to
send a new snapshot. Unfortunately, I realized part way through that I
forgot to specify the parent to only send a delta, and killed the send
with ^C.

On the destination, I'm left with:

~$ sudo btrfs subvol list /var/media/backups/venus/home/
ID 2820 gen 57717 top level 5 path media
ID 2821 gen 57402 top level 5 path ovirt
ID 4169 gen 57703 top level 2820 path media/backups/venus/home
ID 4170 gen 57575 top level 4169 path home-2014-09-26
ID 4243 gen 57707 top level 4169 path home-2014-10-01

Home-2014-10-01 was the partial send that was cancelled. I figured
that I could delete this partial subvol and try again.

~$ sudo btrfs subvol del home-2014-10-01
Transaction commit: none (default)
ERROR: error accessing 'home-2014-10-01'

Obviously, trying to delete the subvol directory fails too:

~$ sudo rm -rf /var/media/backups/venus/home/home-2014-10-01/
rm: cannot remove ‘/var/media/backups/venus/home/home-2014-10-01/’:
Operation not permitted

Is there anyway to delete this partial subvol?

Thanks,
Justin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fwd: Deleting a Subvol from a Cancelled Btrfs-Send
  2014-10-02  5:05 ` Fwd: Deleting a Subvol from a Cancelled Btrfs-Send Justin Brown
@ 2014-10-02  6:53   ` Hugo Mills
  2014-10-02  7:44     ` Justin Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Hugo Mills @ 2014-10-02  6:53 UTC (permalink / raw)
  To: Justin Brown; +Cc: linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 1860 bytes --]

On Thu, Oct 02, 2014 at 12:05:39AM -0500, Justin Brown wrote:
> I'm experimenting with btrfs-send. Previously (2014-09-26), I did my
> first btrfs-send on a subvol, and that worked fine. Today, I tried to
> send a new snapshot. Unfortunately, I realized part way through that I
> forgot to specify the parent to only send a delta, and killed the send
> with ^C.
> 
> On the destination, I'm left with:
> 
> ~$ sudo btrfs subvol list /var/media/backups/venus/home/
> ID 2820 gen 57717 top level 5 path media
> ID 2821 gen 57402 top level 5 path ovirt
> ID 4169 gen 57703 top level 2820 path media/backups/venus/home
> ID 4170 gen 57575 top level 4169 path home-2014-09-26
> ID 4243 gen 57707 top level 4169 path home-2014-10-01
> 
> Home-2014-10-01 was the partial send that was cancelled. I figured
> that I could delete this partial subvol and try again.
> 
> ~$ sudo btrfs subvol del home-2014-10-01
> Transaction commit: none (default)
> ERROR: error accessing 'home-2014-10-01'

   If you're not doing this from /var/media/backups/venus/home/ it
won't succeed. You need to specify (either via a relative path or an
absolute one) where the subvol is, not just what its name is.

   (Consider what happens if you have two filesystems, each with a
home-2014-09-26 subvol.)

   Hugo.

> Obviously, trying to delete the subvol directory fails too:
> 
> ~$ sudo rm -rf /var/media/backups/venus/home/home-2014-10-01/
> rm: cannot remove ‘/var/media/backups/venus/home/home-2014-10-01/’:
> Operation not permitted
> 
> Is there anyway to delete this partial subvol?
> 
> Thanks,
> Justin

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
           --- All hope abandon,  Ye who press Enter here. ---           

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fwd: Deleting a Subvol from a Cancelled Btrfs-Send
  2014-10-02  6:53   ` Hugo Mills
@ 2014-10-02  7:44     ` Justin Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Justin Brown @ 2014-10-02  7:44 UTC (permalink / raw)
  To: Hugo Mills, Justin Brown, linux-btrfs

Hugo,

Many thanks for the help. That was far easier than I was anticipating. :)

Now that I have that cleaned up, I'm having trouble with sending the
delta. Perhaps this is a limitation of send/receive because it seems
odd that btrfs-receive doesn't have a parent option.

I'm sending a snapshot from venus to spaceman using ssh for transport.

I prepared spaceman with

~$ mkdir -p /var/media/backups/venus/
~$ sudo btrfs subvol create /var/media/backups/venus/home

Then on venus, I created a read-only snapshot and sent it spaceman:

~$ sudo btrfs sub snap -r /home home-2014-09-26
~$ sudo btrfs send -vv home-2014-09-26 | ssh root@spaceman
"/usr/sbin/btrfs receive -vv /var/media/backups/venus/home"

All good so far. Now, I'm trying to send a delta:

~$ sudo btrfs send -vv -p home-2014-09-26 home-2014-10-01 | ssh
root@spaceman "/usr/sbin/btrfs receive -vv
/var/media/backups/venus/home"

receiving snapshot home-2014-10-01
uuid=60dd57bd-4cd0-394c-ba85-065f646829d7, ctransid=446614
parent_uuid=a994d4b5-6c89-9442-a5cc-ffa1d74b9847,
parent_ctransid=432944
At snapshot home-2014-10-01
It seems that you have changed your default subvolume or you specify
other subvolume to
mount btrfs, try to remount this btrfs filesystem with fs tree, and
run btrfs receive again!

I'm not sure what "fs tree" is supposed to mean, and Google didn't
have anything useful. On spaceman, the target btrfs file system is
multi-device RAID10 with the "media" subvol mounted at /var/media and
"ovirt" subvol at /var/ovirt. There are also the subvols
"backups/venus/home" and "backups/venus/home/home-2014-09-26," which I
suppose is only mounted because I haven't rebooted or unmounted since
creating and sending them, respectively.

This seems like it's falling into the third caveat from `man btrfs-receive`:

3. default subvolume is changed or you don’t mount btrfs filesystem
with fs tree.

I don't have any idea what that means, and the Btrfs mount options
page (https://btrfs.wiki.kernel.org/index.php/Mount_options) doesn't
provide any help.

In a vain effort, I tried setting setting the default subvolume to both

~$ sudo btrfs subvolume set-default 4169
/var/media/backups/venus/home/home-2014-09-26

and then

~$ sudo btrfs subvolume set-default 4170
/var/media/backups/venus/home/home-2014-09-26

Neither had any effect on the error output.

It really seems like the command should be something like:

~$ sudo btrfs send -vv -p home-2014-09-26 home-2014-10-01 | ssh
root@spaceman.lab.fandingo.org "/usr/sbin/btrfs receive -vv -p
/var/media/backups/venus/home/home-2014-09-26
/var/media/backups/venus/home/"

Any idea what's happening? I can't find a single example online of
sending a delta over ssh.

Thanks,
Justin

On Thu, Oct 2, 2014 at 1:53 AM, Hugo Mills <hugo@carfax.org.uk> wrote:
> On Thu, Oct 02, 2014 at 12:05:39AM -0500, Justin Brown wrote:
>> I'm experimenting with btrfs-send. Previously (2014-09-26), I did my
>> first btrfs-send on a subvol, and that worked fine. Today, I tried to
>> send a new snapshot. Unfortunately, I realized part way through that I
>> forgot to specify the parent to only send a delta, and killed the send
>> with ^C.
>>
>> On the destination, I'm left with:
>>
>> ~$ sudo btrfs subvol list /var/media/backups/venus/home/
>> ID 2820 gen 57717 top level 5 path media
>> ID 2821 gen 57402 top level 5 path ovirt
>> ID 4169 gen 57703 top level 2820 path media/backups/venus/home
>> ID 4170 gen 57575 top level 4169 path home-2014-09-26
>> ID 4243 gen 57707 top level 4169 path home-2014-10-01
>>
>> Home-2014-10-01 was the partial send that was cancelled. I figured
>> that I could delete this partial subvol and try again.
>>
>> ~$ sudo btrfs subvol del home-2014-10-01
>> Transaction commit: none (default)
>> ERROR: error accessing 'home-2014-10-01'
>
>    If you're not doing this from /var/media/backups/venus/home/ it
> won't succeed. You need to specify (either via a relative path or an
> absolute one) where the subvol is, not just what its name is.
>
>    (Consider what happens if you have two filesystems, each with a
> home-2014-09-26 subvol.)
>
>    Hugo.
>
>> Obviously, trying to delete the subvol directory fails too:
>>
>> ~$ sudo rm -rf /var/media/backups/venus/home/home-2014-10-01/
>> rm: cannot remove ‘/var/media/backups/venus/home/home-2014-10-01/’:
>> Operation not permitted
>>
>> Is there anyway to delete this partial subvol?
>>
>> Thanks,
>> Justin
>
> --
> === Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
>   PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
>            --- All hope abandon,  Ye who press Enter here. ---

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-02  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAKZK7uzNJWSQAmaem4eZj-dcSJOvmT=-Mn53rjCbb=fNY9zEhw@mail.gmail.com>
2014-10-02  5:05 ` Fwd: Deleting a Subvol from a Cancelled Btrfs-Send Justin Brown
2014-10-02  6:53   ` Hugo Mills
2014-10-02  7:44     ` Justin Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.