0

I have a NAS server with 12 1T drives in a RAID10 linux soft array. The main data area is a 5.4TB XFS partition. On that partition, I've been creating iSCSI disk images, taking advantage of XFS's ability to "thin provision" space. That means allocating more disk than you are immediately going to use (i.e. oversell the disk). I currently have about 15TB allocated, though only about 4.5TB are actually used.

I need to setup a backup for this partition, but I don't want to create a 15+TB array to hold it, which I would need if I copied the disk images over directly.
My questions are: 1) How could I copy that partition without requiring the full allocated space. Would the LVM snapshot handle this? 2) Is there any way to do incremental backups of it (the backup will happen nightly and I don't want a multiple-TB transfer choking my network every night).

Here is my volume/partition configuration if it helps:

vgdisplay dedvol
  --- Volume group ---
  VG Name               dedvol
  System ID             
  Format                lvm2
  Metadata Areas        5
  Metadata Sequence No  10
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                5
  Act PV                5
  VG Size               5.46 TB
  PE Size               4.00 MB
  Total PE              1430796
  Alloc PE / Size       1414656 / 5.40 TB
  Free  PE / Size       16140 / 63.05 GB
  VG UUID               o1U6Ll-5WH8-Pv7Z-Rtc4-1qYp-oiWA-cPD246

lvdisplay /dev/dedvol/servers
  --- Logical volume ---
  LV Name                /dev/dedvol/servers
  VG Name                dedvol
  LV UUID                CcNLcI-1OgM-Slb3-JDg4-3Tak-PH7d-SxTzf8
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                5.40 TB
  Current LE             1414656
  Segments               5
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2
John P
  • 1,679
  • 6
  • 38
  • 59

1 Answers1

1

1) How could I copy that partition without requiring the full allocated space. Would the LVM snapshot handle this?

LVM really doesn't enter into this at all.

In theory, rsync with the --sparse should take care of both things for you. A sparse file is a form of "thin provisioning", commonly used for exactly what you're doing -- provisioning virtual block devices such as iSCSI LUNs or disk images for virtualization.

I don't know for certain but I'll bet that a file such as you've described on your XFS filesystem will be detected as a sparse file and treated accordingly.

If you've never used rsync before, a typical incantation would look something like:

rsync -a --sparse /path/to/src /path/to/destination

(Where /path/to/destination can be a remote system accessible via ssh.)

2) Is there any way to do incremental backups of it (the backup will happen nightly and I don't want a multiple-TB transfer choking my network every night).

This is What Rsync Is For. From Wikipedia:

rsync is a software application for Unix and Windows systems which synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate.

larsks
  • 43,623
  • 14
  • 121
  • 180