Keith C. Perry on 27 Apr 2016 06:15:02 -0700

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

Re: [PLUG] disk image one-liner

XFS dumps are absolutely atomic.  When you run the dump operation you're getting a consistent representation (snapshot) at that time.  Changes can safely be made to the file system while the dumps are running and will get picked up in the next run of xfsdump.  You can also freeze the file system to insure no changes are made and everything is consistent on disk (i.e. all journal data has been processed) but I've only found the need to do that for disk images.

JP, a generic one liner for any file system would be:

(lets assume I'm in /mnt/vm)

find / -xdev -print0 | cpio -pmdv

would image the fs into /mnt/vm

find / -xdev -print0 | cpio -pmdv | lzop > fs.lzo

would create /mnt/vm/fs.lzo

Such an operation is not guaranteed to be atomic so it is best to do when that system us not in use.  Running this against an LV snapshot is just fine.

There is also the fsarchive program Rich mentioned but I would be wary of live dumping file systems that do not natively support it or are not using of an LV snapshot. I don't have any experience with it though.


Philadelphia Linux Users Group         --
Announcements -
General Discussion  --