fdisk shows no free sectors available, however a reboot fixes it, why?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Using blkid, pvs, vgs, lvs and df -ha, I confirm the Physical Volume, Logical Volume and Group Volume and increase the disk size in vCenter.
Using fdisk, I try to create another primary partition (we only can create 3 primary and one logical)
Code:
Disk /dev/sdg: 26.6 GB, 26687091200 bytes
Device Boot Start End Blocks Id System
/dev/sdg1 1 1698 13631487+ 8e Linux LVM
/dev/sdg2 1698 3394 13630817 8e Linux LVM
However when I go to add /dev/sdg3, I get the following from fdisk
Code:
fdisk no free sectors available
I try to run partprobe, hoping this would pick up space added to the data disk no nothing.
For the hell of it, I reboot and I try fdisk again and I'm able to proceed to add the new partition and using LVM successfully grow the disk.
I don't understand why fdisk wasn't allowing for the creation of the new disk, however a reboot fixed it...?
Hard disks traditionally didn't get bigger during running. You powered a machine down and swapped out the disk.
More recent versions are more amenable to this. From your own description, partprobe did nothing, so fdisk had nothing new to work with.
The kernel keeps a copy of the partition table. After making changes to the disk you need to reread the table by doing the command below. Reboot fixes this as well.
Code:
blockdev --rereadpt /dev/sdg
It is not uncommon to use this in a SAN when a disk has been made larger.
The kernel keeps a copy of the partition table. After making changes to the disk you need to reread the table by doing the command below. Reboot fixes this as well.
Code:
blockdev --rereadpt /dev/sdg
It is not uncommon to use this in a SAN when a disk has been made larger.
I couldn't even add a partition of 25 GB. I had to reboot first and then I was able to add the partition of 25 GB, ran partprobe and then went thru the LVM steps successfully.
Using blkid, pvs, vgs, lvs and df -ha, I confirm the Physical Volume, Logical Volume and Group Volume and increase the disk size in vCenter.
I don't understand why fdisk wasn't allowing for the creation of the new disk, however a reboot fixed it...?
Quote:
Originally Posted by syg00
Hard disks traditionally didn't get bigger during running. You powered a machine down and swapped out the disk.
More recent versions are more amenable to this. From your own description, partprobe did nothing, so fdisk had nothing new to work with.
That ^^^^^
VMs (unless the "guest" OS has been specifically patched / moduled to be aware of their underlying virtualization platform) will only detect changes to the disk size when rebooted, or in the case of Citrix XenServer restarted.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.