Archive for the tag 'Splitting'

SBDavid

Splitting a Volume Group

Splitting a Volume Group

To split the physical volumes of a volume group and create a new volume group, use the vgsplit command.

Logical volumes cannot be split between volume groups. Each existing logical volume must be entirely on the physical volumes forming either the old or the new volume group. If necessary, however, you can use the pvmove command to force the split.

The following example splits off the new volume group vgsmall from the original volume group vgbig.

vgsplit bigvg vgsmall /dev/disk1
Volume group “vgsmall” successfully split from “vgbig”
SBDavid

Splitting a file in GNU/Linux

Splitting a file in GNU/Linux

If you want to split a file “myvideo” with size 9.6 Mb( 10000000 b) into two, then the command to do the same is:

$ split -b 5000000 myvideo

File “myvideo” is now split into two files “xaa” and “xab” by default and these two files will be having the size 5000000 b. Reducing file size will lead to more number of new files generated. You can also specify the output filename. Suppose you want to use output file name as “video”, then the following command will help you:

$ split -b 5000000 example myvideo

Now how to join the splitted files? You can use the cat command to join the splitted files. For example if the new files generated by split are “xaa”, “xab” and “xac”, use the following command to join the splitted files.

$ cat xa* > filename