All of lore.kernel.org
 help / color / mirror / Atom feed
* subvol copying
@ 2013-05-15  5:25 Russell Coker
  2013-05-15  7:40 ` Gabriel de Perthuis
  0 siblings, 1 reply; 6+ messages in thread
From: Russell Coker @ 2013-05-15  5:25 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org

A user of a workstation has a home directory /home/john as a subvolume.  I 
wrote a cron job to make read-only snapshots of it under /home/john/backup 
which was fortunate as they just ran a script that did something like
"rm -rf ~".

Apart from copying dozens of gigs of data back, is there a good way of 
recovering it all?  Whatever you suggest isn't going to work for this time 
(the copy is almost done) but will be useful for next time.

I'm guessing that I can't delete a subvol that has other subvols under it.

Should I have put the backups under /backup instead so that I could just 
delete the corrupted subvol and make a read-write snapshot of the last good 
one?

-- 
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/

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

* Re: subvol copying
  2013-05-15  5:25 subvol copying Russell Coker
@ 2013-05-15  7:40 ` Gabriel de Perthuis
  2013-05-15 16:43   ` Chris Murphy
  0 siblings, 1 reply; 6+ messages in thread
From: Gabriel de Perthuis @ 2013-05-15  7:40 UTC (permalink / raw)
  To: linux-btrfs

> A user of a workstation has a home directory /home/john as a subvolume.  I 
> wrote a cron job to make read-only snapshots of it under /home/john/backup 
> which was fortunate as they just ran a script that did something like
> "rm -rf ~".
> 
> Apart from copying dozens of gigs of data back, is there a good way of 
> recovering it all?  Whatever you suggest isn't going to work for this time 
> (the copy is almost done) but will be useful for next time.
> 
> Should I have put the backups under /backup instead so that I could just 
> delete the corrupted subvol and make a read-write snapshot of the last good 
> one?

You can move subvolumes at any time, as if they were regular directories.

For example: move the backups to an external location, move what's left
of the home to another location out of the way, and make a snapshot to
restore.



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

* Re: subvol copying
  2013-05-15  7:40 ` Gabriel de Perthuis
@ 2013-05-15 16:43   ` Chris Murphy
  2013-05-15 16:44     ` Harald Glatt
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Murphy @ 2013-05-15 16:43 UTC (permalink / raw)
  To: Btrfs BTRFS


On May 15, 2013, at 1:40 AM, Gabriel de Perthuis <g2p.code@gmail.com> wrote:

> 
> You can move subvolumes at any time, as if they were regular directories.

In the example case, the subvolumes are read-only. So is it possible to make a read-only subvolume (snapshot) read-writable? And is it possible to make a read-writeable snapshot of a read-only subvolume?


Chris Murphy


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

* Re: subvol copying
  2013-05-15 16:43   ` Chris Murphy
@ 2013-05-15 16:44     ` Harald Glatt
  2013-05-15 17:28       ` Chris Murphy
  0 siblings, 1 reply; 6+ messages in thread
From: Harald Glatt @ 2013-05-15 16:44 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Btrfs BTRFS

On Wed, May 15, 2013 at 6:43 PM, Chris Murphy <lists@colorremedies.com> wrote:
>
> On May 15, 2013, at 1:40 AM, Gabriel de Perthuis <g2p.code@gmail.com> wrote:
>
>>
>> You can move subvolumes at any time, as if they were regular directories.
>
> In the example case, the subvolumes are read-only. So is it possible to make a read-only subvolume (snapshot) read-writable? And is it possible to make a read-writeable snapshot of a read-only subvolume?
>
>
> Chris Murphy
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

You make a ro snapshot rw by creating a snapshot of it that is rw. So
yes to both questions, by doing the same thing in both cases.

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

* Re: subvol copying
  2013-05-15 16:44     ` Harald Glatt
@ 2013-05-15 17:28       ` Chris Murphy
  2013-05-15 17:30         ` Harald Glatt
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Murphy @ 2013-05-15 17:28 UTC (permalink / raw)
  To: Harald Glatt; +Cc: Btrfs BTRFS


On May 15, 2013, at 10:44 AM, Harald Glatt <mail@hachre.de> wrote:

> 
> You make a ro snapshot rw by creating a snapshot of it that is rw. So
> yes to both questions, by doing the same thing in both cases.

In other words, a normal snapshot (without -r) of a read-only snapshot will create a rw snapshot?

In any case, for the OP, making a rw snapshot of the last backup ro snapshot, and putting it in place of the home folder is the way to do the rollback.


Chris Murphy

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

* Re: subvol copying
  2013-05-15 17:28       ` Chris Murphy
@ 2013-05-15 17:30         ` Harald Glatt
  0 siblings, 0 replies; 6+ messages in thread
From: Harald Glatt @ 2013-05-15 17:30 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Btrfs BTRFS

On Wed, May 15, 2013 at 7:28 PM, Chris Murphy <lists@colorremedies.com> wrote:
>
> On May 15, 2013, at 10:44 AM, Harald Glatt <mail@hachre.de> wrote:
>
>>
>> You make a ro snapshot rw by creating a snapshot of it that is rw. So
>> yes to both questions, by doing the same thing in both cases.
>
> In other words, a normal snapshot (without -r) of a read-only snapshot will create a rw snapshot?

Yes

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

end of thread, other threads:[~2013-05-15 17:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-15  5:25 subvol copying Russell Coker
2013-05-15  7:40 ` Gabriel de Perthuis
2013-05-15 16:43   ` Chris Murphy
2013-05-15 16:44     ` Harald Glatt
2013-05-15 17:28       ` Chris Murphy
2013-05-15 17:30         ` Harald Glatt

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.