(solved)LVM df -h no additional space after lvextend

Kernels & Hardware, configuring network, installing services

(solved)LVM df -h no additional space after lvextend

Postby FeedMeAStrayCat » 2018-09-08 21:17

Hi Everyone,

My situation as noted above is that df -h is not displaying the additional space that I allocated to a logical volume. I know for a fact that I had the room to extend the volume but taking a look at vgdisplay, as well as shrinking another volume that didn't need so much room.

Here were my steps as noted in several how-to's and other articles. They pretty much all spell out the same steps.

1- Used umount on the logical volume, I realize that it doesn't need to be unmounted, but better safe then sorry (has to be done when shrinking).
2- Used lvextend -L+250G /dev/fileserver/tvshows -steps worked fine
3- Used resize2fs /dev/fileserver/tvshows
4-Got the message that the file system needed to be checked, looked back at the documentation, saw the step.
5-ran e2fsck -f /dev/fileserver/tvshows - no issues
-this is where things get messed up
6- Final step- ran resize2fs /dev/fileserver/tvshows
Revived the message - the file system is already ... long, nothing to do.

Took a look at df -h, no additional space added. I'm kind of at a loss here. Tried rebooting and same issue. Thanks for any and all help. Tried unmounting and re-mounting, not fixed.
File system is ext4.

John
Last edited by FeedMeAStrayCat on 2018-10-05 18:44, edited 1 time in total.
FeedMeAStrayCat
 
Posts: 76
Joined: 2014-09-05 15:28

Re: LVM df -h not showing additional space after lvextend

Postby GarryRicketson » 2018-09-08 21:35

I did not really look at all the text you show, some appears to be code or output of some sort, but is unclear , this is because you do not use code boxes.
But any way, a quick search gives me the impression there are various reasons this might occur :
why df -h not showing additional space after lvextend
One of many results:
http://www.microhowto.info/howto/increase_the_size_of_an_lvm_logical_volume.html
You should not at this stage expect to see any increase in the amount of usable space within whatever filesystem located on the logical volume, for example, as reported by the df command: it is only the size of the underlying block device that has been changed.

If the above does not apply to your situation, maybe some of the other results do, ...or maybe some one with better eyes and more experience will have a better answer.
Last edited by GarryRicketson on 2018-09-09 22:30, edited 1 time in total.
User avatar
GarryRicketson
 
Posts: 5131
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: LVM df -h not showing additional space after lvextend

Postby p.H » 2018-09-09 06:36

Can you post the result of the following commands so that we can have a better picture of the situation ?
Code: Select all
lvdisplay /dev/fileserver/tvshows
tune2fs -l /dev/fileserver/tvshows
df -h /dev/fileserver/tvshows
p.H
 
Posts: 602
Joined: 2017-09-17 07:12

Re: LVM df -h not showing additional space after lvextend

Postby FeedMeAStrayCat » 2018-09-09 22:16

Here you go. Stupid me forgot I was actually going on vacation this week, and I'd prefer not to SSH for this kind of issue. I do appreciate your help and I can post what I can in the meantime. If it's better to just close this one and open another when I get back I will do so.

Code: Select all
  --- Logical volume ---
  LV Path                /dev/fileserver/tvshows
  LV Name                tvshows
  VG Name                fileserver
  LV UUID                a32nAf-V6Gf-DdCj-BdXx-r034-M5hT-stXtf8
  LV Write Access        read/write
  LV Creation host, time DEBIAN, 2015-11-07 08:44:53 -0500
  LV Status              available
  # open                 1
  LV Size                246.00 GiB
  Current LE             62976
  Segments               4
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:3


Code: Select all
Filesystem volume name:   <none>
Last mounted on:          /mnt/tvshows
Filesystem UUID:          1e84b0e9-59d0-46f5-ae7c-eba7f42c6f94
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              16121856
Block count:              64487424
Reserved block count:     3109015
Free blocks:              8912627
Free inodes:              16117900
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1008
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Flex block group size:    16
Filesystem created:       Sat Nov  7 09:53:13 2015
Last mount time:          Sat Sep  8 13:10:22 2018
Last write time:          Sat Sep  8 13:10:22 2018
Mount count:              2
Maximum mount count:      -1
Last checked:             Sat Sep  8 09:17:42 2018
Check interval:           0 (<none>)
Lifetime writes:          256 GB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      162f26f8-c832-4503-b4e3-0504e08a338d


Code: Select all
Filesystem                      Size  Used Avail Use% Mounted on
/dev/mapper/fileserver-tvshows  243G  209G   23G  91% /mnt/tvshows
FeedMeAStrayCat
 
Posts: 76
Joined: 2014-09-05 15:28

Re: LVM df -h not showing additional space after lvextend

Postby FeedMeAStrayCat » 2018-09-09 22:17

GarryRicketson wrote:I did not really look at all the text you show, some appears to be code or output of some sort, but is unclear , this is because you do not use code boxes.
But any way, a quick search gives me the impression there are various reasons this might occur :
One of many results:
[url]http://www.microhowto.info/howto/increase_the_size_of_an_lvm_logical_volume.html] why df -h not showing additional space after lvextend

You should not at this stage expect to see any increase in the amount of usable space within whatever filesystem located on the logical volume, for example, as reported by the df command: it is only the size of the underlying block device that has been changed.

If the above does not apply to your situation, maybe some of the other results do, ...or maybe some one with better eyes and more experience will have a better answer.


Yes I did check that out. But it's weird, I've done it before and have seen the df -h show the results.
FeedMeAStrayCat
 
Posts: 76
Joined: 2014-09-05 15:28

Re: LVM df -h not showing additional space after lvextend

Postby GarryRicketson » 2018-09-09 22:20

If it's better to just close this one and open another when I get back I will do so.

We don't close topics like that, there is no time limit, it will still be here when you get back, and by that time there might be several posts with details to help you. Enjoy the vacation,
User avatar
GarryRicketson
 
Posts: 5131
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: LVM df -h not showing additional space after lvextend

Postby p.H » 2018-09-10 07:18

The 3 commands consistently report that the LV and filesystem size is 246 GiB. It looks like the lvextent command did not work as expected.
Did you check the available space in the VG with vgs and try to run the command again ?

Note : when the ext* filesystem is mounted (online resize), you do not have to run fsck before resize2fs.
p.H
 
Posts: 602
Joined: 2017-09-17 07:12

Re: LVM df -h not showing additional space after lvextend

Postby FeedMeAStrayCat » 2018-09-15 20:16

GarryRicketson wrote:
If it's better to just close this one and open another when I get back I will do so.

We don't close topics like that, there is no time limit, it will still be here when you get back, and by that time there might be several posts with details to help you. Enjoy the vacation,


Thank you very much for the vaca comment! OK now I'm back.
FeedMeAStrayCat
 
Posts: 76
Joined: 2014-09-05 15:28

Re: LVM df -h not showing additional space after lvextend

Postby FeedMeAStrayCat » 2018-09-15 20:26

p.H wrote:The 3 commands consistently report that the LV and filesystem size is 246 GiB. It looks like the lvextent command did not work as expected.
Did you check the available space in the VG with vgs and try to run the command again ?

Note : when the ext* filesystem is mounted (online resize), you do not have to run fsck before resize2fs.


I'm almost positive that I did check the VG's. This was one of the steps that was mentioned in the guides. I used vgdisplay though. Just ran vgs, and I can see that the command has a different output.

Running the vgs command shows I have 1.21t of free space on fileserver, and 1.27t on DEBIAN-vg. Finding a way to give more GB to the fileserver is something I would like to do, but that's for another day. Argg this is what stinks when you take a week off from a topic and then have to remember what the heck you did.

Let me take a look through my history of commands. Some I did via root user directly (sudo -s), some I did as my user but with sudo.
FeedMeAStrayCat
 
Posts: 76
Joined: 2014-09-05 15:28

Re: LVM df -h not showing additional space after lvextend

Postby FeedMeAStrayCat » 2018-09-15 21:07

OK just took a look through history...And now I'm really at a loss.

The only LV commands I can find are these. Tried through

Code: Select all
history | less
history | grep lv
history | grep lvextend
history | grep lvreduce



And this is all I could find.
Code: Select all
lvextend -L+250G /dev/fileserver/recordedtv



and,

Code: Select all
lvextend -L+250G /dev/mapper/fileserver-recordedtv


OK so that tells me I didn't extend tvshows like I wanted to (at least I think), but instead extended recordedtv. OK I'm an idiot there. But I cannot find the lvreduce command anywhere. I know I ran the command, because I remember it taking forever because I was reducing by almost a TB. Either I was hallucinating or the command isn't in history. I'm toying with the idea of trying another lvreduce or lvextend command.
FeedMeAStrayCat
 
Posts: 76
Joined: 2014-09-05 15:28

Re: LVM df -h not showing additional space after lvextend

Postby p.H » 2018-09-16 06:32

lvreduce does not take a long time to complete because it just truncates the LV without moving any data.
It is the filesystem reduce operation (resize2fs ?) which needs to move data from beyond to within the new size and probably took a long time.
p.H
 
Posts: 602
Joined: 2017-09-17 07:12

Re: LVM df -h not showing additional space after lvextend

Postby FeedMeAStrayCat » 2018-09-16 17:38

p.H wrote:lvreduce does not take a long time to complete because it just truncates the LV without moving any data.
It is the filesystem reduce operation (resize2fs ?) which needs to move data from beyond to within the new size and probably took a long time.


OK fair enough. Do you think it's worth another shot? Maybe just like a gig or something to see if one of the LV's either reduces or extends?

Still very strange that I cannot find the lvreduce command at all.
FeedMeAStrayCat
 
Posts: 76
Joined: 2014-09-05 15:28

Re: LVM df -h not showing additional space after lvextend

Postby p.H » 2018-09-17 08:45

Maybe you used lvresize instead of lvreduce.
Of course you can try again, provided that you do not skip any step.

reduce :
fsck -f LV
resize2fs LV to newsize
lvreduce LV to newsize

extend :
lvextend LV to newsize
resize2fs LV
p.H
 
Posts: 602
Joined: 2017-09-17 07:12

Re: LVM df -h not showing additional space after lvextend

Postby FeedMeAStrayCat » 2018-09-25 17:58

p.H wrote:Maybe you used lvresize instead of lvreduce.
Of course you can try again, provided that you do not skip any step.

reduce :
fsck -f LV
resize2fs LV to newsize
lvreduce LV to newsize

extend :
lvextend LV to newsize
resize2fs LV


OK will give it a shot and update with what happens.
FeedMeAStrayCat
 
Posts: 76
Joined: 2014-09-05 15:28

Re: LVM df -h not showing additional space after lvextend

Postby FeedMeAStrayCat » 2018-09-25 18:50

FeedMeAStrayCat wrote:
p.H wrote:Maybe you used lvresize instead of lvreduce.
Of course you can try again, provided that you do not skip any step.

reduce :
fsck -f LV
resize2fs LV to newsize
lvreduce LV to newsize

extend :
lvextend LV to newsize
resize2fs LV


OK will give it a shot and update with what happens.


OK so ran the commands as noted. fsck worked fine, resiz2fs worked fine, lvreduce did not work, received an error.

Code: Select all
command failed with status code 5


Another note, the filesystem was unmounted the reason being that it had to be to perform the resize2fs. Do not know why.

And yet another note, I did a df -h and it shows a reduction in the filesystem and the lv like I wanted. What the heck?

Code: Select all
Size Used Avaliable
/dev/mapper/fileserver-recordedtv
787G 129G 618G
FeedMeAStrayCat
 
Posts: 76
Joined: 2014-09-05 15:28

Next

Return to System configuration

Who is online

Users browsing this forum: No registered users and 11 guests

fashionable