Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #266479

Re: Resizing LVM partitions

From Miroslav Skoric <skoric@uns.ac.rs>
Newsgroups linux.debian.user
Subject Re: Resizing LVM partitions
Date 2024-01-22 23:20 +0100
Message-ID <HZaO5-4Ub1-9@gated-at.bofh.it> (permalink)
References <HZ3Wi-4PQj-9@gated-at.bofh.it> <HZ4fD-4Qcu-13@gated-at.bofh.it> <HZ4yZ-4QiC-11@gated-at.bofh.it> <HZ4IF-4QlW-13@gated-at.bofh.it> <HZ6Kt-4RvH-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 1/22/24 6:59 PM, tomas@tuxteam.de wrote:
> On Mon, Jan 22, 2024 at 03:40:06PM +0000, Alain D D Williams wrote:
>> On Mon, Jan 22, 2024 at 10:29:55AM -0500, Stefan Monnier wrote:
>>>> lvextend --size +1G --resizefs /dev/mapper/localhost-home
>>>>
>>>> Ie get lvextend to do the maths & work it out for me.
>>>>
>>>> Those who are cleverer than me might be able to tell you how to get it right
>>>> first time!
>>>
>>> lvreduce --size -50G --resizefs /dev/mapper/localhost-home
>>
>> Oh, even better. It is a long time since I looked at than man page.
>>
>> Does this still need to be done with the file system unmounted or can it be
>> done with an active file system these days ?
> 
> You have first to shrink the file system (if it's ext4, you can use
> resize2fs: note that you can only *grow* an ext4 which is mounted
> (called "online resizing) -- to *shrink* it, it has to be unmounted.
> 

I will check it again but I think that file systems in that LVM are 
ext3. So it requires all of them to be unmounted prior to resizing ?

> Since I wasn't quite sure whether ext2's Gs are the same as LVM's
> and didn't want to bother with whatever clippings each process
> takes, what I did in this situation was:
> 
>   - shrink (resize2fs) the file system to a size clearly below target
>   - resize the LVM to my target size
>   - resize2fs again without params, which lets it take whatever the
>     partition offers
> 

That last resize2fs (without params) would not work here, or at least it 
would not work for my three file systems that need to be extended: / , 
/usr , and /var . Maybe to extend each of them separately like this:

lvextend --size +1G --resizefs /dev/mapper/localhost-root
lvextend --size +1G --resizefs /dev/mapper/localhost-usr
lvextend --size +1G --resizefs /dev/mapper/localhost-var

?

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Resizing LVM partitions skoric@uns.ac.rs - 2024-01-22 16:00 +0100
  Re: Resizing LVM partitions Alain D D Williams <addw@phcomp.co.uk> - 2024-01-22 16:20 +0100
    Re: Resizing LVM partitions Stefan Monnier <monnier@iro.umontreal.ca> - 2024-01-22 16:40 +0100
      Re: Resizing LVM partitions Alain D D Williams <addw@phcomp.co.uk> - 2024-01-22 16:50 +0100
        Re: Resizing LVM partitions <tomas@tuxteam.de> - 2024-01-22 19:00 +0100
          Re: Resizing LVM partitions Miroslav Skoric <skoric@uns.ac.rs> - 2024-01-22 23:20 +0100
            Re: Resizing LVM partitions <tomas@tuxteam.de> - 2024-01-23 06:50 +0100
            Re: Resizing LVM partitions Andy Smith <andy@strugglers.net> - 2024-01-23 07:40 +0100
              Re: Resizing LVM partitions Miroslav Skoric <skoric@uns.ac.rs> - 2024-01-24 00:40 +0100
                Re: Resizing LVM partitions Greg Wooledge <greg@wooledge.org> - 2024-01-24 00:50 +0100
                Re: Resizing LVM partitions <tomas@tuxteam.de> - 2024-01-24 06:50 +0100
                Re: Resizing LVM partitions Greg Wooledge <greg@wooledge.org> - 2024-01-24 13:10 +0100
                Re: Resizing LVM partitions Miroslav Skoric <skoric@uns.ac.rs> - 2024-01-24 23:10 +0100
                Re: Resizing LVM partitions Greg Wooledge <greg@wooledge.org> - 2024-01-24 23:30 +0100
                Re: Resizing LVM partitions Stefan Monnier <monnier@iro.umontreal.ca> - 2024-01-25 15:20 +0100
                Re: Resizing LVM partitions Miroslav Skoric <skoric@uns.ac.rs> - 2024-01-26 13:40 +0100
                Re: Resizing LVM partitions Max Nikulin <manikulin@gmail.com> - 2024-01-24 03:30 +0100
                Re: Resizing LVM partitions Miroslav Skoric <skoric@uns.ac.rs> - 2024-01-24 23:20 +0100
                On the deprecation of separate /usr (Was: Re: Resizing LVM  partitions) Andy Smith <andy@strugglers.net> - 2024-01-24 23:30 +0100
                Re: Resizing LVM partitions Andy Smith <andy@strugglers.net> - 2024-01-24 13:10 +0100
        Re: Resizing LVM partitions Miroslav Skoric <skoric@uns.ac.rs> - 2024-01-22 23:20 +0100
          Re: Resizing LVM partitions Greg Wooledge <greg@wooledge.org> - 2024-01-22 23:30 +0100
            Re: Resizing LVM partitions Miroslav Skoric <skoric@uns.ac.rs> - 2024-01-24 00:40 +0100
    Re: Resizing LVM partitions Greg Wooledge <greg@wooledge.org> - 2024-01-22 17:10 +0100
      Re: Resizing LVM partitions <tomas@tuxteam.de> - 2024-01-22 19:10 +0100
        Re: Resizing LVM partitions Greg Wooledge <greg@wooledge.org> - 2024-01-22 19:50 +0100
        Re: Resizing LVM partitions Miroslav Skoric <skoric@uns.ac.rs> - 2024-01-24 00:40 +0100
      Re: Resizing LVM partitions Miroslav Skoric <skoric@uns.ac.rs> - 2024-01-24 00:40 +0100
    Re: Resizing LVM partitions Gremlin <scott-andrews@columbus.rr.com> - 2024-01-22 19:20 +0100
      Re: Resizing LVM partitions Greg Wooledge <greg@wooledge.org> - 2024-01-22 19:50 +0100
    Re: Resizing LVM partitions Miroslav Skoric <skoric@uns.ac.rs> - 2024-01-22 23:20 +0100

csiph-web