Size of partition has changed
Size of partition has changed
Good day CentOS Masters
I have a system I am trying to bring on line. I boot into rescue mode and go into shell and when I run a 'vgs' or 'pvs' command I get the following
WARNING: device /dev/sda5 has a size of 280941115 sectors which is smaller than corresponding PV size of 282267480 sectors. Was this device resized. (it was NOT)
vgs
One or more devices used as PVs in VOLGroup00 have changed sizes.
VG #PV #LV #SN Attr VSize VFree
VolGroup00 1 2 0 wz--n- 139.59g <1.47g
pvs
One or more devices used as PVs in VOLGroup00 have changed sizes
PV VG Fmt Attr PSize PFree
/dev/sda5 VolGroup00 lvm2 a-- 134.59g <1.47g
I added a screen shot of the lsblk command as well, and of course any assistance would be greatly appreciated
I have a system I am trying to bring on line. I boot into rescue mode and go into shell and when I run a 'vgs' or 'pvs' command I get the following
WARNING: device /dev/sda5 has a size of 280941115 sectors which is smaller than corresponding PV size of 282267480 sectors. Was this device resized. (it was NOT)
vgs
One or more devices used as PVs in VOLGroup00 have changed sizes.
VG #PV #LV #SN Attr VSize VFree
VolGroup00 1 2 0 wz--n- 139.59g <1.47g
pvs
One or more devices used as PVs in VOLGroup00 have changed sizes
PV VG Fmt Attr PSize PFree
/dev/sda5 VolGroup00 lvm2 a-- 134.59g <1.47g
I added a screen shot of the lsblk command as well, and of course any assistance would be greatly appreciated
- Attachments
-
- lsblk command.png (49.8 KiB) Viewed 187 times
Re: Size of partition has changed
That's telling you that somehow /dev/sda5 has shrunk from 282267480 to 280941115 sectors - which is 1326365 less than it was or about 647MB assuming 512 byte sectors. That's quite a lot of space to be missing.WARNING: device /dev/sda5 has a size of 280941115 sectors which is smaller than corresponding PV size of 282267480 sectors. Was this device resized. (it was NOT)
I would run fdisk -u /dev/sda and print the partition table using 'p' and also use 'v' to verify the sanity of it. The 'v' command should say something like
Remaining 2047 unallocated 512-byte sectors
and if you are really lucky, it will tell you that you have more than 1326365 left and then you can add those back into /dev/sda5 and cross your fingrs and hope that nothing got overwritten .
At any point in fdisk you can quit without saving using the 'q' command. Only use 'w' to write the partition table if you are 100% sure that any changes you have made are correct.
CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke
Re: Size of partition has changed
Hello again Trevor and thank you for that, here is what it states when I type p to list the partition table and v to check it
- Attachments
-
- fdisk V .png (9.25 KiB) Viewed 175 times
-
- partiton table of sda5.png (41.77 KiB) Viewed 175 times
Re: Size of partition has changed
Oh Yeah, My mistake. this does make more sense
- Attachments
-
- partiton table of sda.png (57.86 KiB) Viewed 161 times
-
- fdisk V .png (7.39 KiB) Viewed 161 times
Re: Size of partition has changed
So you magically have 1330757 free sectors and your partition has shrunk by 1326365. I think someone with root access has tried to shrink it the wrong way. You will need to - carefully - delete the current sda5 then redefine it starting on exactly the same sector number as now but extending an extra 1326365. You can add more than that if there are more available to be safe. Then tag the partition as 8e LVM. Print the partition table again beofre you save it and compare the before and after lists to see that it all looks good. Only then save it and cross your fingers and hope.
Backups are good!
Backups are good!
CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke
Re: Size of partition has changed
Trevor
Yes I noticed that as well. I did want to ask one more thing. I decided to track this down and fix it first because I believe it is causing my boot issue. What is your opinion of this boot message ? this is what I get when I try to boot normally. Also, When you say 'carefully" delete the sda5 partition is there another way to do it beside through fdisk?
Yes I noticed that as well. I did want to ask one more thing. I decided to track this down and fix it first because I believe it is causing my boot issue. What is your opinion of this boot message ? this is what I get when I try to boot normally. Also, When you say 'carefully" delete the sda5 partition is there another way to do it beside through fdisk?
- Attachments
-
- Initial Boot.png (195.8 KiB) Viewed 151 times
Re: Size of partition has changed
Not much experience with extended partitions.
It looks like sda5 uses the whole of the sda4 extended partition,
wouldn't you first need to expand/increase sda4?
It looks like sda5 uses the whole of the sda4 extended partition,
wouldn't you first need to expand/increase sda4?
Re: Size of partition has changed
Make sure you use fdisk in sector mode using fdisk -u so that when you print the partition table it lists it sector numbers. It needs to be that exact. I am unaware of any tool that will correct this sort of thing without human intervention and fdisk allows you to define to the nearest single sector both where it starts and its length. I think all of your fdisk posts have been in non-sector mode so are not accurate enough to work with.
That screenshot also looks like it's from an ancient system, maybe even CentOS 5
That screenshot also looks like it's from an ancient system, maybe even CentOS 5

CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke
Re: Size of partition has changed
Tunk
Boy, I just noticed what your are talking about. It sure looks like it but I know far less about extending partitions. I am trying to read as much as I can find
Boy, I just noticed what your are talking about. It sure looks like it but I know far less about extending partitions. I am trying to read as much as I can find