LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-31-2020, 08:45 PM   #1
FrizzledOldButt
Member
 
Registered: Dec 2015
Posts: 146

Rep: Reputation: Disabled
LVM2 management - Clarity Needed


Hi
Hopefully someone can clear my befuddled and foggy grey matter:

Running Ubuntu server 64bit 18.04 LTS with an LVM array on an HP Proliant NAS:

sudo lvdisplay
--- Logical volume ---
LV Path /dev/vgpool/logical_vol1
LV Name logical_vol1
VG Name vgpool
LV UUID BOWg21-9MFT-Mq1z-xheE-nHiE-G7ip-Mw7FrP
LV Write Access read/write
LV Creation host, time proliant, 2019-09-09 12:52:11 +0930
LV Status available
# open 1
LV Size 10.46 TiB
Current LE 2742352
Segments 4
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0


PV VG Fmt Attr PSize PFree
/dev/sdb1 vgpool lvm2 a-- 1.36t 0
/dev/sdc1 vgpool lvm2 a-- <1.82t 0
/dev/sdd1 vgpool lvm2 a-- <3.64t 0
/dev/sde1 vgpool lvm2 a-- <3.64t 0


PFree is being reported as zero. However, I know that at most there is only about 5T stored on the LVM array.

How can I check that all available HDD space has been allocated to the array?

NB: IIRC when I set it up a year or two ago I allocated 100%FREE for every device.


Thanks

Last edited by FrizzledOldButt; 01-31-2020 at 08:47 PM.
 
Old 01-31-2020, 08:53 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by FrizzledOldButt View Post
LV Size 10.46 TiB
...
PV VG Fmt Attr PSize PFree
/dev/sdb1 vgpool lvm2 a-- 1.36t 0
/dev/sdc1 vgpool lvm2 a-- <1.82t 0
/dev/sdd1 vgpool lvm2 a-- <3.64t 0
/dev/sde1 vgpool lvm2 a-- <3.64t 0
The LV size of 10.46 TB seems to be reasonably close to the sum of the PVs. I.e. the PVs are used up by this LV. PVs don't care what's used or free on the LV. Likewise, the LV doesn't care what's used on the filesystem that you may have created on top of it.

Last edited by berndbausch; 01-31-2020 at 08:54 PM.
 
Old 01-31-2020, 09:40 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,361

Rep: Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190
Mount the lv - it probably does by default at boot - then run this from a terminal.
Code:
df -hT
 
Old 01-31-2020, 10:19 PM   #4
FrizzledOldButt
Member
 
Registered: Dec 2015
Posts: 146

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Mount the lv - it probably does by default at boot - then run this from a terminal.
Code:
df -hT
Thanks for that. Now my confusion is complete:

Checking the logical volume, which if I understand correctly, is what the OS "sees",

Code:
sudo lvs 
  LV           VG     Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  logical_vol1 vgpool -wi-ao---- 10.46t
Is it correct that 10.46T should now be available at the mount point?

The above is now mounted at /mnt/lvm01 - checking the disk free space just 1.4T is reportedL

Code:
df -hT 
/dev/mapper/vgpool-logical_vol1 ext4      1.4T  476G  829G  37% /mnt/lvm01
the size 1.4T is the size of the first HDD in the array.

Cheers

Last edited by FrizzledOldButt; 01-31-2020 at 10:32 PM.
 
Old 01-31-2020, 11:32 PM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
The logical volume has a size of 10TB. The filesystem on it has a size of 1.4TB. Perhaps the LV was originally only on the first PV, but has been extended since. The filesystem was then not extended.

If you want that filesystem to occupy the entire 10TB, try
Code:
resize2fs /dev/vgpool/logical_vol1
 
Old 01-31-2020, 11:55 PM   #6
FrizzledOldButt
Member
 
Registered: Dec 2015
Posts: 146

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
The logical volume has a size of 10TB. The filesystem on it has a size of 1.4TB. Perhaps the LV was originally only on the first PV, but has been extended since. The filesystem was then not extended.

If you want that filesystem to occupy the entire 10TB, try
Code:
resize2fs /dev/vgpool/logical_vol1
OK, much obliged, although I had to run e2fsck first. Clearly when I replaced a HDD about 12 months ago I missed a step. Here's what I did just now:

Code:
sudo fsck -f /dev/vgpool/logical_vol1
sudo resize2fs /dev/vgpool/logical_vol1
sudo mount -a
df -h  /mnt/lvm01
/dev/mapper/vgpool-logical_vol1   11T  476G  9.4T   5% /mnt/lvm01
The total space is now reported as ~11T.

Many thanks for the help, guys.

Cheers
 
  


Reply

Tags
lvm2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lvm2 to non lvm2 L1nuxn00b703 Red Hat 5 12-18-2013 04:32 PM
Mplayer Video Clarity Problems on RedHat Enterprise Linux WS 4 anoopkjm Linux - Software 1 10-05-2006 06:41 AM
LXer: Clarity, internationalization on GPL 3 agenda LXer Syndicated Linux News 0 01-17-2006 06:31 AM
display clarity popcorn5714 Linux - Hardware 1 07-27-2002 10:40 PM
smtp clarity? ifm Linux - Software 0 06-07-2002 11:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration