From: Piotr R. K. <pio...@mo...> - 2015-09-24 10:31:15
|
Dear William, > Does mfsappendchunks work the same way? (with the ability to merge multiple files) > Almost. mfsappendchunks (equivalent of mfssnapshot from MooseFS 1.5) appends a lazy copy of specified file(s) to specified snapshot file ("lazy" means that creation of new chunks is delayed to the moment one copy is modified). If multiple files are given, they are merged into one target file in the way that each file begins at chunk (64MB) boundary; padding space is left empty. mfsmakesnapshot makes a "real" snapshot (lazy copy, like in case of mfsappendchunks) of some object(s) or subtree (similarly to cp -r command). It's atomic with respect to each SOURCE argument separately. If DESTINATION points to already existing file, error will be reported unless -o (overwrite) option is given. Note: if SOURCE is a directory, it's copied as a whole; but if it's followed by trailing slash, only directory content is copied. Please find the example below. As you can see, after mfsappendchunks, file “a” have length over 64M. It is because first chunk is filled up with zeroes: root@ts10:/mnt/mfs/mfsappendchunks# echo "A" > a root@ts10:/mnt/mfs/mfsappendchunks# echo "B" > b root@ts10:/mnt/mfs/mfsappendchunks# ls -l total 1 -rw-r--r-- 1 root root 2 Sep 24 12:25 a -rw-r--r-- 1 root root 2 Sep 24 12:25 b root@ts10:/mnt/mfs/mfsappendchunks# mfsfileinfo a a: chunk 0: 0000000002912925_00000001 / (id:43067685 ver:1) copy 1: 10.10.10.6:9422 (status:VALID) copy 2: 10.10.10.7:9422 (status:VALID) root@ts10:/mnt/mfs/mfsappendchunks# mfsfileinfo b b: chunk 0: 0000000002912926_00000001 / (id:43067686 ver:1) copy 1: 10.10.10.4:9422 (status:VALID) copy 2: 10.10.10.10:9422 (status:VALID) root@ts10:/mnt/mfs/mfsappendchunks# mfsappendchunks a b root@ts10:/mnt/mfs/mfsappendchunks# mfsfileinfo a a: chunk 0: 0000000002912925_00000001 / (id:43067685 ver:1) copy 1: 10.10.10.6:9422 (status:VALID) copy 2: 10.10.10.7:9422 (status:VALID) chunk 1: 0000000002912926_00000001 / (id:43067686 ver:1) copy 1: 10.10.10.4:9422 (status:VALID) copy 2: 10.10.10.10:9422 (status:VALID) root@ts10:/mnt/mfs/mfsappendchunks# mfsfileinfo b b: chunk 0: 0000000002912926_00000001 / (id:43067686 ver:1) copy 1: 10.10.10.4:9422 (status:VALID) copy 2: 10.10.10.10:9422 (status:VALID) root@ts10:/mnt/mfs/mfsappendchunks# hexdump -C a 00000000 41 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |A...............| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 04000000 42 0a |B.| 04000002 root@ts10:/mnt/mfs/mfsappendchunks# ls -lha total 70M drwxr-xr-x 2 root root 2.0M Sep 24 12:25 . drwxr-xr-x 12 root root 3.9M Sep 24 12:19 .. -rw-r--r-- 1 root root 65M Sep 24 12:26 a -rw-r--r-- 1 root root 2 Sep 24 12:25 b root@ts10:/mnt/mfs/mfsappendchunks# Best regards, -- Piotr Robert Konopelko MooseFS Technical Support Engineer | moosefs.com <https://moosefs.com/> > On 19 Sep 2015, at 5:13 am, William Kern <wk...@bn...> wrote: > > So I imagine that > mfsmakesnapshot is really just cloning the metadata and then fills in after the fact when the source changes. > Does mfsappendchunks work the same way? (with the ability to merge multiple files) > Is there an advantage to one method or the other (especially in regards to a VM image)? > -wk > > > ------------------------------------------------------------------------------ > _________________________________________ > moosefs-users mailing list > moo...@li... > https://lists.sourceforge.net/lists/listinfo/moosefs-users |