On Sun, Sep 16, 2018 at 5:14 AM, Rory Campbell-Lange
<r...@campbell-lange.net> wrote:
> Hi
>
> We have a backup machine that has been happily running its backup
> partitions on btrfs (on top of a luks encrypted disks) for a few years.
>
> Our backup partition is on /bkp which is a top level subvolume.
>     Data, RAID1: total=2.52TiB, used=1.36TiB
> There are no other subvolumes.

and

> /dev/mapper/cdisk2 on /bkp type btrfs 
> (rw,noatime,compress=lzo,space_cache,subvolid=5,subvol=/)

I like Hans' 2nd email advice to snapshot the top level subvolume.

I would start out with:
btrfs sub snap -r /bkp /bkp/toplevel.ro

And that way I shouldn't be able to F this up irreversibly if I make a
mistake. :-D And then do another snapshot that's rw:

btrfs sub snap /bkp /bkp/bkpsnap
cd /bkp/bkpsnap

Now remove everything except "backupdir". Then move everything out of
backupdir including any hidden files. Then rmdir backupdir. Then you
can rename the snapshot/subvolume
cd ..
mv bkpsnap backup

That's less metadata writes than creating a new subvolume, and reflink
copying the backup dir, e.g. cp -a --reflink /bkp/backupdir
/bkp/backupsubvol

That could take a long time because all the metadata is fully read,
modified (new inodes) and written out.

But either way it should work.

-- 
Chris Murphy

Reply via email to