[Novalug] Upgrading with LVM

Peter Larsen peter@peterlarsen.org
Tue Aug 19 18:52:02 EDT 2014


On 08/19/2014 10:46 AM, Jon LaBadie via Novalug wrote:
> On Tue, Aug 19, 2014 at 10:18:14AM -0500, Peter Larsen via Novalug wrote:
>> On 08/19/2014 09:31 AM, covici@ccs.covici.com wrote:
>>> You have to shrink the file system first and then do lvreduce to shrink
>>> the volume and yes  you need a live image or something because you can't
>>> do a shrink of a file system online, whereas you can expand one online
>>> i.e. when it is mounted.
>>>
>>> Peter Larsen <peter@peterlarsen.org> wrote:
>>>
>>>> So you do it from a live image or the install image in recovery mode?
>>>>
>>>> On 08/18/2014 11:11 PM, covici@ccs.covici.com wrote:
>>>>> He can only do that if his root volume is offline because he is
>>>>> shrinking.
>>>>>
>> No - that's what the -r does. It's one operation.
>>
>>        -r, --resizefs
>>               Resize underlying filesystem together with the logical
>> volume using fsadm(8).
>>
> I'm assuming fsadm and lvresize call resize2fs for ext* type file
> systems.  If so, the resize2fs manpage has this text:
>
>   "If the filesystem is mounted, it can be used to expand
>    the size of the mounted filesystem, assuming the kernel
>    supports on-line resizing."
>
> Makes it sound like shrinking is only possible for unmounted file
> systems.

In most cases that's true, yes. It's true regardless of using partitions
or LVM. When you work on the root file system, you'll usually need to be
in recovery mode to work on it un-mounted.

Shrinking is usually a dangerous operations as it may need to move
existing inodes around. For that reason, having a backup before you
shrink is important. It can end badly. 

-- 
Regards
  Peter Larsen




More information about the Novalug mailing list