Expanding A Linux Filesystem

[[[TOC]]]
———-
= Expand the Partition/Logical Volume =
* **LVM (Ideal Method)**
{{{
vgextend LogicalVolume /dev/sdd #< Add /dev/sdd to volume group lvextend -l +100%FREE /dev/VolumeGroup/LogicalVolume #< Fill free space }}} * **Partitions (Through parted)** ** Open parted {{{ parted /dev/sdd #< Sub /dev/sdd for your HDD location }}} ** Display in sectors {{{ unit s }}} ** Show partition Table, note the partition number you want to expand {{{ print }}} ** Remove the partition you want to expand (change the 1 to match above partition #) {{{ rm 1 }}} ** Create a partition that spans the whole disc {{{ mkpart primary 0 -1 }}} = Expand the filesystem = * EXT 2/3/4 (Will need to unmount if kernel has not been patched with ext2online..which is dangerous according to docs) {{{ resize2fs /dev/VolumeGroup/LogicalVolume #< Expand the filesystem to fill the partition }}} * Reiserfs {{{ resize_reiserfs -f /dev/VolumeGroup/LogicalVolume #< Expand the filesystem to fill the partition }}} * XFS (note the use of the mount point and not the logical volume - online expansion) {{{ xfs_growfs -d /$MOUNT/$LOCATION #< Expand the filesystem to fill the partition #< Expand the filesystem to fill the partition }}} * JFS (note the use of the mount point and not the logical volume - online expansion) {{{ mount -o remount,resize /$MOUNT/$LOCATION #< Expand the filesystem to fill the partition }}}


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *