Changes

Jump to: navigation, search

Logical Volume Management

241 bytes added, 14:56, 5 February 2011
Filesystems on LVs
# Reduce the filesystem in lv_home by 5G
resize2fs /dev/vg_muskoka/lv_home -5G50G
# Shrink the LV:
lvreduce vg_muskoka/lv_home --size -5G
# or specify an absolute size of 50G
{{Admon/important|Check your arguments!|lvreduce, and lvextend, and resize2fs can all both take absolute or relative size arguments. For example, <code>-5G</code> means "reduce the size by five gigabytes", but <code>5G</code> means "make the size five gigabytes". If you have a 100G LV, the command <code>lvresize vg_muskoka/lv_home --size -5G</code> would shrink it to 95G, but accidentally typing <code>lvresize vg_muskoka/lv_home --size 5G</code> would shrink it to 5G. This would cause data loss if you have previously resized the filesystem to 95G. Remember to check your commands carefully.}} {{Admon/important|Non-integer sizes|The LVM commands accept fractional sizes such as 1.5G, but resize2fs does not -- so you must use the next-smallest unit. For example, 1.5G corresponds to 1536M (1.5 * 1024M).}}
Remember the order in which the filesystem and LV size must be adjusted:

Navigation menu