Re: Move data and mount point to subvolume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 16/09/18, Hans van Kranenburg (hans.van.kranenburg@xxxxxxxxxx) wrote:
> On 09/16/2018 02:37 PM, Hans van Kranenburg wrote:
> > On 09/16/2018 01:14 PM, Rory Campbell-Lange wrote:
...
> >> We have /bkp with /bkp/backup in it. We would like to mount /bkp/backup
> >> at /bkp instead. Note that /bkp/backup has a lot of hardlinked files.
...
> So, what you can do is (similar to what I earlier typed):
> 
> * You now have subvol 5 (at /bkp)
> * btrfs sub snap /bkp /bkp/backup-subvol
> * Now you have a new subvol (256 or higher number) which already
> contains everything
> * Then inside /bkp/backup-subvol you will again see
> /bkp/backup-subvol/backup (since you snapshotted the toplevel which also
> contains it)
> * Now mv /bkp/backup/backup-subvol/* /bkp/backup-subvol (so the mv
> operations stays within the same subvolume)
> * Then remove everything outside /bkp/backup-subvol and mv
> /bkp/backup-subvol /bkp/backup, and then voila... you can now use
> subvol=/backup to mount it.

Thanks for the advice, Hans. Your suggestion makes complete sense.

So I did this:

    btrfs subvol snapshot /bkp /bkp/backup-subvol

strangely while /bkp/backup has lots of files in it,
/bkp/backup-subvol/backup has none.

# btrfs subvol list /bkp
ID 258 gen 313585 top level 5 path backup
ID 4782 gen 313590 top level 5 path backup-subvol

# btrfs fi du -s /bkp/backup-subvol/backup
     Total   Exclusive  Set shared  Filename
ERROR: cannot check space of '/bkp/backup-subvol/backup': Inappropriate
ioctl for device

Any ideas about what could be going on?

In the mean time I'm trying:

    btrfs subvol create /bkp/backup-subvol
    cp -prv --reflink=always /bkp/backup/* /bkp/backup-subvol/

One worry as I do this is that the Metadata seems to be building quickly
as I run this. At the start:

    # btrfs fi df /bkp
    Data, RAID1: total=2.52TiB, used=1.37TiB
    System, RAID1: total=32.00MiB, used=480.00KiB
    Metadata, RAID1: total=9.00GiB, used=4.80GiB <--- **
    GlobalReserve, single: total=512.00MiB, used=0.00B

15 minutes into the cp run:

    # btrfs fi df /bkp
    Data, RAID1: total=2.52TiB, used=1.37TiB
    System, RAID1: total=32.00MiB, used=480.00KiB
    Metadata, RAID1: total=9.00GiB, used=5.56GiB  <--- **
    GlobalReserve, single: total=512.00MiB, used=80.00KiB

Thanks very much for any further advice
Rory



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux