HDD size not correct

Issues related to hardware problems
amir385276
Posts: 73
Joined: 2019/08/09 20:54:52

HDD size not correct

Post by amir385276 » 2021/12/26 18:39:30

Hi guys
i have a big issue
in the Centos 8 with 100GB HDD have a 2 size in the os
in the partedg show me the 99GB but in the df -h show me the 45GB

how to fix this issue
clip 13 - clip 14
thanks
Attachments
Clip_14.jpg
Clip_14.jpg (133.94 KiB) Viewed 4920 times
Clip_13.jpg
Clip_13.jpg (245.87 KiB) Viewed 4920 times

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: HDD size not correct

Post by TrevorH » 2021/12/27 14:02:54

Post the output from the following, all except the last need to be run as root (or via sudo)

pvs
vgs
lvs
df -m
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

amir385276
Posts: 73
Joined: 2019/08/09 20:54:52

Re: HDD size not correct

Post by amir385276 » 2021/12/27 16:22:44

Hi again TrevorH

see the clip16

thanks
Attachments
Clip_16.jpg
Clip_16.jpg (219.95 KiB) Viewed 4868 times

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: HDD size not correct

Post by TrevorH » 2021/12/27 18:16:53

So you have 50G spare in your current LVM Volume Group so can expand the cl-root LV from its current 46.83G to anything up to 93GB. Use man lvextend to see the way to use it and pay special attention to the -r switch as it will save you a subsequent step.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4531
Joined: 2007/12/11 08:17:33
Location: Finland

Re: HDD size not correct

Post by jlehtone » 2021/12/28 06:51:52

Out of curiosity: how was this system installed?
The installer's default is to create the '/boot', the root as LV, and 'swap' as LV, but '/home' as LV. [Edit: there was swap]
Yours is thus custom.


PS. One can usually copy-paste text from console into forum post (and format with code tags). Text is more convenient than bitmap images.
Last edited by jlehtone on 2021/12/28 10:23:32, edited 1 time in total.

amir385276
Posts: 73
Joined: 2019/08/09 20:54:52

Re: HDD size not correct

Post by amir385276 » 2021/12/28 09:45:58

Hi again TrevorH
I try something to extend the HDD but there is nothing
df -h = show me the 48GB

see the clip 17

thanks
Attachments
Clip_17.jpg
Clip_17.jpg (247.34 KiB) Viewed 4817 times

amir385276
Posts: 73
Joined: 2019/08/09 20:54:52

Re: HDD size not correct

Post by amir385276 » 2021/12/28 09:47:18

[root@198232002341490545939 ~]# lvextend -L +12800 /dev/mapper/cl-root
Insufficient free space: 3200 extents needed, but only 0 available
[root@198232002341490545939 ~]# resize2fs -f /dev/mapper/cl-root
resize2fs 1.45.6 (20-Mar-2020)
resize2fs: Bad magic number in super-block while trying to open /dev/mapper/cl-root
Couldn't find valid filesystem superblock.
[root@198232002341490545939 ~]#

User avatar
jlehtone
Posts: 4531
Joined: 2007/12/11 08:17:33
Location: Finland

Re: HDD size not correct

Post by jlehtone » 2021/12/28 10:35:07

amir385276 wrote:
2021/12/28 09:45:58
I try something to extend the HDD but there is nothing
"something" is not descriptive. You do show that you have increased the size of LV.
amir385276 wrote:
2021/12/28 09:47:18
[root@198232002341490545939 ~]# lvextend -L +12800 /dev/mapper/cl-root
Insufficient free space: 3200 extents needed, but only 0 available
[root@198232002341490545939 ~]# resize2fs -f /dev/mapper/cl-root
resize2fs 1.45.6 (20-Mar-2020)
resize2fs: Bad magic number in super-block while trying to open /dev/mapper/cl-root
Couldn't find valid filesystem superblock.
[root@198232002341490545939 ~]#
If you did extend the LV already, then there are no more free extents in the VG, so naturally the new 'lvenxtend' will fail.

You have nowhere shown what filesystem is in 'cl-root'.
The 'lvextend -r ...' would have called appropriate "resize filesystem" command.
The 'resize2fs' works with some filesystem types, but not all.

To see filesystem:

Code: Select all

lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT

amir385276
Posts: 73
Joined: 2019/08/09 20:54:52

Re: HDD size not correct

Post by amir385276 » 2021/12/28 18:52:19

Hi guys
i try the trevorH commands
and i don't know why the df -h show me the 47GB

i'm confused
see clip18
thanks
Attachments
Clip_18.jpg
Clip_18.jpg (194.9 KiB) Viewed 4775 times

amir385276
Posts: 73
Joined: 2019/08/09 20:54:52

Re: HDD size not correct

Post by amir385276 » 2021/12/28 19:01:14

I try this
resize2fs /dev/mapper/cl-root
resize2fs: Bad magic number in super-block while trying to open /dev/mapper/cl-root
Couldn't find valid filesystem superblock.

thanks

Post Reply