
In power-of-two kilobytes, megabytes, gigabytes, terabytes, etc.


'm', 'g', 't' (either upper-case or lower-case), then it is interpreted If fs-size does not haveĪ suffix, it is interpreted as power-of-two kilobytes, unless the -bīlocksize option is specified, in which case fs-size is interpreted as The file system size is specified by fs-size. You can actually create a filesystem initially which does not take up the entire partition. Without resize2fs, the partition is bigger, but the filesystem isn't taking advantage of the available space. A filesystem is a structure that goes inside of that (or, on top of it, if you prefer) and which is used to provide a mapping between files (and directories and so on) to that device. A volume is a chunk of disk (like a partition) - or at least, the "virtual" equivalent. In a nutshell: After lvextend, LVM-level tools such as lvs, vgs, lvdisplay and vgdisplay will see the updated size, but the filesystem and any tools operating on it, like df, won't see it yet.īecause filesystems and logical volumes are different abstractions. The -resizefs option of lvextend just uses the fsadm resize command. It took a while until a common API was designed for filesystem extension that made it possible to implement the fsadm resize command, which provides an unified syntax for extending several filesystem types. And if the logical volume did not contain a filesystem but instead something like a "raw" database or an Oracle ASM volume, a yet another procedure would need to be applied.Įach filesystem has different internal workings and so the conditions for extending a filesystem will be different for each. Other filesystems may have their own extension tools.

For XFS, filesystems, you would use a xfs_growfs tool instead. This part is specific to the filesystem type, although the ext2/3/4 filesystem types are similar enough that they can all be resized with a single resize2fs tool. potentially moving some data blocks around if they are in the way of the previously-mentioned data structure extension.extending the block allocation data structures so that the filesystem can tell whether any block of the added space is in use or free.In the case of ext2/3/4 filesystems, this involves at least: If the LV contains an ext2/3/4 filesystem, the next step is to update the filesystem metadata to make the filesystem aware that it has the more space available, and to create/extend the necessary metadata structures to manage the added space. No matter what the filesystem type (or even whether or not there is a filesystem at all) on the LV, these operations are always similar. The lvextend command (without the -resizefs option) only makes the LVM-side arrangements to enlarge the block device that is the logical volume.
